How to Build Graph-Based Workflows With Google ADK Go 2.0
Learn how to migrate from rigid DAGs to dynamic, stateful AI agent graphs using Google's new ADK Go 2.0 workflow engine and Human-in-the-Loop primitives.
On June 30, 2026, Google released the Agent Development Kit (ADK) for Go 2.0, replacing its legacy hierarchical executor with a first-class, graph-based workflow engine. This architectural shift brings the Go framework into parity with the recent Python ADK 2.0 update. The new engine provides a deterministic control layer around probabilistic language models, allowing you to define application shape as a graph of nodes connected by edges. Here is how to configure the new unified runtime, manage agent isolation modes, and implement stateful routing.
Transitioning to the Graph-Based Workflow Engine
ADK Go 2.0 fundamentally changes how developers organize logic. Instead of chaining linear prompt responses, you map the application as a state machine where every component is evaluated as an individual node.
Nodes can represent standalone agents, utility functions, or external tools. The unified node runtime ensures that single agents and complex multi-agent graphs share the exact same execution model. This consistency simplifies state management and improves observability across the entire execution lifecycle. You can construct parallel fan-out and fan-in patterns to execute multiple independent reasoning tasks concurrently before aggregating the results.
To construct these topologies, you use the new google.golang.org/adk/v2/workflow package. It provides native graph construction utilities like workflow.NewFunctionNode and workflow.Chain. The ADK graphs documentation covers the complete parameter lists and routing syntax required to stitch these components together.
Dynamic Orchestration
Traditional Directed Acyclic Graphs (DAGs) define a rigid execution path at compilation time. ADK Go 2.0 utilizes dynamic orchestration governed by plain Go code. Workflows can adapt their path at runtime based on real-time external data or LLM decisions.
If a routing node determines that a user query requires additional clarification, it can loop back to an earlier collection node. This cycle continues until the required criteria are met. Implementing multi-agent coordination patterns becomes a matter of writing standard Go control structures that dictate the transitions between nodes.
Managing Context With Agent Modes
To maintain cleaner context windows and reduce API costs, coordinators can spawn sub-agents in specialized isolation modes. These modes dictate how agents retain memory and interact within the broader graph.
| Agent Mode | Description | Use Case |
|---|---|---|
| Chat | Maintains a continuous, stateful history of the conversation and all executed actions. | User-facing interfaces and long-running interactive sessions. |
| Task | Ephemeral context bound strictly to a specific objective. Discards history upon completion. | Background data processing, summarization, and defined sub-routines. |
| SingleTurn | Completely stateless execution. Evaluates the input and returns a result without saving any context. | Rapid classification, validation checks, and simple functional transformations. |
Selecting the correct mode prevents context bloat. You can assign a primary coordinator agent to the Chat mode while delegating heavy analytical work to sub-agents running in Task mode.
Implementing Human-in-the-Loop (HITL)
The framework now treats Human-in-the-Loop as a core primitive rather than an afterthought. The scheduler can automatically pause workflow execution when it encounters high-stakes tasks. Common triggers include financial transaction approvals, destructive database operations, or sending bulk communications.
When execution pauses, the engine automatically persists the current session state. The process can safely terminate while waiting for human authorization. Once the human operator approves or modifies the proposed action, the engine retrieves the state and resumes execution exactly where it left off.
Cross-Language Support via the A2A Protocol
Enterprise environments rarely standardize on a single language for all artificial intelligence workloads. ADK Go 2.0 includes native support for the Agent-to-Agent (A2A) protocol.
This integration allows Go-based agents to collaborate directly with agents written in Python, Java, or TypeScript. A specialized Go service designed for backend database operations can seamlessly pass structured data and execution control to a Python-based data science agent. Both agents maintain their distinct execution environments while communicating over a unified protocol interface.
Developer Tooling and the Antigravity CLI
Google has deprecated the old Gemini CLI in favor of the new Antigravity CLI. This updated command-line interface provides necessary tooling for the 2.0 framework.
The Antigravity CLI assists in scaffolding new graph structures and managing dependency imports. It also includes local harness capabilities so you can evaluate and test AI agents before deploying them to production environments. You can run simulated traces to verify that dynamic routing logic behaves predictably under failure conditions.
Tradeoffs and Architectural Limitations
The shift to a graph-based engine introduces structural overhead. Building a simple script that requires only one sequential LLM call is now more verbose than in the 1.0 release.
Resumable execution and state persistence rely heavily on cloud-native storage integrations. To utilize the HITL pause and resume features across process restarts, you must configure a persistent backend like Firestore. Running entirely in-memory limits the framework’s ability to survive application crashes or scale across multiple container instances.
Next Steps
Update your go.mod file to pull the v2 module and install the Antigravity CLI to begin migrating your existing workflows. Start by mapping your current sequential agent calls into discrete nodes, then utilize the SingleTurn mode for basic functions before implementing complex cyclic routing logic.
Get Insanely Good at AI
The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.
Keep Reading
Claude Cowork Dispatch Steers Desktop Agents via Smartphone
Anthropic is testing a mobile interface for Claude Cowork that lets users launch, monitor, and steer long-running autonomous agents from their smartphones.
How to Refactor Monolithic Agents with Google ADK
Learn how to transition monolithic prompt scripts into production-ready multi-agent pipelines using Google's Agent Development Kit and the Agent2Agent protocol.
Slack Gains Shared Autonomous Agents With Claude Tag Beta
Anthropic has launched Claude Tag in beta, bringing autonomous, multi-agent AI directly into shared Slack channels for Enterprise and Team customers.
A2A v2.0 Adds Zero-Knowledge Proofs to Multi-Agent Handoffs
Google Cloud's A2A Protocol v2.0 introduces decentralized discovery and zero-knowledge capability proofs, reducing multi-step workflow token consumption by 35%.
Two-Agent AMIE Architecture Matches Physicians on 3-Visit Plans
Google Research demonstrated that its Gemini-based AMIE system matches primary care physicians in managing longitudinal patient care across multiple visits.