Skip to main content
Workflows orchestrate your agents and teams as a series of steps executed in a flow that you control.

Building Blocks

  1. Workflow manages the run and executes its configured steps.
  2. Step wraps exactly one executor: an Agent, a Team, a custom Python function, or a nested Workflow.
  3. Steps groups steps into a named sequential unit.
  4. Loop repeats one or more steps until an end condition succeeds or the iteration cap is reached.
  5. Parallel runs independent steps concurrently and aggregates their outputs.
  6. Condition runs its steps when a boolean evaluator passes and an optional else branch when it fails.
  7. Router picks which step or steps run next from its choices.
When using a custom Python function as an executor for a step, StepInput and StepOutput provide standard interfaces for data flow between steps.
Workflows step IO flow diagram

Your First Workflow

You can mix agents, teams, and functions as steps in the same workflow:
mixed_workflow.py

Install

Set OpenAI Key

Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.

Next Steps