ADK Go 2.0 Just Got Better: Graph Workflows & HITL

ADK Go 2.0 Just Got Better: Graph Workflows & HITL

Building real-world agent applications is rarely as straightforward as sending a single prompt. Production-grade agents must handle complex tasks like classification, branching logic, fanning out to specialists, and seeking human approval. They also need to manage retries on failure and loop until a task is complete, making ad-hoc control flow quickly become brittle and unmanageable.

Since its initial 1.0 release, the Agent Development Kit (ADK) for Go has provided Go developers with a clean and idiomatic API for constructing robust production agents. Its foundation, built on strong typing, `iter.Seq2` event streams, and a runtime that integrates naturally into existing Go services, has proven remarkably successful. This solid groundwork precisely enabled the significant advancements we are excited to introduce today.

We are thrilled to unveil ADK for Go 2.0, featuring a groundbreaking, first-class approach to composing multi-agent applications: a powerful graph-based workflow engine. This major update also brings built-in human-in-the-loop (HITL) capabilities, dynamic orchestration written in pure Go, versatile LLM agent modes, and a unified node runtime. Now, both single agents and complex graphs operate under the same efficient execution model, streamlining development.

Building Smarter Agents: The Challenge and ADK 2.0’s Solution

Real-world agent applications are anything but simple; they must classify inputs, branch logic, fan out to specialized sub-agents, aggregate results, and often require human intervention. Trying to express such intricate orchestration with brittle, ad-hoc control flow quickly leads to maintenance headaches. ADK 2.0 provides an elegant solution by allowing you to describe your application’s flow as a graph of nodes connected by edges.

This approach hands execution to a sophisticated scheduler capable of running concurrently, persistently storing its state, pausing for human input, and reliably resuming later—even after process restarts. The beauty lies in its simplicity: a graph, once defined, is merely an agent.Agent that runs within your existing ADK runner, launcher, and console. This means no special harnesses or new servers are required, greatly simplifying deployment.

ADK offers a rich set of typed node constructors for common use cases, making it easy to define any unit of work that implements the Node interface. Here are some of the key node types available:

  • FunctionNode: For standard Go functions that perform an operation.
  • EmittingFunctionNode: Functions that can also stream events or pause for human interaction without requiring a dynamic node.
  • AgentNode: Embeds any agent.Agent (like an LlmAgent) directly into your graph.
  • ToolNode: Converts a tool.Tool into a discrete graph step.
  • JoinNode: Acts as a fan-in barrier, waiting for all predecessors to complete before aggregating their outputs.
  • DynamicNode: Enables orchestration logic written in plain Go, allowing for flexible, runtime-dependent workflows.
  • WorkflowNode: Allows you to embed an entire sub-workflow as a single node, promoting modularity and composability.
  • Parallel Workers: Runs a node concurrently across every item in a list and aggregates the results efficiently.
  • State-bound nodes (NewFunctionNodeFromState): Automatically pulls selected session state values into a typed Params struct using struct tags, eliminating manual state management.

Unlocking Complex Workflows: Graphs, Nodes, and Dynamic Orchestration

Edges are the connective tissue of your workflow, linking nodes and carrying crucial routing conditions. When a node completes, it can emit a routing value, causing matching edges to fire and direct the workflow accordingly. This powerful concept allows you to build any control-flow shape you need, from simple sequential chains to complex conditional routers, fan-out/fan-in patterns, nested sub-graphs, and even loops, as a completed node can be re-triggered.

ADK 2.0 provides various standard route types like StringRoute, IntRoute, BoolRoute, and MultiRoute, along with a default option for unmatched conditions. A particularly useful pattern involves using an LlmAgent as the “brain” of a router; the LLM classifies a user’s message, and a simple function emits the corresponding route. The graph then reliably dispatches to the correct handler, making decisions intelligent and execution robust.

Sometimes, the exact execution order isn’t known until runtime, perhaps depending on data, loop counts, or the model’s latest output. For these dynamic scenarios, ADK 2.0 introduces dynamic nodes. Within a dynamic node, you orchestrate child operations using ordinary Go code, leveraging functions like RunNode(...). This enables you to express complex loops, conditionals, accumulation, and fan-out across dynamic lists using the Go you already know.

Production agents often require human approval, correction, or input mid-run. ADK 2.0 makes Human-in-the-Loop (HITL) a first-class primitive: any node can pause the graph and ask a human a question. The workflow durably waits for the answer, making it resilient to process restarts or even different runtimes. Responses are rigorously validated against a schema, ensuring data integrity and providing clear error messages for mismatches.

A Unified Vision: Reliability, LLM Modes, and Seamless Migration

Reliability is paramount, and ADK 2.0 ensures it with built-in features like retry policies with exponential backoff and jitter for every node, eliminating the need for external dependencies. You can also configure per-node timeouts, cap graph-wide concurrency, and use isolation scopes to prevent “chatter” from one parallel branch from affecting another’s LLM prompt history. The underlying scheduler expertly handles goroutines, channels, backpressure, and cancellation for you.

ADK 2.0 also introduces specific modes for LLM agents—Chat, Task, and SingleTurn—allowing a coordinator to interact with the user while sub-agents quietly complete specialized tasks. The correct helper tools (finish_task, single_turn, task) are automatically installed based on each agent’s designated role. Under the hood, the runner now drives a plain LlmAgent through the same node runtime that powers complex workflows. This means single-agent applications and full graphs share a consistent execution model, and features like human-in-the-loop now work seamlessly for a plain LLM agent too.

The programming model has also been significantly smoothed: ToolContext and CallbackContext are unified into a single agent.Context, simplifying the API for developers. Additionally, node and agent execution now show up in one consistent telemetry span tree, offering unparalleled visibility into your graph’s operations. ADK 2.0 is highly additive, with the entire workflow engine residing in new packages you explicitly opt into, minimizing disruption.

While ADK 2.0 is mostly additive, a few breaking changes stem from unifying the runtime, but each has a straightforward, mechanical fix. For instance, context types are now unified to agent.Context across tools, callbacks, and workflow nodes, simplifying development. Event streams are richer, carrying new node and metadata fields for enhanced observability. A detailed step-by-step migration guide is available to ensure a smooth transition.

The fastest way to experience the power of ADK 2.0 is through the new workflow examples, showcasing basic sequences, LLM-as-router patterns, dynamic orchestration with human-in-the-loop, and more complex multi-shape graphs. ADK 1.0 demonstrated that building serious agents in Go could be clean and productive. ADK 2.0 elevates this by empowering you to compose those agents into reliable, observable, and resumable workflows—all within an idiomatic Go framework, with humans seamlessly in the loop when it truly matters.

Source: Google Developers Blog

Kristine Vior

Kristine Vior

With a deep passion for the intersection of technology and digital media, Kristine leads the editorial vision of HubNextera News. Her expertise lies in deciphering technical roadmaps and translating them into comprehensive news reports for a global audience. Every article is reviewed by Kristine to ensure it meets our standards for original perspective and technical depth.

More Posts - Website

Scroll to Top