When to use a Workflow vs a Team
Use a Workflow for code-defined execution and a Team for model-directed coordination.
Workflows execute decisions defined in code. Teams use a model to coordinate member agents. Both support routing, parallel work, and loops. Choose based on who should control those decisions.
| Requirement | Use |
|---|---|
| Fixed sequence of steps with dependencies | Workflow |
| Code-defined parallel branches | Workflow |
| Rule-based conditions or routing | Workflow |
| Code-defined loops with end conditions | Workflow |
| Mixed components (agents, teams, functions) in one pipeline | Workflow |
| Defined, repeatable execution path | Workflow |
| Open-ended research and planning | Team |
| Model routes each request to a specialist | Team with mode=TeamMode.route |
| Model sends the same task to every member | Team with mode=TeamMode.broadcast |
| Model decomposes a goal and loops through a task list | Team with mode=TeamMode.tasks |
| Members divide responsibilities dynamically | Team |
Workflows can include teams as steps. Use a workflow for the code-defined pipeline and a team where a step needs model-directed coordination.