Handling async tasks
End-to-end video workflows and standalone media generation (images, video, audio) take anywhere from a few seconds to several minutes. Rather than holding a connection open for that entire time, the VideoGen API returns a response instantly with a run or execution id. You then choose how to receive the result: poll for it, or let us push it to you via a webhook.
Workflow runs
Every POST /v1/workflows/* endpoint returns 202 Accepted with { workflowRunId, projectId, projectUrl }. The run progresses through these statuses:
succeeded, failed, and cancelled are terminal statuses. The run won’t change after reaching one of these. Poll GET /v1/workflows/runs/{workflowRunId} until terminal, or subscribe to workflow_run.* webhooks.
See Workflows for available pipelines and SDK helpers (pollWorkflowRun / poll_workflow_run).
Cancel an in-progress workflow run:
Tool executions
Standalone media tools work the same way. Every POST /v1/tools/... endpoint returns 202 Accepted with a toolExecutionId and the same set of statuses (pending, running, succeeded, failed, cancelled).
Cancel an in-progress tool execution:
Getting the result
There are two ways to know when async work finishes: