Sequential Execution
In sequential patterns, agents execute one after another in a fixed order. You define explicit edges to control the flow:Sequential patterns are ideal when you have a clear, linear workflow and want each agent to build on the previous agent’s output.
Core Concepts
Special Nodes
__start__: Entry point (first agent receives user input)__end__: Exit point (final agent’s output is returned to user)
__start__ and to __end__.
Passing Data Between Agents
Each agent in the sequence receives the previous agent’s output. You can access it in two ways: 1. Direct access (free-form text): The previous agent’s output is automatically available in the agent’s context. 2. Structured output (typed data): Define schemas for agent outputs and reference specific fields in subsequent agents.Learn more about structured output: Structured Output →
Basic Sequential Chain
Single Agent Flow
Sequential Chain with Structured Output
Using structured output for reliable data passing:The
responder agent accesses the analyzer’s structured output using template variables: {{ analyzer.output.sentiment }}, {{ analyzer.output.confidence }}, etc.Research → Analysis Pipeline
Multi-agent workflow where a ReAct agent uses tools to gather data with structured output, then an LLM agent analyzes the findings:The
researcher agent uses tavily_search to gather data and outputs structured findings. The analyst agent then references {{ researcher.output.key_findings }} and other fields to generate insights.When to Use Sequential Patterns
Use sequential patterns when:
- You have a clear, linear workflow
- Each step depends on the previous step’s output
- You want type-safe data passing between agents
- The execution order is predictable
For dynamic routing, see Supervisor Pattern → or Conditional Edges →
Best Practices
Advanced Patterns
For more complex routing logic:Conditional Edges
Add dynamic routing based on agent output
Supervisor Pattern
Use intelligent task delegation instead of fixed edges
Common Use Cases
Content Pipeline
Content Pipeline
Pattern: Sequential chainResearch → Draft → Edit → PublishEach agent specializes in one stage of content creation.
Data Processing Pipeline
Data Processing Pipeline
Pattern: Sequential chain with toolsCollector (web search) → Analyzer (calculator) → Reporter (synthesis)Each agent uses specific tools for its task.
Sentiment Analysis Pipeline
Sentiment Analysis Pipeline
Pattern: Sequential with structured outputAnalyzer (structured output) → Responder (uses analyzer data)First agent produces typed data, second agent consumes it via template variables.
Quality Assurance Flow
Quality Assurance Flow
Pattern: Sequential with conditional edgesWriter → Reviewer → [Approve → Publish | Reject → Writer]Add conditional edges for dynamic routing based on quality checks.