Question: Why does LangGraph merge state from parallel branches instead of branch isolation? #5602
Unanswered
LakshmanKishore
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Besides filtering by node name on different branches, is there a more elegant native method? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I found this url defer node execution
I’m working with the LangGraph framework and have encountered some behavior with parallel branches that I wanted to clarify. When using branching in the state graph (for example, in a map-reduce or fan-out/fan-in scenario), I noticed that the state updates from parallel branches are merged together before being passed to downstream nodes. This means that a node in one branch can see updates made by nodes in other, parallel branches, even if they haven’t finished their own execution path.
For example, if I have branches B and C, and a node
b_2
followsb
, the state thatb_2
receives already contains updates from C. This is not the isolation I expected; I thought each branch would maintain its own state until a join or merge point.My questions:
Beta Was this translation helpful? Give feedback.
All reactions