Edges
An edge says what runs next. Use a normal edge when the route never changes.1
Tiny example
Section titled “Tiny example”builder.add_edge("read_invoice", "validate_total")builder.add_edge("validate_total", "save_result")The mental model is a railway track: once read_invoice finishes, the track leads to validate_total.
| Shape | Runtime behavior |
|---|---|
| One outgoing edge | Run one next node |
| Several outgoing edges | Run destination nodes in parallel in the next superstep |
Edge to END |
Stop that path |
Failure note
Section titled “Failure note”Do not add a static outgoing edge and also return a dynamic Command(goto=...) from the same node unless both paths should run. LangGraph can schedule both.
Related
Section titled “Related”Footnotes
Section titled “Footnotes”-
LangChain, Graph API overview. ↩