Run your team withDocumentation Index
Fetch the complete documentation index at: https://docs.agno.com/llms.txt
Use this file to discover all available pages before exploring further.
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)
run_context and session_state. Async factories require arun() or aprint_response().
| Mode | Execution style |
|---|---|
coordinate | Leader decomposes work, delegates to members, synthesizes results |
route | Leader routes to one member and returns the member response |
broadcast | Leader delegates the same task to all members, then synthesizes |
tasks | Leader runs a task list loop until the goal is complete |
TeamMode.tasks, the leader uses task management tools to build and execute a shared task list, looping until the goal is complete or max_iterations is reached.
Teams can pause for human-in-the-loop requirements (e.g., approvals or user input). When a run requires confirmation, the run returns with pending requirements so you can collect input or resolve approvals before continuing.
Paused runs return status=RunStatus.paused and requirements on the TeamRunOutput.
Human oversight is a control path. Runs can pause for confirmation or external execution and resume when requirements are resolved.
Execution Flow Diagram
Execution Flow Diagram

Streaming
Enable streaming withstream=True. This returns an iterator of events instead of a single response.
Streaming is not supported in
TeamMode.tasks. If you set stream=True, the run falls back to non-streaming execution.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.
Tasks Mode
Tasks mode runs an iterative loop that creates, executes, and updates tasks until the goal is complete.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 |
