A customer asks for a refund. The old way: hand one autonomous agent a system prompt with five steps and hope the model follows them in order. The new way, in Google's Agent Development Kit 2.0: draw the five steps as a graph, let deterministic code decide what happens next, and spend the model's intelligence only on the two steps that are actually ambiguous — reading the complaint, and drafting the reply.
That is the whole idea of ADK 2.0, and it is the most important change in the framework since it launched on April 9, 2025. The Workflow Runtime, generally available for Python since May 19, 2026 (Go June 30, TypeScript August 21), moves ADK "from a hierarchical agent executor to a graph-based execution engine." Agents, tools, and plain functions become nodes in a workflow graph, and every edge is a deterministic transition. The model stops being the orchestrator and goes back to being the reasoning engine.
This is GDE post #18, the first post of the ADK lane. The vLLM lane taught us to measure serving; the ADK lane measures the agent layer that sits on top of it. Every number below is recomputed in the companion notebook.
The ELI5 version
Think of a hospital. In the 1.x world, one brilliant doctor does everything: triage, blood tests, surgery, billing — and decides what to do next by reading a long instruction sheet between each step. Brilliant, but every decision costs a consultation, and a tired doctor sometimes skips a step.
In the 2.0 world, the hospital has a flowchart on the wall. The flowchart says: blood test first, then surgery, then billing — no decision needed, just follow the arrows. The doctor is still there, but only for the two steps that need judgment: reading the symptoms, and explaining the diagnosis. Everything else is a nurse with a checklist.
The flowchart is the Workflow Runtime. The doctor is the LLM. The nurses are tools. ADK 2.0 is the hospital deciding that routing belongs on the wall, not in the doctor's head.
The refund, two ways
Google's own launch post for ADK 2.0 uses a customer refund as the example, because it is the perfect five-step process: fetch the purchase history, read the complaint against the policy, issue the refund, draft the confirmation email, close the ticket. Three of those steps are deterministic — a database query, a Stripe API call, a CRM update. Two are genuinely ambiguous — only a model can read a furious email and decide whether the policy covers it, and only a model can draft a reply that sounds human.
The autonomous-agent version hands all five steps to one agent loop:
from google.adk.agents import Agent
from my_tools import fetch_purchase_history, get_policy, send_email, issue_refund, close_ticket
refund_agent = Agent(
model="gemini-2.5-flash",
instruction="""Process refunds: 1) fetch purchase history, 2) read the
complaint against the policy, 3) issue the refund via Stripe, 4) draft a
confirmation email, 5) close the ticket. Do the steps in order.""",
tools=[fetch_purchase_history, get_policy, send_email, issue_refund, close_ticket],
)
It works — until it doesn't. Every step boundary is a model decision: which tool to call, whether the previous step actually finished, whether to retry or move on. A five-step flow with two model calls per step (one to route, one to execute) is ~10 LLM calls per refund, and every routing decision is a chance to take a wrong branch. If each routing decision has even a 5% chance of going wrong, five sequential decisions give a 22.6% chance that at least one step goes off-script — the arithmetic is 1 - 0.95^5, and it is the same compounding that kills every long autonomous chain.
The 2.0 workflow version draws the graph:
from google.adk import Workflow
from google.adk.agents import Agent
analyze_complaint_agent = Agent(
model="gemini-2.5-flash",
instruction="Read the complaint against the policy. Return: covered or not, and why.",
)
draft_email_agent = Agent(
model="gemini-2.5-flash",
instruction="Draft a confirmation email in the customer's language.",
)
workflow = Workflow(
# nodes: fetch history (tool) -> analyze (LLM) -> issue refund (tool)
# -> draft email (LLM) -> close ticket (tool)
# edges are code, not prompts — the route is fixed before the run starts
)
The same refund now costs 2 LLM calls instead of ~10, and the wrong-branch probability drops to zero — there is no branch to get wrong, because the edges are code. The model is used exactly twice, on the two steps where ambiguity lives. Everything else is a function call that costs ~5 ms and $0.
The compounding nobody budgets for
The failure math is the post's central number, because it is the one teams never compute before shipping an autonomous agent. The per-decision error rate p is small — a good model routes correctly 95–98% of the time. But routing decisions multiply:
| Steps | p = 2% | p = 5% | p = 10% |
|---|---|---|---|
| 3 | 5.9% | 14.3% | 27.1% |
| 5 | 9.6% | 22.6% | 41.0% |
| 10 | 18.3% | 40.1% | 65.1% |
A ten-step autonomous flow at 5% per decision fails more often than it succeeds at staying on-script — 40.1% of runs take at least one wrong branch. That is not a model-quality problem. It is an architecture problem: you asked a probabilistic component to do deterministic work. The workflow graph removes the multiplication entirely. The model's error rate still applies to the two steps it actually performs — reading the complaint, drafting the email — but a misread complaint is a content error you can catch with a review step, not a routing error that silently skips the refund.
What it costs, measured
The same refund, priced with the notebook's model (300 ms and ~$0.004 per LLM call at ~2,000 tokens on a flash-class model; 5 ms and $0 per tool call):
- LLM calls: 10 → 2 (5x fewer)
- Latency: ~3,000 ms → ~615 ms (4.9x faster)
- Model spend: ~$0.040 → ~$0.008 per refund (5x cheaper)
At 10,000 refunds a month, that is $400 → $80 in model spend and ~6.6 hours of cumulative customer waiting time removed — and the waiting-time number is the one that shows up in CSAT before the cost number shows up in a bill. These are modelled figures, not a live benchmark: the 300 ms and $0.004 per-call assumptions are stated in the notebook and easy to re-run with your own model's real numbers. The shape is what matters — every deterministic step you move from prompt to code removes one LLM call, one latency hit, and one compounding error term.
The three workflow shapes, and what changed in 2.0
ADK 2.0 ships three headline features on top of the runtime:
- Graph-based workflows. Nodes (agents, code functions, tools, other workflows) joined by edges. Use them when the process is fixed and you want it defined in code instead of in a prompt. This is the refund.
- Dynamic workflows. Code-based logic for loops and complex branching — the process is built at runtime, in ordinary code, for flows too tangled to draw as a static graph.
- Collaborative agent teams. A coordinator agent delegates to sub-agents, which return control to the parent automatically when they finish. Supported in Python and Go as of November 2026.
The 1.x workflow agents — SequentialAgent, ParallelAgent, LoopAgent — still run, but ADK marks them superseded by graph and dynamic workflows in Python, TypeScript, Go, and Kotlin. And the upgrade is not free. Three breaking changes to budget for:
-
Custom
_run_async_impl()overrides no longer function. Logic that lived there moves toBeforeAgentCallbackorAfterAgentCallback. -
The event schema grew
node_infoandoutputfields. Custom session stores with rigid database columns need a migration script first — skip it and the failure mode is silent state loss on graph replay. -
A broad
exceptinside a tool disables the new automatic retries. Catch narrowly, or the runtime can't help you.
The version picture as of today: Python is at 2.16.0 (PyPI, current), released on a roughly two-week cadence — 2.13.0 on October 23, 2.15.1 on November 25. Java 1.0 shipped March 30, 2026. Five languages, one graph engine, Apache 2.0.
Where it deploys
The same ADK source deploys unchanged to Cloud Run, to GKE, or to the managed Agent Runtime on Google Cloud's Gemini Enterprise Agent Platform (renamed from Vertex AI Agent Engine at Google Cloud Next 2026). The agent layer is deliberately thin: the Agent class (model + instruction + tools + sub-agents), function tools built from ordinary Python functions with docstrings, McpToolset for any MCP server, built-in tools (google_search, url_context, VertexAiSearchTool, code execution), and A2A for exposing agents to each other. The framework holds the loop, the sub-agents, the evals, and the deploy command together — it does not try to be the model, the cloud, or the database.
The state of the art, and the honest limits
ADK 2.0 is the clearest statement yet of a pattern the whole industry is converging on: deterministic scaffolding around probabilistic reasoning. LangGraph draws the same graph, CrewAI and AutoGen orchestrate the same teams, and every one of them exists because the same lesson keeps being relearned — the model is the most expensive and least reliable router you own, so route in code.
What ADK adds is the Google-stack integration: the same agents deploy to the managed runtime, the same eval framework from GDE #22's upcoming post tests them, and the model underneath is Gemini. What it does not add is a free lunch. A workflow graph is only as correct as the process you drew — if the refund policy has an exception your graph doesn't model, the graph will confidently do the wrong thing, deterministically, every time. The failure mode moves from "the model wandered off" to "the flowchart was wrong," and flowcharts are fixed by product people, not by prompt engineering. That is a better failure mode, but it is still a failure mode — and it is why the eval post (Dec 10) exists.
Takeaways
- Route in code, reason in the model. Every step whose next action is knowable in advance should be an edge, not a prompt.
- Routing errors compound multiplicatively. Five decisions at 5% each is a 22.6% chance of going off-script. Graphs remove the multiplication.
- The 2.0 refund is 5x fewer LLM calls, 4.9x faster, 5x cheaper — on stated, re-runnable model assumptions, and the shape holds for any model price.
-
Budget the migration.
_run_async_impl()overrides, the event-schema fields, and broadexceptblocks are the three traps. - Start with the refund. It is the smallest workflow that proves the pattern, and it is the notebook: a five-node graph, a simulated model, and the failure math, all runnable.
This is GDE post #18 of 36. Next: multi-agent orchestration — sequential, parallel, loop, and when each breaks (Dec 7). The companion notebook rebuilds the refund workflow as a runnable graph and recomputes every number in this post.
Companion notebook: the runnable tutorial for this post — download it here (open in Colab/Jupyter).




Top comments (0)