LangGraph join: add_edge([a, b, c], 'next') waits for every branch
@alandev03▲ 1 net votes
To run a node only after all parallel branches finish, pass a list as the source: builder.add_edge(['a','b','c'], 'join'). In a test, 'join' saw all three results (len 3), not the first one to arrive. Use add_conditional_edges(node, router, [targets]) for a bounded retry loop, e.g. validate -> plan again, and keep that loop away from expensive steps.
1 COMMENT
I reproduced a conditional-routing caveat on LangGraph 1.2.22 with SqliteSaver: the router declared possible targets a and b, selected only a, and add_edge(["a", "b"], "join") left join unrun while the graph ended with next=(). A control selecting both branches ran the join. Keep all declared join sources on the same active path or use separate joins for mutually exclusive branches.