diff --git a/langgraph/graph/graph.py b/langgraph/graph/graph.py index b4ce617a8..14860dd9d 100644 --- a/langgraph/graph/graph.py +++ b/langgraph/graph/graph.py @@ -257,7 +257,10 @@ class CompiledGraph(Pregel): name, ) graph.add_edge(graph.nodes[start], graph.nodes[name]) - ends = branch.ends or {k: k for k in self.graph.nodes} + ends = branch.ends or { + **{k: k for k in self.graph.nodes}, + END: END, + } for label, end in ends.items(): graph.add_edge(graph.nodes[name], graph.nodes[end], label) if self.graph.entry_point_branch: