The synchronous endpoint is still the shortest path to a first result, so the
Workflows quickstart uses it.
Reach for the asynchronous endpoint as soon as a run has to survive a dropped
connection, a page reload, or a deploy of your own service.
Submit a run
POST /v1/workflow/execute/async takes the same body as the synchronous
endpoint — a template (inline or a stored template id), input, time_range,
and model_name — and returns 202 Accepted straight away.
execution_id is the handle for everything that follows: reading the
result, attaching to the event stream, cancelling, and resuming the run if it
stops early. Store it: nothing else identifies the run.
persistence_mode is not accepted here. Every submitted run is stored, because
the stored run is how you read its result once the request that started it has
returned. See Stored runs and retention below.Read the result
Retrieve the run withGET /v1/workflow/executions/{execution_id} and check its
status. A run is finished when its status is completed, error, or
cancelled; while it is pending or running, its events are null.
events list is the run’s streamed messages replayed in order, using the
same message types you get live. A handler written for the live stream replays a
stored run without changes. See
Streaming responses for the
full set, and Execution history
for the rest of the retrieval response.
Watch a run live
Polling is enough for most integrations. If you want to show progress as it happens — the research plan filling in, the answer arriving token by token — attach to the run’s event stream:GET /v1/workflow/execute/async/{execution_id}/stream
Resume a dropped stream
Every event on this stream carries an SSEid. If the connection drops,
reconnect to the same URL and send the last id you received in the standard
Last-Event-ID header. Delivery continues from that point instead of replaying
the run from the beginning.
EventSource client does this for you: it tracks the last id and
sends the header on reconnect automatically.
A run that had begun answering and then starts its answer again emits a
STREAM_ROLLBACK event telling you which events to discard. Handle it if you
render answer text as it arrives — see
STREAM_ROLLBACK.Cancel a run
POST /v1/workflow/execute/async/{execution_id}/cancel stops a running
workflow. The response reports the run’s status once the cancellation was
applied, so you do not need to poll afterwards.
completed or error instead of cancelled. A cancelled run
keeps whatever it had produced, and you can continue it later.
Continue a run that stopped early
A run that stopped before it finished — one you cancelled, or one that ended in anerror — can be continued from where it stopped. Pass its execution_id in
the submit body:
execution_id.
Stored runs and retention
Every submitted run is stored, so you decide how long to keep it. List your runs, retrieve any one of them, and delete the ones you no longer need:GET /v1/workflow/executions— your runs, newest firstGET /v1/workflow/executions/{execution_id}— one run with its full resultDELETE /v1/workflow/executions/{execution_id}— remove a run permanently
Error responses
Alongside the usual HTTP errors, the stream and cancel endpoints share one error contract:
On submit,
409 means something different: the execution_id you asked to
continue cannot be continued, because it is still in progress or has already
completed.
Next steps
Execution history
List, retrieve, and delete your stored runs.
Streaming responses
Every message type the stream can emit, and a handler that dispatches on
type.Creating templates
Template anatomy, input placeholders, content filters, and research plans.
Conversation continuity
How
execution_id compares with Research Agent chats and checkpoints.