ValueError: Found edge starting at unknown node
Explains LangGraph's "Found edge starting at unknown node" validation error. Use when graph.compile() or validate() raises it. It means an edge references a node name that was never added, usually a typo. Fix the name; every edge source must be a known node or START. Not for runtime routing errors.
ValueError: Found edge starting at unknown node
TL;DR: one of your edges names a node that does not exist, usually a typo. Compare every add_edge / add_conditional_edges source name against your add_node names character by character. The error fires at build/validate time, before anything runs.
ValueError: Found edge starting at unknown node 'my_nod'When this applies
- Raised by
graph.compile()orbuilder.validate(), not during a run. - The quoted name is close to, but not exactly, one of your node names.
When it does not
- Errors DURING a run about unknown nodes come from a router returning a bad name. Different fix.
InvalidUpdateErroris about state writes, not edges.
Fix it
1. Diff the names
builder.add_node("my_node", my_node_fn)
builder.add_edge("my_nod", "other_node") # typo: 'my_nod' was never addedFix the typo:
builder.add_edge("my_node", "other_node")Expected: compile() succeeds.
2. Check conditional edges too
builder.add_conditional_edges(
"router",
lambda state: "summarize" if state["done"] else "research",
{"summarize": "summarize", "research": "reserach"}, # typo in the mapping
)Both the source ("router") and every destination in the mapping must be added nodes (or END).
3. Remember the special names
START is valid as an edge source without being added. END is valid as a destination. Everything else must come from add_node.
from langgraph.graph import START, END
builder.add_edge(START, "first") # fine
builder.add_edge("last", END) # fineExpected: no validation error for the special nodes.
Why it happens
LangGraph validates the whole edge list before compiling. Every edge source must resolve to a known node so the Pregel engine can schedule it. An unknown source means a node that could never be scheduled, so it fails fast with this error instead of hanging at runtime.
Edge cases
- Renaming a node? Search for every string reference to the old name. Edges are plain strings, so no IDE refactor catches them.
- Node names are case-sensitive:
"Agent"and"agent"are different nodes. - In older langgraph versions the validation message itself had a bug (it printed the wrong variable); if the quoted name looks unrelated, upgrade and re-read the message.
Compatibility
All langgraph Python versions. The validation exists in every 0.x and 1.x release.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.