Why ADK 2.0 Moves Routing to a Graph Engine and Keeps Inference in the Model

ADK 2.0 introduces a graph‑based Workflow Runtime that separates routing from LLM inference, replacing Sequential/Parallel/Loop agents with deterministic nodes, cutting token usage by ~50% and latency by ~20%, while adding HITL, automatic retries, and a clear migration path for Python and Go users.

AI Engineer Programming
AI Engineer Programming
AI Engineer Programming
Why ADK 2.0 Moves Routing to a Graph Engine and Keeps Inference in the Model

Overview

In May 2026 Google released ADK 2.0.0 GA for Python, followed by Go in June 2026. The core upgrade is a new Workflow Runtime that turns the Agent Development Kit from a layered executor into a graph‑based execution engine.

Why the change

Version 1 relied on SequentialAgent, ParallelAgent and LoopAgent for orchestration. Those agents could only express simple serial or parallel flows; complex business logic required deep nesting, custom tools, or external Cloud Workflows. In production the model‑driven routing was slow, expensive, and unstable.

Workflow Runtime

ADK 2.0 splits execution routing from language inference . A graph defines nodes (Agent, Tool, Function) and edges (next step). The scheduler handles concurrency, state persistence, pause, and resume.

Two workflow modes are supported:

Static graph workflow : the path is predefined; edges declare node connections and conditional routing.

Dynamic workflow : Python or Go control flow (including asyncio) can be used to express loops and complex branches, and the sub‑workflow can be embedded in a larger graph.

Benchmark (refund‑process example)

Tokens per run: 5,152 (pure LLM Agent) → 2,265 (ADK 2.0 workflow), ≈ 50 % reduction.

Latency per run: 7.2 s5.7 s, ≈ 20 % reduction.

The numbers are illustrative; real‑world results may vary. The gain comes from limiting LLM calls to truly language‑heavy nodes (e.g., policy analysis) while deterministic nodes handle database updates, payments, and status changes.

Other key capabilities

HITL as a built‑in primitive : any node can pause for human input; the session state survives process restarts and is shared between Python and Go runtimes.

Dynamic orchestration : complex loops and real‑time signal‑driven branches can be expressed in native code and nested as sub‑workflows.

Structured multi‑agent collaboration : multiple specialized LLM agents share a single graph, each receiving only the minimal context needed for its task.

Automatic elasticity : RetryConfig (e.g., max_attempts=3) provides exponential back‑off retries. Developers must avoid swallowing exceptions with a broad except Exception so that the runtime can see failures.

Unified node runtime : agents and full graphs use the same execution model, aligning telemetry, state persistence, and runtime mechanisms.

Migration and breaking changes

Python : BaseAgent now inherits BaseNode and is treated as a graph node.

Custom execution should move from overriding _run_async_impl / generate_content to using BeforeAgentCallback / AfterAgentCallback.

Event schema gains node_info and output fields; sessions stored as rigid column tables may need schema expansion.

Event writing must be done via explicit yield events; manual session.events.append() or enqueue_event is no longer supported.

Error handling now relies on the framework propagating exceptions; developers should let BaseException bubble up and avoid catching it, otherwise retries and HITL are disabled.

Go :

Import path changes from google.golang.org/adk to google.golang.org/adk/v2.

Agent interface now implements agent.Agent with Run executed as a graph node; custom logic moves to callbacks.

Event construction changes from session.NewEvent(ctx.InvocationID()) to session.NewEvent(ctx, ctx.InvocationID()).

New schema fields ( IsolationScope, Routes, RequestedInput, Output, NodeInfo) require updates to storage definitions.

Struct fields Routes, RequestedInput, Output lack JSON tags, so they serialize with Go field names; IsolationScope and NodeInfo use camelCase JSON names—custom serializers must respect this.

When to use Workflow vs. Agent

Predefined, deterministic business paths → Workflow

Strict compliance and predictable failure handling → Workflow

Goal to reduce token consumption and latency → Workflow

Unstructured inputs (free‑form text, images) → Agent

Subjective tasks (summarization, classification, drafting) → Agent

Reasoning steps that cannot be expressed as conditional code → Agent

In practice most production systems combine both: the graph drives the deterministic path, while agents handle the nodes that require LLM reasoning.

Conclusion

The fundamental shift in ADK 2.0 is orchestration: routing is now handled by a deterministic graph engine, and LLM inference appears only at nodes that truly need it. Teams moving agents from demo to production should verify session and event schemas, ensure custom execution logic is migrated to callbacks, and confirm that exception handling does not suppress retries or HITL. Refer to the official ADK 2.0 documentation and the "Why we built ADK 2.0" blog for detailed guidance.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonLLMWorkflowGoOrchestrationGraphADK
AI Engineer Programming
Written by

AI Engineer Programming

In the AI era, defining problems is often more important than solving them; here we explore AI's contradictions, boundaries, and possibilities.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.