How streaming works
SSE event types
Task lifecycle events
Output events
Platform events
These events provide additional observability but are implementation details — do not depend on their presence or ordering in your application logic. They may change without notice.Terminal events (
task.complete, task.failed, task.cancelled) signal end-of-stream. Stop reading after receiving one.Stream a task
Resuming a stream
The stream is resumable. If a connection drops, reconnect and pass the last received event ID to resume without replaying already-delivered events.Replay a task
Replay re-runs a task from its recorded execution trace.- Python
Errors
A dropped stream connection is not an error — reconnect and resume from the last event ID you received.
Production recommendations
- Treat
task.complete,task.failed, andtask.cancelledas terminal: stop reading once one arrives. - Render
runtime.deltaevents incrementally rather than buffering the whole stream. - Persist the last received event ID so you can resume cleanly after a disconnect.
- Use replay to reproduce a failed run before changing the agent or input.
Rate limits
100 requests per organization per minute.Handling runtime.delta
Handling runtime.delta
runtime.delta events carry incremental text chunks. Concatenate and render them progressively for a responsive UI. Do not wait for the full result before displaying output.Distinguishing terminal events
Distinguishing terminal events
A stream always ends with exactly one of
task.complete, task.failed, or task.cancelled. Use this to determine the final outcome and clean up resources.Related pages
Tasks
Submit and manage tasks.
Approvals
Handle plan review events.
Observability
Logs and metrics beyond a single task.
Tasks & Workflows
The lifecycle behind the events.

