langchain-ai/langgraph · error · ValueError
Invalid managed channels detected in
Error message
Invalid managed channels detected in {schema_name}: {names}. Managed channels are not permitted in Input/Output schema. What it means
Raised by StateGraph._add_schema when an Input or Output schema (allow_managed=False) contains keys bound to managed values. Managed values need graph-lifetime initialization and cannot be part of input/output schemas, which only map channels.
Solutions
- Move managed-value keys out of the input/output schema into the state schema
- Use Annotated plain channel keys in Input/Output schemas instead of managed ones
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/langgraph/langgraph/graph/state.py:350 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/05aa299928fcad14.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/graph/state.py:350
defaults.error_handler = error_handler
if timeout is not None:
defaults.timeout = coerce_timeout_policy(timeout)
return self
@property
def _all_edges(self) -> set[tuple[str, str]]:
return self.edges | {
(start, end) for starts, end in self.waiting_edges for start in starts
}
def _add_schema(self, schema: type[Any], /, allow_managed: bool = True) -> None:
if schema not in self.schemas:
_warn_invalid_state_schema(schema)
channels, managed, type_hints = _get_channels(schema)
if managed and not allow_managed:
names = ", ".join(managed)
schema_name = getattr(schema, "__name__", "")
raise ValueError(
f"Invalid managed channels detected in {schema_name}: {names}."
" Managed channels are not permitted in Input/Output schema."
)
self.schemas[schema] = {**channels, **managed}
for key, channel in channels.items():
if key in self.channels:
if self.channels[key] != channel:
if isinstance(channel, LastValue):
pass
else:
raise ValueError(
f"Channel '{key}' already exists with a different type"
)
else:
self.channels[key] = channel
for key, managed in managed.items():
if key in self.managed:
if self.managed[key] != managed:View on GitHub (pinned to 38031739e5)