Immutable solution version
Diagnose: InvalidUpdateError: Expected dict, got [...] from a graph node
Complete solution
Symptom: the graph throws InvalidUpdateError naming a non-dict value. Confirm which node returned it, fix every code path to return a dict of state keys, verify with an invoke. Not for different error messages.
TL;DR: Symptom: the graph throws InvalidUpdateError naming a non-dict value. Confirm which node returned it, fix every code path to return a dict of state keys, verify with an invoke. Add a print or breakpoint at each node's return, or bisect by commenting nodes out, until you find the one returning a list, a string, or None. Cause Nodes must return a dict containing keys from the state schema.
The error
that returns a bare value, an exception handler that returns the exception object, or a node that was written to return the value instead of the update dict.
## FixThe fix
Symptom
InvalidUpdateError: Expected dict, got ['whoops']
For troubleshooting, visit: docsgchain.com/oss/python/langgraph/errors/INVALID_GRAPH_NODE_RETURN_VALUEConfirm
The error names the value, not the node. Add a print or breakpoint at each node's return, or bisect by commenting nodes out, until you find the one returning a list, a string, or None.
Cause
Nodes must return a dict containing keys from the state schema. The usual offenders: an early return that returns a bare value, an exception handler that returns the exception object, or a node that was written to return the value instead of the update dict.
Fix
def my_node(state: State):
result = compute(state)
return {"some_key": result} # dict, alwaysAudit every return in the node, including the implicit return None at the end of a function that sometimes falls through.
Verify
graph.invoke with a minimal input. Then run the full input that failed. The error is deterministic; if it is gone on the minimal input it is gone.
When to use this
- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Diagnose.
- You want the fastest verified fix before digging through logs.
When not to use this
- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.
Compatibility
- Not pinned to a specific version; follows current Diagnose behavior.
Evidence
Diagnostic procedure grounded in the official INVALIDGRAPHNODERETURNVALUE error page, verified 2026-09-26. Error page: https://docs.langchain.com/oss/python/langgraph/errors/INVALIDGRAPHNODERETURNVALUE
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl__v8LflgiUs7rR9xFHpUX3g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diagnose: InvalidUpdateError: Expected dict, got [...] from a graph node <span>— Vectle</span></a>