Quick Start: 3-Agent Sequential Workflow

Build your first orchestrated workflow in 15 minutes - a research paper summarization pipeline

Goal

Build a research paper summarization pipeline with three specialized agents working in sequence:

SearcherDownloaderSummarizer

The orchestrator coordinates these agents, passing results from one to the next, and aggregates the final output.

Architecture Overview

The workflow demonstrates core orchestration patterns:

  • Task Queue: Orchestrator maintains ordered list of tasks
  • Sequential Dispatch: Each agent completes before next starts
  • Message Passing: Agents communicate via structured messages
  • Result Aggregation: Orchestrator collects and combines outputs

What You'll Learn:

  • Create an orchestrator with task dispatch
  • Implement agent message handlers
  • Connect agents via sequential message passing
  • Aggregate results from multiple agents

Implementation Steps

Create Orchestrator Class

The orchestrator manages the task queue and coordinates agent execution:

class Orchestrator:
    def __init__(self):
        self.tasks = []

Create file orchestrator.py with the orchestrator skeleton.

Implement Dispatch Method

Add sequential task dispatch logic:

def dispatch(self, task):
    self.tasks.append(task)
    return self.execute_sequential()

The dispatch method queues tasks and triggers sequential execution.

Create Agent Classes

Define three specialized agents with message handlers:

class SearcherAgent:
    def handle(self, message):
        return {"papers": ["paper1.pdf", "paper2.pdf"]}

Create agents.py with SearcherAgent, DownloaderAgent, and SummarizerAgent classes. Each agent receives a message and returns results.

Connect Agents via Message Passing

Wire agents together in orchestrator:

searcher_result = searcher.handle({"query": "AI orchestration"})
downloader_result = downloader.handle(searcher_result)
summary = summarizer.handle(downloader_result)

Each agent's output becomes the next agent's input.

Run Workflow and Verify

Execute the complete pipeline:

python orchestrator.py

Expected output:

Searcher: Found 2 papers
Downloader: Downloaded 2 papers
Summarizer: Generated 2 summaries

Verification

Test the workflow with a research query:

python orchestrator.py --query "multi-agent systems"

The orchestrator should display:

  1. Search phase: List of discovered papers
  2. Download phase: Confirmation of paper retrieval
  3. Summary phase: Generated summaries for each paper

✅ Success Criteria:

  • All three agents execute in sequence
  • Each agent receives output from previous agent
  • Orchestrator aggregates final results
  • No errors in message passing

What You Built

You just built your first orchestrated workflow!

This simple pipeline demonstrates:

  • Sequential orchestration: Agents execute in defined order
  • Message-based communication: Structured data passing between agents
  • Result aggregation: Orchestrator combines outputs
  • Extensible pattern: Easy to add more agents or modify workflow

Next Steps

Troubleshooting