Skip to main content

Parallel Tool Calling: Run Multiple Nodes Concurrently

Execute multiple nodes in parallel using fan-out transitions or by returning a list of Route actions.

Fan-Out from a Node

Return multiple Route objects to run nodes concurrently:

async def gather_info(state, ctx):
return [Route("get_weather"), Route("get_horoscope")]

All routes run in parallel. Their prompts are concatenated, and the graph returns to the common next node after all branches complete.

Fan-Out from START

Define multiple transitions from START to run nodes in parallel at the beginning:

graph.add_transition(START, "greet_personal")
graph.add_transition(START, "fun_fact")
graph.add_transition(START, "daily_tip")

All three nodes execute concurrently when the graph starts.

Got a Question? Ask us on discord