What are Workflows?

Workflows orchestrate agents, teams, and functions through defined steps for repeatable tasks.

A Workflow orchestrates agents, teams, and functions through a defined control flow. Steps can run sequentially, in parallel, in loops, or conditionally based on results. Function steps can access all prior outputs through StepInput. Agent, team, and nested-workflow steps receive the most recent output as their input.

Workflows flow diagram

Your First Workflow

This workflow takes a topic, collects relevant HackerNews stories, and writes an article:

from agno.agent import Agent
from agno.workflow import Workflow
from agno.tools.hackernews import HackerNewsTools

researcher = Agent(
    name="Researcher",
    instructions="Find relevant information about the topic",
    tools=[HackerNewsTools()]
)

writer = Agent(
    name="Writer",
    instructions="Write a clear, engaging article based on the research"
)

content_workflow = Workflow(
    name="Content Creation",
    steps=[researcher, writer]
)

content_workflow.print_response("Write an article about AI trends", stream=True)

The agents use Agno's default OpenAI model. Install the dependencies and export your API key before running the example:

Install dependencies

uv pip install -U agno openai

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"

When to Use Workflows

RequirementUse
Fixed ordering, branches, loops, or parallel groupsWorkflow
Dynamic delegation among model-driven membersTeam

Workflow control flow is repeatable. Agent and team outputs can still vary between runs. Configure a database when you need persisted run records.

Step Executors

A Step wraps exactly one executor:

ExecutorDescription
AgentIndividual AI executor with specific tools and instructions
TeamCoordinated group of agents for complex sub-tasks
FunctionCustom Python function for specialized logic
WorkflowNested workflow for composable, reusable sub-pipelines

The workflow's steps list also accepts Steps, Parallel, Loop, Condition, and Router containers. Agents, teams, functions, and nested workflows are auto-wrapped when passed directly.

Controlling Workflows

Workflows support conditional logic, parallel execution, loops, and conversational interactions. See Workflow patterns and the guides below.

Guides

Developer Resources