Sequential Workflow
Chain agents one after another like an assembly line
Pass work from one agent to the next when each step depends on the previous output.
from praisonaiagents import Agent, AgentFlow
researcher = Agent(name="Researcher", instructions="Research topics")
analyst = Agent(name="Analyst", instructions="Analyze research findings")
writer = Agent(name="Writer", instructions="Write based on analysis")
flow = AgentFlow(steps=[researcher, analyst, writer])
flow.start("AI trends in 2024")The user chains agents in order; each step receives the prior output until the final result is ready.
Sequential Workflow
Pass work from one agent to the next, like an assembly line.
How Context Flows
Each agent receives the previous output automatically.
When to Use
Code
from praisonaiagents import Agent, AgentFlow
researcher = Agent(name="Researcher", instructions="Research topics")
analyst = Agent(name="Analyst", instructions="Analyze research findings")
writer = Agent(name="Writer", instructions="Write based on analysis")
# Sequential: researcher → analyst → writer
flow = AgentFlow(steps=[researcher, analyst, writer])
result = flow.start("AI trends in 2024")Example: Blog Post Pipeline
| Step | Agent | Receives | Outputs |
|---|---|---|---|
| 1 | Researcher | Topic | Facts, data |
| 2 | Analyst | Facts | Key insights |
| 3 | Writer | Insights | Draft article |
| 4 | Editor | Draft | Polished post |
With Callbacks
from praisonaiagents import AgentFlow, WorkflowHooksConfig
flow = AgentFlow(
steps=[researcher, analyst, writer],
hooks=WorkflowHooksConfig(
on_step_complete=lambda name, r: print(f"✅ {name} done")
)
)