langchain-ai/langgraph · error · InvalidUpdateError
Cannot send a packet to the END node
Error message
Cannot send a packet to the END node
What it means
Error "Cannot send a packet to the END node" thrown in langchain-ai/langgraph.
Source
Thrown at libs/langgraph/langgraph/graph/_branch.py:210
def _finish(
self,
writer: _Writer,
input: Any,
result: Any,
config: RunnableConfig,
) -> Runnable | Any:
if not isinstance(result, (list, tuple)):
result = [result]
if self.ends:
destinations: Sequence[Send | str] = [
r if isinstance(r, Send) else self.ends[r] for r in result
]
else:
destinations = cast(Sequence[Send | str], result)
if any(dest is None or dest == START for dest in destinations):
raise ValueError("Branch did not return a valid destination")
if any(p.node == END for p in destinations if isinstance(p, Send)):
raise InvalidUpdateError("Cannot send a packet to the END node")
entries = writer(destinations, False)
if not entries:
return input
else:
need_passthrough = False
for e in entries:
if isinstance(e, ChannelWriteEntry):
if e.value is PASSTHROUGH:
need_passthrough = True
break
if need_passthrough:
return ChannelWrite(entries)
else:
ChannelWrite.do_write(config, entries)
return input
View on GitHub (pinned to 38031739e5)
When it happens
Trigger: Thrown at libs/langgraph/langgraph/graph/_branch.py:210 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/9f6f870adcccad7e.
Report an issue: GitHub.