Building Blocks
Workflowmanages the run and executes its configured steps.Stepwraps exactly one executor: anAgent, aTeam, a custom Python function, or a nestedWorkflow.Stepsgroups steps into a named sequential unit.Looprepeats one or more steps until an end condition succeeds or the iteration cap is reached.Parallelruns independent steps concurrently and aggregates their outputs.Conditionruns its steps when a boolean evaluator passes and an optional else branch when it fails.Routerpicks 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.
Your First Workflow
You can mix agents, teams, and functions as steps in the same workflow:mixed_workflow.py
Install
Set OpenAI Key
Set yourOPENAI_API_KEY as an environment variable. You can get one from OpenAI.
