Alpha Notice: These docs cover the v1-alpha release. Content is incomplete and subject to change.For the latest stable version, see the current LangGraph Python or LangGraph JavaScript docs.
StateGraph
received concurrent updates to its state from multiple nodes to a state property that doesn’t
support it.
One way this can occur is if you are using a fanout
or other parallel execution in your graph and you have defined a graph like this:
{ "some_key": "some_string_value" }
, this will overwrite the state value for "some_key"
with "some_string_value"
.
However, if multiple nodes in e.g. a fanout within a single step return values for "some_key"
, the graph will throw this error because
there is uncertainty around how to update the internal state.
To get around this, you can define a reducer that combines multiple values:
Troubleshooting
The following may help resolve this error:- If your graph executes nodes in parallel, make sure you have defined relevant state keys with a reducer.