Explore the different types of workflows in the Agno workflow system, including sequential, parallel, conditional, and looping workflows.
Component | Purpose |
---|---|
Step | Basic execution unit |
Agent | AI assistant with specific role |
Team | Coordinated group of agents |
Function | Custom Python logic |
Parallel | Concurrent execution |
Condition | Conditional execution |
Loop | Iterative execution |
Router | Dynamic routing |
StepInput
and StepOutput
provides standardized interfaces for data flow between steps:
So if you make a custom function as an executor for a step, make sure that the input and output types are compatible with the StepInput
and StepOutput
interfaces.
This will ensure that your custom function can seamlessly integrate into the workflow system.Take a look at the schemas for StepInput
and StepOutput
.StepInput
object.
Parameter | Type | Default | Description |
---|---|---|---|
name | Optional[str] | None | Name of the step for identification |
description | Optional[str] | None | Description of the step's purpose |
executor | Optional[Callable] | None | Custom function to execute for this step |
agent | Optional[Agent] | None | Agent to execute for this step |
team | Optional[Team] | None | Team to execute for this step |
Parameter | Type | Default | Description |
---|---|---|---|
evaluator | Union[Callable[[StepInput], bool], bool] | Required | Function or boolean to evaluate the condition |
steps | WorkflowSteps | Required | Steps to execute if the condition is met |
name | Optional[str] | None | Name of the condition step |
description | Optional[str] | None | Description of the condition step |
Parameter | Type | Default | Description |
---|---|---|---|
steps | WorkflowSteps | Required | List of steps to execute in parallel |
name | Optional[str] | None | Name of the parallel execution block |
description | Optional[str] | None | Description of the parallel execution |
Parameter | Type | Default | Description |
---|---|---|---|
steps | WorkflowSteps | Required | Steps to execute in each loop iteration |
name | Optional[str] | None | Name of the loop step |
description | Optional[str] | None | Description of the loop step |
max_iterations | int | 3 | Maximum number of iterations for the loop |
end_condition | Optional[Callable[[List[StepOutput]], bool]] | None | Function to evaluate if the loop should end |
Parameter | Type | Default | Description |
---|---|---|---|
selector | Callable[[StepInput], Union[WorkflowSteps, List[WorkflowSteps]]] | Required | Function to select steps dynamically |
choices | WorkflowSteps | Required | Available steps for selection |
name | Optional[str] | None | Name of the router step |
description | Optional[str] | None | Description of the router step |
Parameter | Type | Default | Description |
---|---|---|---|
steps | WorkflowSteps | Required | List of steps to execute sequentially |
name | Optional[str] | None | Name of the steps step |
description | Optional[str] | None | Description of the steps step |
Steps
really shines - creating distinct sequences for different content types or workflows:
workflow_using_steps.py
workflow_using_steps_nested.py
selector_for_image_video_generation_pipelines.py