LangGraphLangGraph 1.2 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
38 small wins to finish your pathNext lesson →

Parallel nodes: fan-out with edges

Two edges out of one node run both next nodes in the same step. That is fan-out: fixed parallel work, wired at build time.

Last updated: 27 Sep, 2026 · LangGraph 1.2

Some checks do not depend on each other, so running them one after another wastes time. Give a node two outgoing edges and both next nodes run together.

The fan-out edges

python
builder.add_edge(START, "check_a")   # both run
builder.add_edge(START, "check_b")   # in the same step
builder.add_edge("check_a", "join")  # both feed the next node
builder.add_edge("check_b", "join")  # which runs once, after both

The imports

Start with the imports. add is the reducer that will join the two parallel writes.

python
from operator import add
from typing_extensions import TypedDict, Annotated
from langgraph.graph import StateGraph, START, END

The state

Define the state. The notes key uses the add reducer, so when two nodes write it in the same step their lists are joined instead of one overwriting the other.

python
class State(TypedDict):
    notes: Annotated[list[str], add]   # add joins the two parallel writes into one list

The three nodes

Write three node functions. The two checks do not read each other's output, so they can run side by side. summarise runs after both.

python
def check_account(s): return {"notes": ["account ok"]}   # one independent check
def check_payment(s): return {"notes": ["payment ok"]}   # the other, no shared data
def summarise(s):     return {"notes": ["done"]}         # runs after both checks

Wiring the fan-out

Wire the graph. Two edges leave START, and each check has an edge into summarise.

python
b = StateGraph(State)
b.add_node("check_account", check_account)
b.add_node("check_payment", check_payment)
b.add_node("summarise", summarise)
b.add_edge(START, "check_account")   # both edges out of START
b.add_edge(START, "check_payment")   # fire in the same step
b.add_edge("check_account", "summarise")   # each check feeds summarise
b.add_edge("check_payment", "summarise")   # which waits for both
b.add_edge("summarise", END)
  • Both edges out of START fire, so check_account and check_payment run in the same step.
  • summarise has an edge from each check, so it waits for both and runs once, not twice.

Running the graph

Compile the graph and run it with an empty notes list, then print the result.

python
print(b.compile().invoke({"notes": []})["notes"])   # both checks, then the summary

Two checks in one step

The same pieces in one file, ready to run.

Example
from operator import add
from typing_extensions import TypedDict, Annotated
from langgraph.graph import StateGraph, START, END

class State(TypedDict):
    notes: Annotated[list[str], add]

def check_account(s): return {"notes": ["account ok"]}
def check_payment(s): return {"notes": ["payment ok"]}
def summarise(s):    return {"notes": ["done"]}

b = StateGraph(State)
b.add_node("check_account", check_account)
b.add_node("check_payment", check_payment)
b.add_node("summarise", summarise)
b.add_edge(START, "check_account")
b.add_edge(START, "check_payment")
b.add_edge("check_account", "summarise")
b.add_edge("check_payment", "summarise")
b.add_edge("summarise", END)

print(b.compile().invoke({"notes": []})["notes"])

How the parallel writes joined

  • Both edges out of START fire, so check_account and check_payment run in the same step.
  • summarise has an edge from each check, so it waits for both and runs once, not twice.
  • The two parallel writes need the add reducer on notes; without it both nodes try to set notes in the same step and collide.

Parallel edges vs Send

Parallel edgesSend
RunsA fixed set of different nodesThe same node, once per item
Count knownAt build timeOnly at run time
Use forDo A and B side by sideMap over a list

When to run steps side by side

  • Running independent checks or lookups at once, then combining them.
  • Fetching from two sources in parallel before an answer.
Watch out. Any key two parallel nodes both write needs a reducer, or LangGraph refuses the run: a key can take only one value per step without one.
Try it yourself
  • Add a third parallel check and confirm all three notes appear.
  • Remove the reducer on notes and read the error.

This is what real progress feels like.