Team.run() (sync) or Team.arun() (async).
Basic Execution
Execution Flow
When you callrun():
- Pre-hooks execute (if configured)
- Reasoning runs (if enabled) to plan the task
- Context is built with system message, history, memories, and session state
- Model decides whether to respond directly, use tools, or delegate to members
- Members execute their tasks (concurrently in async mode)
- Leader synthesizes member results into a final response
- Post-hooks execute (if configured)
- Session and metrics are stored (if database configured)
Execution Flow Diagram
Execution Flow Diagram

Streaming
Enable streaming withstream=True. This returns an iterator of events instead of a single response.
Stream All Events
By default, only content is streamed. Setstream_events=True to get tool calls, reasoning steps, and other internal events:
Stream Member Events
When usingarun() with multiple members, they execute concurrently. Member events arrive as they happen, not in order.
Disable member event streaming with stream_member_events=False:
Run Output
Team.run() returns a TeamRunOutput object containing:
| Field | Description |
|---|---|
content | The final response text |
messages | All messages sent to the model |
metrics | Token usage, execution time, etc. |
member_responses | Responses from delegated members |
Async Execution
Usearun() for async execution. Members run concurrently when the leader delegates to multiple members at once.
Specifying User and Session
Associate runs with a user and session for history tracking:Passing Files
Pass images, audio, video, or files to the team:Structured Output
Pass an output schema to get structured responses:Cancelling Runs
Cancel a running team withTeam.cancel_run(). See Run Cancellation.
Print Response
For development, useprint_response() to display formatted output:
Event Types Reference
Event Types Reference
Core Events
| Event | Description |
|---|---|
TeamRunStarted | Run started |
TeamRunContent | Response text chunk |
TeamRunContentCompleted | Content streaming complete |
TeamRunCompleted | Run completed successfully |
TeamRunError | Error occurred |
TeamRunCancelled | Run was cancelled |
Tool Events
| Event | Description |
|---|---|
TeamToolCallStarted | Tool call started |
TeamToolCallCompleted | Tool call completed |
Reasoning Events
| Event | Description |
|---|---|
TeamReasoningStarted | Reasoning started |
TeamReasoningStep | Single reasoning step |
TeamReasoningCompleted | Reasoning completed |
Memory Events
| Event | Description |
|---|---|
TeamMemoryUpdateStarted | Memory update started |
TeamMemoryUpdateCompleted | Memory update completed |
Hook Events
| Event | Description |
|---|---|
TeamPreHookStarted | Pre-hook started |
TeamPreHookCompleted | Pre-hook completed |
TeamPostHookStarted | Post-hook started |
TeamPostHookCompleted | Post-hook completed |
