How to design a multi-agent orchestration system using Google ADK's workflow agents (Sequential, Parallel, Loop)?
#google-adk#orchestration#workflow#sequential#parallel#loop#design
Answer
Multi-Agent Orchestration with Workflow Agents

Google ADK's workflow agents provide deterministic orchestration patterns for building complex multi-agent systems without relying on LLM-driven routing.
Workflow Patterns
| Pattern | Agent | Flow Control | Use Case |
|---|---|---|---|
| Pipeline | SequentialAgent | A -> B -> C | ETL, RAG ingestion |
| Fan-out | ParallelAgent | A, B, C (concurrent) | Multi-source search |
| Iteration | LoopAgent | [A -> B] x N | Draft refinement |
| Hybrid | Nested agents | Mixed | Complex workflows |
Pattern 1: Pipeline (Sequential)
pythonfrom google.adk.agents import Agent, SequentialAgent collector = Agent( name="collector", model="gemini-2.5-flash", instruction="Collect relevant data about the topic.", output_key="raw_data", ) analyzer = Agent( name="analyzer", model="gemini-2.5-pro", instruction="Analyze this data: {raw_data}", output_key="analysis", ) summarizer = Agent( name="summarizer", model="gemini-2.5-flash", instruction="Create a concise summary from: {analysis}", output_key="summary", ) pipeline = SequentialAgent( name="research_pipeline", sub_agents=[collector, analyzer, summarizer], )
Pattern 2: Fan-out (Parallel)
pythonfrom google.adk.agents import Agent, ParallelAgent, SequentialAgent web_searcher = Agent( name="web_searcher", model="gemini-2.5-flash", instruction="Search the web for information.", tools=[google_search], output_key="web_results", ) academic_searcher = Agent( name="academic_searcher", model="gemini-2.5-flash", instruction="Search academic papers.", tools=[search_arxiv], output_key="academic_results", ) kb_searcher = Agent( name="kb_searcher", model="gemini-2.5-flash", instruction="Search the internal knowledge base.", tools=[search_documents], output_key="kb_results", ) # Fan-out: search all sources simultaneously fan_out = ParallelAgent( name="multi_search", sub_agents=[web_searcher, academic_searcher, kb_searcher], ) # Then merge results merger = Agent( name="merger", model="gemini-2.5-pro", instruction="""Merge and deduplicate results from: Web: {web_results} Academic: {academic_results} Knowledge Base: {kb_results}""", output_key="merged_results", ) search_pipeline = SequentialAgent( name="comprehensive_search", sub_agents=[fan_out, merger], )
Pattern 3: Iterative Refinement (Loop)
pythonfrom google.adk.agents import Agent, LoopAgent writer = Agent( name="writer", model="gemini-2.5-flash", instruction="""Write or improve content based on feedback. Previous feedback: {review_feedback} Write a high-quality draft.""", output_key="draft", ) reviewer = Agent( name="reviewer", model="gemini-2.5-pro", instruction="""Review this draft: {draft} If quality is sufficient, respond with 'APPROVED' and set escalate=True. Otherwise, provide specific feedback for improvement.""", output_key="review_feedback", ) refinement_loop = LoopAgent( name="draft_refiner", max_iterations=5, sub_agents=[writer, reviewer], )
Pattern 4: Hybrid (Complex Orchestration)
python# Combine all patterns full_pipeline = SequentialAgent( name="content_pipeline", sub_agents=[ # Step 1: Gather from multiple sources ParallelAgent( name="gather", sub_agents=[search_agent, data_agent], ), # Step 2: Iteratively write and refine LoopAgent( name="refine", max_iterations=3, sub_agents=[writer, reviewer], ), # Step 3: Publish publisher_agent, ], )
Design Guidelines
| Guideline | Reason |
|---|---|
| Use text | Enables data flow between agents |
| Use text | Dynamic context from state |
| Keep agents focused (SRP) | One agent = one responsibility |
| Use ParallelAgent for independent tasks | Reduces latency |
| Set text | Prevent infinite loops |
| Use distinct state keys in ParallelAgent | Avoid race conditions |
Learn more at Workflow Agents and Multi-Agents.