ADK Java now pauses a workflow tool node that asks for approval instead of passing its error map downstream. Typed interrupts, strict answers, reruns and migration steps.
The refund that announced itself
Jenya maintains the help-desk workflow at Belgavi's Book Store. It is a small graph: a node fetches the CASE and the order, a tool node issues the refund, and a third node writes to the customer. The refund tool is the only step with money attached, so it is marked as needing human confirmation. In a review of old runs, Jenya found something odd. On some days the customer was told "your refund of the requested amount is on its way" while the refund ledger had no entry at all.
Nothing had crashed. The refund tool had done exactly what it was designed to do when no approval was present: it returned a small error map saying the call needed confirmation. The workflow engine treated that map as the node's output and moved on. The notification node, written for the happy path, read whatever it was given and sent a cheerful message.
That is the failure this article is about. When a tool inside a workflow graph asks a person to approve the call, the graph has two choices. It can hand the tool's "needs confirmation" placeholder to the next node as if it were a result, or it can stop the node, ask, and continue only when someone answers. The second is the only one that keeps the approval meaningful. ADK Java made exactly this change on 10 November 2026.
What changed in ADK Java
Commit f98506455b in google/adk-java, titled "fix(workflow): pause a tool node when its tool asks for confirmation", rewrote the workflow tool node. Before the change, the class documentation said plainly that "a tool that asks for confirmation does not pause the workflow: the node outputs the tool's placeholder error." The tests pinned that behaviour: a function tool created with confirmation required produced the map {"error": "This tool call requires confirmation, please approve or reject."} as the node's output.
After the change, the node returns a request for input instead. The interrupt id is wf_tool_confirmation: followed by the node path, the message is the tool's hint or "Please approve or reject the tool call NAME().", the payload carries the tool name and arguments, and the expected answer has a schema with three fields: confirmed (boolean), hint (string) and payload (anything). The node is now marked to rerun on resume, so once a person answers, the tool runs again with that answer available as its confirmation.
The answer parsing is strict, and the tests show how. An answer with an unknown key such as approved, a plain string, or a hint that is not a string fails the node with a data error that names the node. An answer that leaves out confirmed is treated as a rejection, and a rejection outputs {"error": "This tool call is rejected."} without running the tool. A tool that requested confirmation itself is rerun with the answer and decides what a rejection means, for example returning a "declined" status.
Two caveats matter for anyone reading this on 11 November 2026. The commit was not part of a release yet, and ToolNodes is annotated as experimental, so the shape may change before it ships. The lesson does not depend on ADK, though. Any workflow engine that lets an approval request become data has the same bug.
Why the placeholder is dangerous
A placeholder error looks harmless because it says "error". It is dangerous because of what the surrounding code assumes.
- Downstream nodes see a value, not a stop. A node that formats a reply, writes an audit line or calls a second tool receives a well-formed map. Unless every consumer checks for an
errorkey, the run continues as if the refund happened. - The approval request is lost. Nobody is asked anything. The workflow finishes, so dashboards count it as complete. The person who should have approved the refund never sees it.
- Retries make it worse. A retry policy that treats a completed run as success never retries. One that treats an error map as retryable re-asks forever without anyone to answer.
- Agents read it as a hint. If the next node is a model, a sentence such as "requires confirmation, please approve or reject" reads like an instruction. A model may decide to "approve" by calling another tool, which is precisely the decision that was supposed to belong to a person.
The companion example reproduces this with a three-node workflow. In placeholder mode the run ends done, the ledger is empty and the customer message says the refund is on its way. In pause mode the first turn ends paused with the interrupt id, and nothing downstream runs.
The pattern: a typed interrupt and a rerun
The fix has four parts, and each one is deterministic. No model is involved in any of them.
- Stop at the node. The node returns an interrupt instead of an output. The engine records which node is waiting, persists the workflow state and ends the turn.
- Ask with a schema. The request carries a stable id, a human-readable message, the arguments the tool will use and a response schema. The person approves the exact arguments they can see, not a summary.
- Parse the answer strictly. Unknown fields, wrong types or a missing decision must never become an approval. Fail the node on malformed answers and treat a missing decision as "no".
- Rerun the node with the answer. The engine resumes from the waiting node and calls the tool again with the confirmation attached. Nodes that already completed are not run again.
ANSWER_KEYS = {'confirmed', 'hint', 'payload'}
def parse_answer(answer, node):
if not isinstance(answer, dict) or not set(answer) <= ANSWER_KEYS:
raise WorkflowDataError('answer for %s is not a confirmation' % node)
if answer.get('confirmed') is not None and not isinstance(answer['confirmed'], bool):
raise WorkflowDataError('answer for %s is not a confirmation' % node)
if answer.get('hint') is not None and not isinstance(answer['hint'], str):
raise WorkflowDataError('answer for %s is not a confirmation' % node)
return Confirmation(confirmed=answer.get('confirmed') is True,
hint=answer.get('hint'), payload=answer.get('payload'))The is True matters. A string "yes", the number 1 or a missing field must not approve a refund. In the companion, {"approved": true} fails the node, {"hint": "looks fine"} rejects the call, and only a real boolean true issues the refund.
The payload field is useful for bounded approvals. In the companion, Geetha approves the refund with {"confirmed": true, "payload": {"max_amount": 1000}}, and the tool refunds 1,000 instead of the requested 1,250. The approver changes the decision within limits the tool enforces; the approver does not edit free text that a model then interprets.
What has to be safe before the request
A rerun means the tool's code runs twice: once to discover that it needs confirmation, once with the answer. Whatever the tool does before it asks happens twice.
For a function tool marked as requiring confirmation, ADK checks before calling the function, so nothing runs on the first pass. A custom tool that calls requestConfirmation itself is different: everything above that call runs on both passes. The companion shows the cost. A refund tool that emails the customer "we are processing your refund" before asking for approval sends two emails, even when the refund is then rejected.
The rule is simple to state and easy to check in review: before a tool asks for confirmation, it may read, compute and validate, but it must not write. Put side effects after the confirmation check, or make them idempotent with a key derived from the case and the arguments.
Downstream nodes still need to branch
Pausing fixes the missing approval. It does not fix a downstream node that treats every map as success. When the person rejects the refund, the tool node outputs the rejection error, and the notification node in the companion again tells the customer the refund is on its way.
The fix is the same one you would make in any workflow without an agent: model the step's outcome explicitly. The checked notification node in the companion looks for an error or a missing refunded field and writes "No refund was issued for this case; a person will follow up." Better still, route on the outcome in the graph itself, with separate edges for approved, rejected and failed.
Migrating an existing graph
If you run workflow graphs with tools that need approval, whether on ADK Java or another engine, the migration is mechanical.
- Inventory the tools. List every tool node whose tool can request confirmation, either declaratively or in code.
- Read the consumers. For each one, look at every node that consumes its output and ask what it does with an error map. Anything that formats, forwards or acts on the value is a candidate bug.
- Search the history. Look in past runs for outputs that contain the placeholder text. Each one is a run where an approval was skipped and the workflow still finished.
- Turn on pausing and give the waits an owner. Paused runs need somewhere to land: a queue of pending approvals with an owner and an expiry, so a forgotten approval ends as a clean rejection, not an open run.
- Add explicit outcome edges so a rejection takes a different path from a success.
- Move side effects in custom tools below the confirmation check.
Tests that keep it fixed
The ADK change ships with tests worth copying in spirit. The companion's tests check the same properties against the small engine:
- the first turn pauses with the expected interrupt id and nothing downstream runs;
- approval issues exactly one refund, even though the tool is called twice;
- a missing
confirmedrejects; - malformed answers fail the node instead of approving;
- side effects placed before the request are counted twice, so the test fails if someone moves one there;
- a checked downstream node reports "no refund" after a rejection.
None of these tests needs a model. They exercise the deterministic shell around the agent, which is where an approval either holds or leaks.
When you do not need an agent here
Nothing in this workflow requires a model. Fetching the CASE, computing the refund amount from the order and policy, asking a person and notifying the customer are all deterministic. An agent earns its place upstream, for example in reading a free-text complaint and proposing which CASE and which refund rule apply. Keep the proposal in the agent and the approval in the workflow. If the agent proposes and the workflow asks a person, the approval cannot be argued away by a prompt.
Limits of the companion
The companion is a three-node engine written for teaching, not ADK. It does not persist state across processes, expire pending approvals or handle concurrent answers. It shows the two behaviours and the parsing rules described in the commit, not the full workflow runtime.