How to gracefully catch model-level `429 RESOURCE_EXHAUSTED` errors in workflow nodes?
- 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
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