0
Phase 8

ADK Workflows & Sub-Agents

~2 min read

Concept & How It Works

    Why Does It Exist?

    Monolithic agents hallucinate on long tasks. Workflows decompose work into focused sub-agents with clear inputs/outputs, improving reliability and testability.

    Real-World Analogy

    ADK Workflows are a film production crew: director (orchestrator) assigns scenes to specialists (sub-agents) who work in sequence or parallel.
    Loading diagram...

    Visual Workflows

    What is ADK Workflows & Sub-Agents?

    Loading diagram...

    Example

    Scenario

    Research workflow: ParallelAgent runs `web_search_agent` and `internal_kb_agent` → SequentialAgent passes merged context to `synthesis_agent` → `citation_checker_agent`.

    Solution

    In Agent Frameworks, apply ADK Workflows & Sub-Agents to this scenario: Research workflow: ParallelAgent runs `web_search_agent` and `internal_kb_agent` → SequentialAgent passes merged context to `synthesis_agent` → `citation_checker_agent`. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

    Practice Task

    Do this before moving to the next module — reading alone is not enough.

    Open the Code Walkthrough below and run it locally. Change one parameter related to ADK Workflows & Sub-Agents (e.g. model, temperature, top_k, or tool name), observe the difference in output, and write 2–3 sentences explaining what changed.

    Code Walkthrough

    Highlighted lines show where ADK Workflows & Sub-Agents happens in the code.

    ADK Workflows & Sub-Agents
    1from google.adk.agents import SequentialAgent, ParallelAgent, LlmAgent  # import dependencies2
    3research = ParallelAgent(agents=[web_agent, kb_agent], name="gather")4pipeline = SequentialAgent(agents=[research, synthesis_agent], name="research_flow")

    Commands to Remember

    Commands to Remember

    • pip install langgraph langchain-openai # LangGraph agent framework
    • pip install openai-agents # OpenAI Agents SDK
    • pip install crewai # multi-agent CrewAI framework

    Common Mistakes

    • Treating ADK Workflows & Sub-Agents as a black box without evaluation
    • Ignoring cost and latency in production
    • Skipping error handling for google adk workflows

    Cheat Sheet

    Quick recap — the most important points from this module.

    Cheat Sheet

    quick ref
    • ADK Workflows & Sub-Agents
    • SequentialAgent
    • ParallelAgent
    • Sub-Agent