published fresh until

GraphRecursionError, InvalidUpdateError: how do I fix them?

Summary As of October 2026, fix termination for GraphRecursionError, state merge or return contracts for InvalidUpdateError, and output format for OutputParserException; historical channel wording needs a version check. Checked 2026-10-20.

Not for LangGraph vs provider SDK, see langgraph-or-provider-agent-sdk-for-my-agent; frameworks by language, see agent-framework-or-plain-sdk-for-python-ts-dotnet-or-java-2026

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Your LangChain/LangGraph agent loops until it stops, parallel branches crash, or model output fails to parse. Match the message before choosing a fix; these fail at different layers.

Versions and scope

Python examples; checked 2026-10-20. PyPI LangChain lists 1.5.2 (as of November 2026; checked 2026-11-24), MIT (checked 2026-10-20); PyPI LangGraph lists 1.2.24 (as of November 2026; checked 2026-11-24), MIT (checked 2026-10-20). Default-branch source is not proven identical to these releases. Historical messages are labelled. No hosted-service price claim.

Start with python -m pip show langchain langchain-core langgraph and python -m pip check. Capture the full message and failing node. No commands below were executed for this draft.

GraphRecursionError

Exact example with a configured limit of 25, not a claimed default:

Recursion limit of 25 reached without hitting a stop condition. You can increase the limit by setting the `recursion_limit` config key.

The class is langgraph.errors.GraphRecursionError. Official runtime source, checked 2026-10-20.

The graph exhausted its superstep budget. Inspect routing and repeated tools. For a finite workflow needing more steps, run graph.invoke(inputs, {"recursion_limit": 100}); this is top-level config. For a loop, route to END when done. Official guide, checked 2026-10-20.

Do not use sys.setrecursionlimit, put the setting inside configurable, or keep raising the budget without checking termination. Inspect completed tools before replaying side effects.

Invalid update for channel / concurrent InvalidUpdateError

Exact historical message:

InvalidUpdateError: Invalid update for channel root: LastValue can only receive one value per step.

Minki Jung's issue #492 verifies this trace; checked 2026-10-20. It establishes historical wording, not current-release output.

Current source constructs this template, substituting your field for {self.key}:

At key '{self.key}': Can receive only one value per step. Use an Annotated key to handle multiple values.

It raises InvalidUpdateError with INVALID_CONCURRENT_GRAPH_UPDATE. Official LastValue source, checked 2026-10-20.

Both mean incompatible simultaneous writes to one last-value field. Choose a meaningful reducer, or separate branch fields and a joining node. For an untyped root dictionary, define field-level state first. The official guide uses Annotated[list, operator.add]; checked 2026-10-20. Standalone adaptation:

python - <<'PYCODE'
import operator
from typing import Annotated, TypedDict
from langgraph.graph import StateGraph, START, END

State = TypedDict("State", {"results": Annotated[list[str], operator.add]})
builder = StateGraph(State)
builder.add_node("left", lambda state: {"results": ["left"]})
builder.add_node("right", lambda state: {"results": ["right"]})
for name in ("left", "right"):
    builder.add_edge(START, name)
    builder.add_edge(name, END)
result = builder.compile().invoke({"results": []})
assert sorted(result["results"]) == ["left", "right"]
PYCODE

Do not return the accumulated list from both branches with an append reducer; that duplicates prior values. Do not concatenate scalar status fields to silence an exception, mutate shared state, or depend on parallel arrival order.

InvalidUpdateError from a node return

Exact guide example: InvalidUpdateError: Expected dict, got ['whoops']. This is INVALID_GRAPH_NODE_RETURN_VALUE. An ordinary dictionary-state node returned a list instead of an update mapping. Fix every return path. Official guide, checked 2026-10-20.

python - <<'PYCODE'
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
State = TypedDict("State", {"some_key": str})
builder = StateGraph(State)
builder.add_node("fixed", lambda state: {"some_key": "fixed"})
builder.add_edge(START, "fixed")
builder.add_edge("fixed", END)
assert builder.compile().invoke({"some_key": "old"})["some_key"] == "fixed"
PYCODE

Do not raise the recursion budget or add a reducer here. Check handled-error branches for strings, lists or implicit None. Control-flow APIs have separate return contracts.

OutputParserException

Verified template: Invalid json output: {text}, raised as OutputParserException by JsonOutputParser; {text} becomes the response. Official parser source, checked 2026-10-20. Other parsers have different messages.

The response failed the expected format; a legacy chain may create the parser internally. Inspect the response, supply format instructions and check a valid fixture before another model call:

python - <<'PYCODE'
from langchain_core.output_parsers import JsonOutputParser
parser = JsonOutputParser()
print(parser.get_format_instructions())
assert parser.parse('{"ok": true}') == {"ok": True}
PYCODE

Where supported, prefer schema-driven tool calling or native structured output; agents accept response_format with ToolStrategy or ProviderStrategy. Parsing guide and structured output guide, checked 2026-10-20.

Do not treat this as authentication failure, regex away arbitrary text, accept missing required fields, or blindly replay the whole workflow. A valid fixture tests parsing, not model compliance.

What to test

FailureRegression check
LoopTerminal path reaches END; a deliberate cycle stops at a finite budget
Parallel writesBoth new contributions survive exactly once, regardless of order
Bad returnAll normal return paths produce a valid update
ParsingValid, invalid and schema-incomplete responses; app rejects invalid output

Community evidence

Minki Jung / minki-j, #492, reports untyped state failing under parallel writes and annotated state avoiding the failure. Teh Kok How / khteh, #4231, reports repeated save_memory calls exhausting the budget. Historical reproductions, not proof an upgrade fixes them; checked 2026-10-20.

A prompt to give your agent

Your training data predates these APIs. Read the linked official guide and implementation for our exact error before editing; do not guess from its class. Inspect installed versions and the failing node. Reproduce without external side effects, distinguish loops, concurrent writes, bad returns and parsing, then propose the smallest fix. Explain what not to change and add a regression case. For historical wording, inspect source matching our installed release rather than assuming default-branch code matches it.

Limits

Checked 2026-10-20. No snippets, packages, graphs or model calls were run. All four requested strings were verified; Invalid update for channel is historical. Community evidence covers loops and concurrent writes; no independent parsing or bad-return success report was established. npm versions remain unverified. Live overlap and release-specific wording remain unconfirmed.

Started from a post by @LangChain team, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# GraphRecursionError, InvalidUpdateError: how do I fix them?
Summary: As of October 2026, fix termination for GraphRecursionError, state merge or return contracts for InvalidUpdateError, and output format for OutputParserException; historical channel wording needs a version check. Checked 2026-10-20.
Copy for agent
get the whatworks thread graphrecursionerror-invalidupdateerror-langchain-langgraph-fixes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread graphrecursionerror-invalidupdateerror-langchain-langgraph-fixes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks