Sequential & Parallel Agent Pipelines in Google ADK
Master multi-agent orchestration primitives in Google ADK using SequentialAgent for ordered pipelines and ParallelAgent for concurrent execution.
Published on • July 30, 2026
AI Assistant

Relying on a single monolithic AI agent for complex workflows frequently causes context degradation, tool choice confusion, and prompt bloat. As user requests expand in scope, a single agent’s system instruction becomes overly complex and unreliable.
The Google Agent Development Kit (ADK) solves this by providing first-class multi-agent orchestration primitives. By breaking complex tasks down into specialized sub-agents, you can compose them using two fundamental orchestration patterns: Sequential Pipelines and Parallel Fan-Out / Fan-In Pipelines.
Sequential Pipelines: Assembly Line Orchestration
A sequential pipeline operates like an automated factory assembly line. Agent A receives the original user input, performs its task, and passes its output as context to Agent B, which processes the data and feeds Agent C.
Primary Use Cases for Sequential Processing
- Separation of Concerns: A researcher agent exclusively uses search tools, while a writer agent focuses solely on output tone and formatting.
- Deterministic Task Dependency: Ensures Step N+1 never executes before Step N successfully finishes.
- Context Hygiene: Prevents raw intermediate search results or raw tool output from cluttering the final output context window.
Recipe: Research-and-Write Pipeline
Here is a complete implementation of a two-stage research and writing pipeline built with SequentialAgent:
import asyncio
from google.adk.agents import Agent, SequentialAgent
from google.adk.tools import FunctionTool
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
# Define a knowledge base lookup tool
def search_knowledge_base(query: str) -> dict:
"""Searches corporate knowledge base for technical topic research.
Args:
query: The search keywords or query topic.
"""
mock_db = {
"adk": "Google ADK is an open-source Python framework for building multi-agent systems.",
"vertex": "Vertex AI Agent Engine provides enterprise hosting for ADK agents."
}
for key, text in mock_db.items():
if key in query.lower():
return {"found": True, "snippet": text}
return {"found": False, "snippet": "No direct matches found."}
search_tool = FunctionTool(func=search_knowledge_base)
# Stage 1: Researcher Agent with search tool access
researcher = Agent(
name="researcher_agent",
model="gemini-2.5-flash",
instruction="Search the knowledge base for user queries. Output clear, factual notes.",
tools=[search_tool]
)
# Stage 2: Writer Agent with formatting instructions
writer = Agent(
name="writer_agent",
model="gemini-2.5-flash",
instruction="Take the research notes provided and compose a concise 2-paragraph executive briefing."
)
# Combine stages into a SequentialAgent pipeline
sequential_pipeline = SequentialAgent(
name="research_write_pipeline",
agents=[researcher, writer]
)
async def main():
session_service = InMemorySessionService()
runner = Runner(agent=sequential_pipeline, session_service=session_service)
response = await runner.run_async(
session_id="seq-demo-01",
message="Explain Google ADK and Vertex AI integration."
)
print("--- Final Pipeline Output ---\n", response.text)
if __name__ == "__main__":
asyncio.run(main())
Parallel Fan-Out / Fan-In: Concurrent Multi-Axis Analysis
When sub-tasks are independent of one another, running them sequentially adds unnecessary latency. ParallelAgent executes multiple specialized agents concurrently (fan-out) and collects their outputs for downstream processing (fan-in).
Primary Use Cases for Parallel Processing
- Latency Reduction: Total execution time equals the duration of the slowest single sub-agent, rather than the sum of all sub-agents.
- Multi-Perspective Evaluation: Multiple specialized domain experts evaluate the exact same artifact simultaneously without biasing each other.
Code Pattern: Declaring a Parallel Auditor Group
from google.adk.agents import Agent, ParallelAgent
# Declare independent auditor agents
security_agent = Agent(name="security_auditor", model="gemini-2.5-flash", ...)
performance_agent = Agent(name="performance_auditor", model="gemini-2.5-flash", ...)
style_agent = Agent(name="style_auditor", model="gemini-2.5-flash", ...)
# Execute all three auditors simultaneously
parallel_auditors = ParallelAgent(
name="parallel_audit_team",
agents=[security_agent, performance_agent, style_agent]
)
Choosing the Right Orchestration Pattern
| Metric / Aspect | SequentialAgent | ParallelAgent |
|---|---|---|
| Execution Flow | Strictly linear ($A \rightarrow B \rightarrow C$) | Simultaneous fan-out ($A, B, C \parallel$) |
| Ideal For | Task pipelines with data dependencies | Independent analyses, audits, or queries |
| Latency Profile | Cumulative sum of step durations | Duration bounded by the slowest agent |
| Result Aggregation | Handled natively as output flows forward | Typically paired with a synthesizer agent |
Hybrid Pipelines: Combining Sequential and Parallel
Real-world production architectures frequently blend both patterns. A popular architecture is running a parallel evaluation stage followed sequentially by a lead synthesizer agent:
from google.adk.agents import Agent, ParallelAgent, SequentialAgent
# 1. Concurrent multi-perspective audit
parallel_audits = ParallelAgent(
name="parallel_audits",
agents=[security_agent, performance_agent, compliance_agent]
)
# 2. Lead reviewer synthesizes parallel audit results into final report
synthesizer = Agent(
name="lead_reviewer",
model="gemini-2.5-flash",
instruction="Synthesize audit results from all sub-agents into a unified executive report."
)
# Hybrid Pipeline: Parallel execution followed by Sequential synthesis
full_harness = SequentialAgent(
name="full_audit_harness",
agents=[parallel_audits, synthesizer]
)
Key Takeaway
Rather than attempting to build one monolithic agent with dozens of tools, decompose your system into modular sub-agents. Utilize SequentialAgent when steps depend on previous outputs and ParallelAgent when independent evaluations can run concurrently for maximum speed and isolation.