Skip to main content
Workflow.run() returns a WorkflowRunOutput, or an event iterator when streaming is enabled. The iterator contains workflow events and, by default, events forwarded by agent and team step executors. workflow.print_response() runs the workflow and formats its output in the terminal.

Running a Workflow

Call workflow.run() and capture the result in response:
Without streaming, Workflow.run() returns WorkflowRunOutput.

Async Execution

The Workflow.arun() function is the async version of Workflow.run().

Streaming Responses

Set stream=True to return an event iterator instead of a single response. With stream_executor_events=True, the default, the iterator can also contain agent and team events from step executors.

Streaming All Events

With stream_events=False, the default, the stream still includes the workflow start and completion events, step output events from function executors, and forwarded agent and team events. Set stream_events=True to include workflow lifecycle events for steps, conditions, loops, routers, and parallel groups.

Streaming Executor Events

Events from agents and teams inside a workflow are forwarded by default. Set stream_executor_events=False to filter their nonterminal events. Executor completion and cancellation events are still forwarded. Workflow-level events are not affected by this setting. With stream_events=True, events such as WorkflowStarted, StepStarted, ConditionExecutionStarted, and their completion events remain in the stream.

Async Streaming

Workflow.arun(stream=True) returns an async event iterator instead of a single response. It can include forwarded agent and team events under the same stream_executor_events setting.
See the Async Streaming example for more details.

Common Event Types

The following workflow events are commonly yielded by Workflow.run() and Workflow.arun() when streaming is configured. The event enum also includes pause, continuation, cancellation, review, workflow-agent, and custom events.

Core Events

Step Events

Step Output Events (For custom functions)

Parallel Execution Events

Condition Execution Events

Loop Execution Events

Router Execution Events

Steps Execution Events

See the WorkflowRunOutputEvent reference.

Storing Events

Set store_events=True to retain generated events on the workflow run. Use events_to_skip to exclude selected event types. Access retained events through workflow.get_last_run_output().events. When the workflow has a database, the events are persisted with the run.
  • store_events=True: Retain events on WorkflowRunOutput.events
  • events_to_skip=[...]: Exclude matching workflow, agent, or team event types
Available Events to Skip:
Use Cases
  • Debugging: Inspect workflow control flow
  • Performance analysis: Compare event timing and step metrics
  • Error investigation: Review events leading to a failure
  • Persisted run records: Store selected events when a database is configured
Configuration Examples

Agno Telemetry

Workflow telemetry includes the workflow ID, database type, whether an input schema is configured, the session and run IDs, the SDK version, and the workflow event type. Disable it with AGNO_TELEMETRY=false or telemetry=False.
Or set the option on the workflow:
See the Workflow class reference for more details.

Developer Resources