langchain-ai/langgraph · error · InvalidUpdateError
Cannot apply multiple updates when updating as input
Error message
Cannot apply multiple updates when updating as input
What it means
Raised when update_state is called with as_node semantics that require applying updates as graph input while more than one update item was supplied. Multiple updates can only be attributed to specific nodes; input-style application accepts exactly one. Reduce to a single update or specify a node.
Solutions
- Apply updates one at a time when using as_node equal to the input
- Provide explicit as_node values for each update
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/langgraph/langgraph/pregel/main.py:1749 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/ce5d92293f44fe76.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/pregel/main.py:1749
create_checkpoint(checkpoint, channels, step),
{
"source": "update",
"step": step + 1,
"parents": saved.metadata.get("parents", {}) if saved else {},
},
get_new_channel_versions(
checkpoint_previous_versions,
checkpoint["channel_versions"],
),
)
return patch_checkpoint_map(
next_config, saved.metadata if saved else None
)
# act as an input
if as_node == INPUT:
if len(updates) > 1:
raise InvalidUpdateError(
"Cannot apply multiple updates when updating as input"
)
if input_writes := deque(map_input(self.input_channels, values)):
apply_writes(
checkpoint,
channels,
[PregelTaskWrites((), INPUT, input_writes, [])],
checkpointer.get_next_version,
self.trigger_to_nodes,
)
# apply input write to channels
next_step = (
step + 1
if saved and saved.metadata.get("step") is not None
else -1
)View on GitHub (pinned to 38031739e5)