langchain-ai/langgraph · error · LangGraphDeprecatedSinceV05
`retry` is deprecated and will be removed. Please use…
Error message
`retry` is deprecated and will be removed. Please use `retry_policy` instead.
What it means
Deprecation warning in StateGraph.add_node: the retry keyword is superseded by retry_policy. The shim still applies the value, but retry will be removed and retry_policy accepts a single policy or a sequence.
Solutions
- Replace add_node(..., retry=RetryPolicy(...)) with add_node(..., retry_policy=RetryPolicy(...))
- Pass retry_policy at compile time via _NodeDefaults-style graph-level defaults if you want one policy for all nodes
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at libs/langgraph/langgraph/graph/state.py:762 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/d0ef59950d578157.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/graph/state.py:762
graph.invoke({"x": 1})
# {'x': 2}
```
Example: Customize the name:
```python
builder = StateGraph(State)
builder.add_node("my_fair_node", my_node)
builder.add_edge(START, "my_fair_node")
graph = builder.compile()
graph.invoke({"x": 1})
# {'x': 2}
```
Returns:
Self: The instance of the `StateGraph`, allowing for method chaining.
"""
if (retry := kwargs.get("retry", MISSING)) is not MISSING:
warnings.warn(
"`retry` is deprecated and will be removed. Please use `retry_policy` instead.",
category=LangGraphDeprecatedSinceV05,
)
if retry_policy is None:
retry_policy = retry # type: ignore[assignment]
if (input_ := kwargs.get("input", MISSING)) is not MISSING:
warnings.warn(
"`input` is deprecated and will be removed. Please use `input_schema` instead.",
category=LangGraphDeprecatedSinceV05,
)
if input_schema is None:
input_schema = cast(type[NodeInputT] | None, input_)
timeout = coerce_timeout_policy(timeout)
if not isinstance(node, str):
action = node
if isinstance(action, Runnable):View on GitHub (pinned to 38031739e5)