Runs
A run is a single execution of a teammate. Runs stream events in real-time (tool calls, reasoning, output) and persist results.
Create a Run
Streaming (default)
The simplest way to get real-time output:
Use the context manager for automatic cleanup:
Non-Streaming
For simpler use cases, disable streaming and poll for the result:
Quick Start Mode
Omit teammate_id to auto-create a teammate:
This finds or creates a teammate named "Weekly Bot" and runs it immediately.
Run Options
Note:
permission_modevalues other than"autonomous"requirehuman_in_the_loop=true.
Follow-Up Messages
Continue a conversation with runs.reply(). This creates a new run that inherits the teammate and context from the original:
Convenience Helpers
Shortcuts for common patterns:
Answering Questions
When a teammate asks a clarifying question (via AskUserQuestion), the run pauses. Submit answers with runs.answer():
Questions are only asked when human_in_the_loop=True. By default, runs are fully autonomous. See the Human-in-the-Loop guide for the complete interactive workflow.
List Runs
Get a Run
Cancel a Run
Run Files
Agents can generate files during execution. List and download them after the run completes:
Run Statuses
What's Next
- Streaming & Events — event types and real-time patterns
- Human-in-the-Loop — interactive features guide
- Permissions — control tool approval flow
- Files — working with teammate-generated files
