langchain-ai/langgraph · error · ValueError
Managed value ' ' already exists with a different type
Error message
Managed value '{key}' already exists with a different type What it means
Raised during schema analysis of a StateGraph when a key exists both as a regular channel and as a managed value with a conflicting type (the non-LastValue case). Two competing definitions of the same state key cannot be reconciled, so the schema is rejected. Remove the duplicate key or align its types across channels and managed values.
Solutions
- Use the same managed value type for the key in every schema
- Remove the duplicate managed declaration from one schema
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/langgraph/langgraph/graph/state.py:369 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/7d254958c485e842.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/graph/state.py:369
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:
raise ValueError(
f"Managed value '{key}' already exists with a different type"
)
else:
self.managed[key] = managed
@overload
def add_node(
self,
node: StateNode[NodeInputT, ContextT],
*,
defer: bool = False,
metadata: dict[str, Any] | None = None,
input_schema: None = None,
retry_policy: RetryPolicy | Sequence[RetryPolicy] | None = None,
cache_policy: CachePolicy | None = None,
error_handler: StateNode[Any, ContextT] | None = None,
destinations: dict[str, str] | tuple[str, ...] | None = None,
timeout: float | timedelta | TimeoutPolicy | None = None,View on GitHub (pinned to 38031739e5)