Batch generation turns a creative interface into an engineering system. A request might take longer than a normal HTTP response, be throttled, fail moderation or return an output that looks plausible but violates the story brief. The correct system needs durable job state, explicit provider contracts and human checkpoints; blindly submitting hundreds of prompts is both expensive and difficult to audit.
Define the durable job record
Assign every shot a canonical ID independent of its provider job ID. Store provider, exact model/version, requested ratio and seconds, prompts, source-asset hashes, consent status, request parameters, submit time, state, billed units and returned file checksums. Keep a dependency graph: the animated shot depends on an approved still and a rights-cleared script beat, and the final edit depends on a reviewed render.
A sensible state machine includes queued, submitted, processing, rendered, qc_failed, approved, exported and blocked. Do not mark approved merely because an API returned success. Audio sync, recognizable identity, motion consistency and policy compliance require their own tests. A rejected result should preserve its original generation evidence without entering the final publishing archive.
Recover safely
Use provider-supported polling or callbacks instead of inventing delays. Google’s older Veo guide discusses long-running generation and a limited server retention window; Gemini Omni uses its own interaction response. D-ID’s Talks endpoint exposes a webhook field and typed error categories. Build an adapter per provider rather than one universal parser that assumes all services return the same JSON shape.
For retry logic, distinguish transport failure, provider timeout, safety rejection and exhausted credits. Retrying a confirmed moderation rejection with trivial wording changes is not a legitimate recovery strategy. Prevent duplicate submissions when the client lost a response but the provider may have accepted the request. Save the job ID before attempting another billable generation.
Manage quotas and budgets
Limit concurrent jobs based on the actual account entitlement, not guesswork. Forecast upper spend from expected billable seconds and retry caps. Set a stop threshold on provider credits and maintain an approval gate before expanding a test batch to production scale. Track rejected footage and human edit time so that the system can improve its prompting and shot design without pretending to have independent benchmark evidence.
Archive the product
Download completed files promptly, verify media playback and compute local hashes. Export a simple manifest linking shot IDs to output paths, consent, model version and current approval. Preserve project files for future edits and keep separate storage policies for raw face recordings or sensitive customer video. A batch workflow should be reproducible and auditable even if the original model later shuts down.
Worked production example
A batch queue receives fifty prompts at once. Its worker should not immediately publish any returned files. Each output enters a QC queue with a frame-level thumbnail, duration check and audio synchronization result. If a job times out without confirming rejection, the worker should query status instead of blindly resubmitting another paid job. When a model ID is retired, stop new dispatch and preserve accepted outputs. A human producer approves story and identity continuity only after the batch has produced valid assets, separating automated validity checks from creative judgment.