langchain-ai/langgraph · error · ValueError

Key not in channels

Error message

Key {chan} not in channels

What it means

Raised by validate_keys when a channel key requested (e.g. as stream/output keys) is not present in the graph's known channel set. The requested key does not correspond to any declared state channel, usually due to a typo. Use a key defined in the state schema.

Solutions

  1. Filter the key list to keys declared in the state schema
  2. Correct or remove the unknown key name
  3. Add the missing key to the graph schema
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/langgraph/langgraph/pregel/_validate.py:120 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/f18b4992f4e22b90. Report an issue: GitHub.

Appendix: source

Thrown at libs/langgraph/langgraph/pregel/_validate.py:120

            if n not in nodes:
                raise ValueError(f"Node {n} not in nodes")
    if interrupt_before_nodes != "*":
        for n in interrupt_before_nodes:
            if n not in nodes:
                raise ValueError(f"Node {n} not in nodes")


def validate_keys(
    keys: str | Sequence[str] | None,
    channels: Mapping[str, Any],
) -> None:
    if isinstance(keys, str):
        if keys not in channels:
            raise ValueError(f"Key {keys} not in channels")
    elif keys is not None:
        for chan in keys:
            if chan not in channels:
                raise ValueError(f"Key {chan} not in channels")

View on GitHub (pinned to 38031739e5)