Skip to main content
Execute workflows as non-blocking background tasks by passing background=True to Workflow.arun(). The workflow continues running even if the client disconnects. Combine with stream=True for resumable SSE streaming with automatic event buffering and reconnection. See Background Execution for the full guide covering polling, resumable streaming, and the /resume endpoint.
Background execution requires async workflows using .arun(). Poll for results using workflow.get_run(run_id) and check completion status with .has_completed().

Example

You can also use WebSocket for background workflows. See the Workflow Websocket examples.

Developer Resources