langchain-ai/langgraph · error · ValueError
Cannot subscribe to channels when subscribed to a single…
Error message
Cannot subscribe to channels when subscribed to a single channel
What it means
Raised by subscribe_to when the builder was previously configured with subscribe_only (single-channel mode). The builder's channel state is a single string in that case and cannot be extended to a multi-channel list. Pick either single- or multi-channel subscription for the node.
Solutions
- Avoid subscribe_only() if you intend to subscribe to multiple channels
- Reset and rebuild the node's subscriptions consistently
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/langgraph/langgraph/pregel/main.py:277 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/e3ce6808746f24b5.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/pregel/main.py:277
self,
*channels: str,
read: bool = True,
) -> Self:
"""Add channels to subscribe to.
Node will be invoked when any of these channels are updated, with a dict of the
channel values as input.
Args:
channels: Channel name(s) to subscribe to
read: If `True`, the channels will be included in the input to the node.
Otherwise, they will trigger the node without being sent in input.
Returns:
Self for chaining
"""
if isinstance(self._channels, str):
raise ValueError(
"Cannot subscribe to channels when subscribed to a single channel"
)
if read:
if not self._channels:
self._channels = list(channels)
else:
self._channels.extend(channels)
if isinstance(channels, str):
self._triggers.append(channels)
else:
self._triggers.extend(channels)
return self
def read_from(
self,
*channels: str,View on GitHub (pinned to 38031739e5)