Distributed Graph Execution: Running Nodes Across Independent Workers
What ADK 2.0 graph workflows actually guarantee about distributed execution today, what you must build yourself, and a candid Cloud Run architecture sketch with limits and caveats.
Published on • December 2, 2026
AI Assistant

The question arrives in every architecture review: “Great graph — now how do we run node 4 on GPU workers and node 7 in a separate region?” It is the right question, and it deserves a straight answer rather than a diagram with hopeful arrows.
Here is the straight answer: ADK 2.0 executes a graph inside a single runtime process, driven by one Runner, with state and history carried by session events. The framework scales by running more replicas of your whole agent application — not by scattering individual nodes across machines. Distributed execution of a single graph is something you architect around ADK, not something ADK hands you.
That is not a criticism; it is a scoping fact. This article covers, honestly: how ADK’s execution model works today, what the docs actually give you (deployment targets, resumability, per-node retries), what you must build yourself (external state, queue-based fan-out, cross-process coordination), a concrete Cloud Run sketch, and the limits you should write into your design doc before you start.
Prerequisites
- ADK 2.0 graph workflows (graphs overview) and the event loop
- Basic familiarity with container deployment (Cloud Run or equivalent)
- Read of the deployment and resume docs is helpful but not required
1. What ADK’s execution model actually is
Walk through the runtime event loop and the shape is unmistakable. The Runner receives a user query, calls the root agent’s execution method, and then loops: your node logic yields an Event → execution pauses → the Runner commits the event’s state_delta through the SessionService → the event is forwarded upstream → your node resumes. Repeat until the generator is exhausted.
Everything in that loop is one process:
- Nodes are generators, not services. A function node is a Python function; an agent node is an LLM call made from the same process. The engine interleaves them cooperatively.
- Parallel paths are in-process concurrency. Fan-out — multiple
STARTrows converging on aJoinNode— runs those branches concurrently inside the run, and the join is a barrier that waits for all of them in that same process. - State lives in the session.
state_deltaand event history are written through theSessionService, whose default implementation is in-memory. The session is the graph’s memory; the process is the graph’s body. - Data passes on the edge. One node’s
outputbecomes the next node’sinputwithin the run — there is no wire format between nodes because there is no wire.
Nothing in the graph documentation describes placing a node on another machine. The topology you declare is the topology one runtime executes.
2. What the docs do give you
Three capabilities matter when you think about scale, and it is worth being precise about each.
Deployment targets scale whole replicas. The deployment docs list Agent Runtime on Agent Platform (fully managed auto-scaling), Cloud Run (container-based auto-scaling), GKE (maximum control, good for open models), and any other container-friendly infrastructure. All four scale the entire agent application: N replicas means N complete graphs running concurrently, each with its own process and session in flight. That handles horizontal throughput — more requests per second — beautifully. It does not place one graph’s nodes side by side across workers.
Resumability survives process death — with caveats. ADK Python 1.16+ can mark a workflow resumable:
app = App(
name='my_resumable_agent',
root_agent=root_agent,
resumability_config=ResumabilityConfig(
is_resumable=True,
),
)
If a run stops — dropped connection, power failure, a deploy — you resume it by invocation ID (found in the event history) rather than restarting:
async for event in runner.run_async(
user_id='u_123', session_id='s_abc', invocation_id='invocation-123'
):
...
The mechanism: completed steps are logged as events; on resume, the system reinstates completed events and restarts from the partially completed state. Tool results that already returned are replayed, and the interrupted tool runs again. The docs are explicit about the semantics: tools run at least once, and possibly more than once, so anything with side effects needs an idempotency guard. They are equally explicit that you must not modify a stopped workflow before resuming it.
Per-node retries and timeouts (RetryConfig, timeout) let a node recover from transient failures without failing the whole run — but the attempt counter lives in memory for the current run of that node. Pause or restart, and a node starts over with all its attempts available.
3. The gap: what you must build yourself
Now the candid inventory. If your design requires individual nodes to run on independent workers, these are the pieces with no ADK primitive behind them:
| You need | Built-in? | What you build |
|---|---|---|
| One graph, nodes on different machines | ❌ | Partition the graph yourself: each segment becomes its own service |
| Durable cross-process state | ⚠️ Partial | A SessionService backed by shared storage (anything implementing BaseSessionService over a database), plus single-writer discipline per session |
| Queue-based fan-out to workers | ❌ | A Pub/Sub / Cloud Tasks queue between stages; workers acknowledge and push results back |
| Exactly-once side effects | ❌ | Idempotency keys in your tools; ADK guarantees at-least-once on resume |
| Distributed join (barrier across services) | ❌ | Aggregation logic in the coordinator — JoinNode only waits on in-process predecessors |
| Cross-stage observability | ⚠️ Partial | Events per session are your trace; stitch cross-service spans yourself (OpenTelemetry) |
| Resuming after crash | ✅ | ResumabilityConfig + invocation-ID resume (Python 1.16+) |
| Retrying flaky nodes | ✅ | RetryConfig + timeout per node |
The pattern in that table: ADK is strong inside a process and deliberately neutral between processes.
4. Architecture sketches on Cloud Run
Given that split, three layouts are worth considering — in increasing order of ambition.
Option A — whole graph per request (start here). One Cloud Run service runs the ADK API server; every invocation executes a complete graph in one replica; concurrency and scaling are Cloud Run’s problem:
clients ──HTTP/SSE──▶ [Cloud Run: adk-api]
├─ POST /run_sse (streamed events)
├─ graph: ingest → analyze → route → notify
└─ SessionService over Firestore/Postgres
This is the honest default. Most graphs are seconds long; replicas scale to zero when idle; the session service gives you persistence across deploys. You only leave this option when a node is the bottleneck — not when the graph is.
Option B — keep the graph whole, offload the heavy node. When one node (OCR, embedding, video transcoding) needs different compute, keep orchestration in the ADK service and push the work out through a long-running tool:
[Cloud Run: adk-api] ──enqueue──▶ [Cloud Run: workers, min=0]
▲ │
│ resume invocation with │ job completes
│ function response ▼
└──────── push result ──── [Pub/Sub / Cloud Tasks]
The tool marks itself long-running, the graph yields, and the result comes back as a function response that resumes the invocation — the resume docs note exactly this: setting new_message to a function response resumes a long-running function. Your graph topology, routing table, and validation rules stay intact; only the expensive computation moves. Scale workers independently, let them scale to zero, and pay for what runs.
Option C — split stages into services (the true distributed version). Each stage becomes its own ADK application behind a queue:
[ingest-svc] ──Pub/Sub──▶ [enrich-svc] ──Pub/Sub──▶ [llm-svc] ──Pub/Sub──▶ [notify-svc]
│ │ │ │
└───────────────── shared SessionService / event log ──────────────────────┘
This buys independent scaling, isolation (a runaway extraction cannot take down ingestion), and per-service deploys. The price is that you now are the workflow engine: you own message ordering, retries, dead-letter queues, cross-service joins, and the schema of every handoff. The Workflow class’s guarantees — build-time topology validation, DEFAULT_ROUTE safety, single-terminal-output checks, in-process joins — do not cross a queue boundary. If you find yourself needing durable timers, signals, and replay across those services, that is the signal to put a real durable-execution engine (Temporal, for instance) under your ADK agents rather than reinventing one with Pub/Sub.
5. Resumability in depth: the closest thing to distributed execution
Worth a closer look, because resume is where ADK genuinely bridges process boundaries. Configure ResumabilityConfig(is_resumable=True), keep the API server available, and after an interruption resume by invocation ID — via curl against POST /run_sse with invocation_id, or runner.run_async(..., invocation_id=...).
What it means for a distributed design:
- The event history is the checkpoint. Completed tool results are reinstated instead of recomputed, so a restart mid-graph loses little work.
- At-least-once is the contract. Design every tool as if it will run twice: upserts, natural keys, transactional writes.
- Freeze the graph. Do not add or remove agents in a stopped workflow before resuming — the docs call this unsupported.
- Resume is not a scale-out mechanism. It recovers one run on some process; it does not spread that run’s nodes across many.
6. Limits and caveats
Put these in the design doc up front:
- No node-level distribution. One graph, one runtime process. Distribution is an architecture you wrap around ADK.
- Replicas are not coordinated. Two replicas serving the same session need a shared, consistently written session service — in-memory sessions are per-process by definition.
JoinNodeis an in-process barrier. A hung predecessor holds the join; attach node timeouts so the barrier fails loudly instead of silently waiting.- Attempt counters are memory-resident. A restarted node gets a fresh retry budget.
- Resume implies at-least-once side effects and forbids modifying the stopped workflow.
- Graph workflows have documented incompatibilities with some third-party integrations — verify before wiring one in.
- Resumability is version-gated (Python 1.16+), and resuming from the ADK web UI or CLI is not currently supported — it is an API/Runner capability.
7. Decision checklist
- Is the bottleneck the graph or a single node? Scale replicas before splitting a graph.
- Does a stage need different hardware or isolation? Offload it as a long-running tool (Option B) first.
- Is your session service shared and persistent before you run more than one replica?
- Are all side-effecting tools idempotent under at-least-once execution?
- If you split stages (Option C), have you accepted ownership of queues, retries, and joins?
- Do you need durable timers, cross-language workers, and replay? Consider a durable-execution engine under ADK instead of DIY.
- Are node timeouts set so no barrier can hang indefinitely?
Conclusion
ADK 2.0 gives you a serious single-process workflow engine: declarative topology with build-time validation, events as a built-in trace, per-node retries, and resumability that survives process death with at-least-once semantics. What it does not give you is a scheduler that places individual nodes on independent workers — and the honest path to distribution is to scale replicas, offload heavy nodes behind queues and long-running tools, and split into services only when a stage’s scaling story demands it.
Distribute at the boundaries you must, keep the graph whole where you can, and treat every queue you add as a workflow engine you now have to operate.