google / google/adk-docs

How to gracefully catch model-level `429 RESOURCE_EXHAUSTED` errors in workflow nodes?

Open
#2,029 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.5k
Forks
1.3k
Avg merge
7d 1h
Merged PRs (30d)
34

Description

### Title
Feature Request / Bug: How to gracefully catch model-level `429 RESOURCE_EXHAUSTED` errors in workflow nodes?

### Description
When running dynamic nodes in a workflow using `ctx.run_node(agent, node_input=...)`, if the underlying LLM call fails with a `429 RESOURCE_EXHAUSTED` rate limit error, the exception raised at the outer `try...except` block is wrapped into a generic `DynamicNodeFailError`.

Currently, handling this error gracefully requires inspecting private exception classes or unwrapping `e.__cause__`, which makes custom error routing (e.g., redirecting to a fallback node or notifying the user) overly complex and brittle.

### Code Snippet
```python
try:
order_id = await ctx.run_node(refund_agent, node_input=node_input)
except Exception as e:
# `e` is caught as `google.adk.workflow._errors.DynamicNodeFailError`
# The underlying cause is `google.adk.models.google_llm._ResourceExhaustedError`
res = await ctx.run_node(final_agent, {"status": "error", "message": f"{e!r}"})
return

Contributor guide

Open the contributing guide

Research direction

Start with the ctx.run_node call and the DynamicNodeFailError behavior described in the issue, then trace how the underlying RESOURCE_EXHAUSTED error is wrapped. Compare the available public error-handling surface with the private exception and __cause__ workarounds; done should provide a stable, documented way to route model-level rate-limit failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.