
Failure Paths
Planning for the worst.
Failure Paths
In a happy path flow, A -> B -> C. In reality, nodes crash.
The Exception Edge
Wrap your node logic in try/except.
If specific error occurs, return a flag key in the state: {"error": "Timeout"}.
The Conditional Edge sees this key and routes to ErrorHandlingNode instead of SuccessNode.
This keeps the crash logic explicit in the graph, rather than hidden in a catch block deep in the code.