Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Conditionals, loops, and parallel execution
from agno.workflow import Workflow, Condition
workflow = Workflow(
steps=[
Step(agent=classifier, name="classify"),
Condition(
if_condition="output.category == 'urgent'",
then_steps=[Step(agent=urgent_handler)],
else_steps=[Step(agent=normal_handler)]
)
]
)
from agno.workflow import Parallel
workflow = Workflow(
steps=[
Parallel([
Step(agent=agent1),
Step(agent2),
Step(agent3)
])
]
)
from agno.workflow import Loop
workflow = Workflow(
steps=[
Loop(
steps=[Step(agent=processor)],
max_iterations=5
)
]
)