Skip to content

Edges

An edge says what runs next. Use a normal edge when the route never changes.1

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

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.

  1. LangChain, Graph API overview.