Multi-Step Agent Template
Chain multiple AI agents together for complex tasks that require different types of reasoning, processing, or expertise. Each agent specializes in one part of the task.
Time to build: 20 minutes Difficulty: Intermediate Perfect for: Complex analysis, multi-stage processing, specialized workflows, quality assurance
What It Does
Input → Agent 1 (Research) → Agent 2 (Analysis) → Agent 3 (Writing) → Output
Each agent focuses on its specialty, creating higher quality results than a single agent.
Step-by-Step
1. Create Workflow
- New workflow → Name it "Research & Report Generator"
- Default Start Block ready
2. Add Research Agent
- Drag Agent Block
- Connect Start to Agent
Model: Claude 3.7 Sonnet (best for research)
System Prompt:
"You are a research specialist. Find comprehensive information on the given topic. Focus on facts, data, and credible sources."
User Prompt: <start.input>
Tools: [Tavily Search, Wikipedia, Perplexity]
3. Add Analysis Agent
- Drag another Agent Block
- Connect Research Agent to Analysis Agent
Model: GPT-4o (good reasoning)
System Prompt:
"You are a data analyst. Review the research findings and identify key insights, patterns, and trends. Be analytical and objective."
User Prompt:
"Analyze this research: <agent_research.content>"
4. Add Writing Agent
- Drag third Agent Block
- Connect Analysis Agent to Writing Agent
Model: Claude 3.7 Sonnet (best writing)
System Prompt:
"You are a professional writer. Create a clear, engaging report that communicates the insights effectively. Use proper structure with headings and bullet points."
User Prompt:
"Write a report based on:
Research: <agent_research.content>
Analysis: <agent_analysis.content>
Make it professional and actionable."
5. Add Quality Check (Optional)
- Drag Evaluator Block
- Connect Writing Agent to Evaluator
Criteria:
- Clarity: Is it easy to understand?
- Completeness: Are all key points covered?
- Accuracy: Is information correct?
- Actionability: Are recommendations practical?
Min Score: 8/10
6. Add Response
- Drag Response Block
- Connect Evaluator to Response
Content: <agent_writing.content>
Metadata:
{
"research_tokens": <agent_research.usage.total_tokens>,
"analysis_tokens": <agent_analysis.usage.total_tokens>,
"writing_tokens": <agent_writing.usage.total_tokens>,
"quality_score": <evaluator.score>
}
7. Test
- Input: "Analyze the impact of AI on healthcare in 2025"
- Watch each agent process sequentially
- Review final report quality
Agent Specialization Patterns
Research → Analysis → Action
- Research Agent: Gather information
- Analysis Agent: Identify patterns
- Action Agent: Create recommendations
Create → Review → Improve
- Creator Agent: Generate initial content
- Reviewer Agent: Find issues and gaps
- Improver Agent: Refine based on feedback
Extract → Transform → Load
- Extractor Agent: Pull data from sources
- Transformer Agent: Clean and structure data
- Loader Agent: Format for destination system
Real-World Examples
Legal Document Review
- Extraction Agent: Pull key clauses
- Analysis Agent: Identify risks
- Summary Agent: Create executive summary
Code Review Pipeline
- Code Agent: Analyze code quality
- Security Agent: Check vulnerabilities
- Documentation Agent: Generate docs
Customer Support Escalation
- Triage Agent: Classify issue
- Resolution Agent: Solve if possible
- Escalation Agent: Create handoff for humans
Enhancements
Add Parallel Processing
- Use Parallel Block to run research on multiple sources simultaneously
- Combine results before analysis
Add Memory Between Agents
- Use Memory tool to maintain context
- Let agents reference previous conversations
Add Human Review
- Insert approval step between agents
- Use Workflow block to pause for review
Add Dynamic Routing
- Use Condition to skip agents based on complexity
- Simple tasks bypass deep analysis
Cost
Per execution (3 agents):
- All Claude 3.7 Sonnet: ~$0.15-0.30
- Mixed (Claude + GPT-4o): ~$0.10-0.20
- All GPT-4o-mini: ~$0.01-0.03
Cost optimization:
- Use cheaper models for simple steps
- Use Claude for first/last (research/writing)
- Use GPT-4o-mini for middle steps (analysis)
Next Step
Try Parallel Processing to run multiple agents simultaneously for faster results!