video_workflow_render
Executes video workflow job specifications, running operations like trim, resize, convert, and merge. Supports variant rendering, resumption, and batch processing.
Instructions
Execute an agent workflow job-spec and return a provenance receipt.
Validates the spec first (fail-closed), then runs each allowlisted op
(probe|trim|resize|convert|merge|add_text|composite_layers) SEQUENTIALLY in spec order via the
backing engine functions. Intermediates are written to a per-run @work
directory unique to this invocation and cleaned on success (kept on failure);
final media lands at the declared @outputs paths.
Batch variants: pass variant=<id> to render one declared variant (its
overrides patch the shared steps/outputs, and the single @outputs path is
auto-named with the variant id so N variants emit N distinct outputs); the
receipt records workflow.variant. Pass all_variants=True to render EVERY
declared variant in turn and return a workflow_batch summary (one receipt
per variant, each into its own @work dir); use save_receipt_dir to also
write each variant's receipt to <dir>/<variant>.json. variant and
all_variants are mutually exclusive. Pass keep_intermediates=True to
retain @work intermediates even on success (recorded as the
keep-intermediates cleanup policy).
Pass resume_receipt (a prior render receipt from a job that failed with its
intermediates kept) to RESUME: the current spec_hash must equal the receipt's
(else fail-closed resume_spec_mismatch) AND, for a variant, the receipt's
variant must match (else resume_variant_mismatch); each step whose recorded
status is completed AND whose recorded input hashes still match AND whose
recorded output file still exists and re-hashes to the recorded hash is SKIPPED,
and the first step failing any check plus everything after it re-runs.
Returns a workflow receipt (receipt_kind: "workflow") capturing tool +
FFmpeg versions, the spec hash, per-source probes/hashes, per-step status with
real sha256 hashes of every consumed input and produced output, the cleanup
manifest, and the determinism-scope caveat. On the first failing step it fails
closed: the failure is recorded on the receipt (still written to
save_receipt when given) and surfaced as a structured error.
Args: spec_path: Absolute path to the workflow job-spec JSON file. resume_receipt: Optional path to a prior render receipt to resume from. save_receipt: Optional path to write the workflow receipt as JSON. keep_intermediates: Retain @work intermediates even on success. variant: Optional declared variant id to render a single variant. all_variants: Render every declared variant and return a batch summary. save_receipt_dir: With all_variants, directory for per-variant receipts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variant | No | ||
| spec_path | Yes | ||
| all_variants | No | ||
| save_receipt | No | ||
| resume_receipt | No | ||
| save_receipt_dir | No | ||
| keep_intermediates | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||