Sanity Challenge · Path Two

PIM-Lite

A product information manager for pushing an SFCC catalogue to Amazon. An AI agent audits each product against rules that live in Sanity as content, a Sanity Workflow moves it through review, and an approved product renders its own promo video.

The pipeline

  1. Draft
  2. Audit Pending
  3. Human Review
  4. Audit Passed
  5. Video Requested
  6. Video Ready
  7. Published

Every move between these stages is a workflow transition — the audit agent and the human reviewer both advance a product the same way.

What is unusual here

  • Audit rules are content, not code. The scoring engine reads its rules from Sanity at run time, so a merchandiser can add a check or change a severity without a deploy.
  • The workflow calls out. Entering the audit stage queues an effect that our own handler drains, which runs a Mastra agent against Gemini and writes the report back as a document.
  • Approval renders a video. Clearing review triggers a Remotion render whose copy comes from the audited product, and the finished video advances the workflow again.