1. CREATE LISTING
Admin creates a listing (address, property type, price, agent info).
2. UPLOAD ASSETS
Photos/videos uploaded via presigned S3 URLs → confirmed →
thumbnails generated, photos auto-classified by LLM vision,
asset hashes computed for caching.
3. GENERATE CALENDAR
POST /api/calendar/generate runs:
- account-level credit orchestration (budget across listings),
- eligibility pre-filter (does the listing have enough assets
for each template?),
- LLM template ranking (what content, in what order, on what dates),
→ produces CalendarEntry docs, each with a delivery date and a
production-start date (delivery − 48h buffer).
4. APPROVE / SCHEDULE
Entries are approved (manually or auto-approved via a DeliverySchedule).
Approval consumes a credit and creates a Job.
5. PRODUCTION PIPELINE (automated, SQS-driven workers)
The scheduler dispatches due jobs. Each job flows through a chain
of workers, each polling its own SQS queue:
image-edit → frame-expand → video-generate → reorder →
render-trigger → render-poll → delivery
- Asset preprocessing uses external AI services (Nano Banana for
image editing, Veo for video generation).
- Rendering happens on a Windows EC2 render server running After
Effects + nexrender.
- Processed assets are cached (SHA-256 of asset + params) so
identical work is never repeated.
6. DELIVER
The finished video lands in S3 and is delivered — emailed to the
agent, or POSTed to a webhook for editor test renders.
7. OBSERVE
Every step writes status to Firestore. Errors are classified into
a typed hierarchy, recorded as jobErrorEvents, surfaced as
notifications, and exposed through the admin monitoring API.
Failed/stalled jobs can be retried from the last successful step.