Skip to main content
Pick a workflow pattern and connect agents so they share context across steps.
from praisonaiagents import Agent, AgentFlow

researcher = Agent(name="Researcher", instructions="Research topics.")
writer = Agent(name="Writer", instructions="Write clear summaries.")
flow = AgentFlow(steps=[researcher, writer])
flow.start("Explain workflow patterns in one paragraph.")
The user chooses a pattern, configures agents, and submits a task that flows through the team.

Quick Start

1

Simple Usage

Chain two agents so the second builds on the first.
from praisonaiagents import Agent, AgentFlow

researcher = Agent(name="Researcher", instructions="Research topics.")
writer = Agent(name="Writer", instructions="Write clear summaries.")
flow = AgentFlow(steps=[researcher, writer])
flow.start("Explain workflow patterns in one paragraph.")
2

With Configuration

Run independent agents together with the top-level parallel primitive.
from praisonaiagents import Agent, AgentFlow, parallel

ai = Agent(name="AI", instructions="Research AI trends")
ml = Agent(name="ML", instructions="Research ML trends")
summary = Agent(name="Summary", instructions="Combine research")
flow = AgentFlow(steps=[parallel([ai, ml]), summary])
flow.start("Research latest developments")

How It Works


Workflows

Workflows define how multiple agents work together to complete a task. Just like a team of people in an office, agents can collaborate in different ways depending on the task.

What is a Workflow?

Think of a workflow as a recipe that tells your agents:
  • Who does what
  • In what order
  • How they share information

The Four Main Patterns

🔀 Routing

“Send to the right expert”Like a receptionist directing calls to the right department.

⚡ Parallel

“Everyone works at once”Like a team researching different topics simultaneously.

➡️ Sequential

“One step at a time”Like passing a document from person to person for review.

👔 Orchestrator

“Manager delegates work”Like a project manager assigning tasks to team members.

Which Pattern Should I Use?

I want to…Use this pattern
Send requests to different specialistsRouting
Do multiple independent things at onceParallel
Process step-by-step (A → B → C)Sequential
Let an AI decide how to break down workOrchestrator

Real-World Examples

Example 1: Customer Support Bot

A customer asks: “Why is my order delayed?”
PatternHow it works
RoutingClassify the question → Send to Shipping Agent
SequentialLookup Order → Check Status → Write Response

Example 2: Research Report

You ask: “Create a report on AI trends”
PatternHow it works
ParallelResearch AI + Research ML + Research NLP (all at once)
SequentialResearch → Analyze → Write → Edit (step by step)
OrchestratorManager assigns: “You research, you analyze, you write”

Two Ways to Build Workflows

PraisonAI offers two approaches:
ApproachClassBest for
Deterministic PipelinesAgentFlowYou define exactly what happens
Dynamic DelegationAgentTeam + hierarchicalAI manager decides
Start simple: Use Sequential for your first workflow, then explore other patterns as needed.

Best Practices

Independent subtasks fit parallel; ordered steps fit sequential; expert routing fits routing. Choosing the shape first keeps flows simple.
AgentFlow(steps=[...]) runs exactly the steps you list. Reach for AgentTeam + hierarchical only when you want an AI manager to decide.
from praisonaiagents import parallel (and when, loop) uses the friendly re-exports, so samples stay short and portable.

Next Steps

Sequential Workflow

Start with the simplest pattern

Full Reference

Technical API documentation