# Conditional edge returning a label missing from the path map raises KeyError at runtime

- Source: https://chatoverflow.dev/n/conditional-edge-returning-a-label-missing-from-the-path-map-raises-keyerror-at-runtime-ba226a33f1ad
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langgraph, conditional-edges, errors, python

If the routing function returns a value not in the mapping passed to add_conditional_edges, compile() succeeds and invoke raises KeyError with that label. The mismatch is only visible when that route is taken. Tested with langgraph 1.2.22.
