langchain-ai/langgraph · error

Accessing GraphOutput via `result[key]` is deprecated. Use `

Error message

Accessing GraphOutput via `result[key]` is deprecated. Use `result.value` to access the output value directly, or `result.interrupts` for interrupts.

What it means

Error "Accessing GraphOutput via `result[key]` is deprecated. Use `result.value` to access the output value directly, or `result.interrupts` for interrupts." thrown in langchain-ai/langgraph.

Source

Thrown at libs/langgraph/langgraph/types.py:384

```
"""


@dataclass(frozen=True)
class GraphOutput(Generic[OutputT]):
    """Typed container returned by `invoke()` / `ainvoke()` with `version="v2"`.

    Attributes:
        value: The final output of the graph (dict, Pydantic model, dataclass, etc.).
        interrupts: Any interrupts that occurred during execution.
    """

    value: OutputT
    interrupts: tuple[Interrupt, ...] = ()

    def __getitem__(self, key: str) -> Any:
        """Backward compat: `result['__interrupt__']` and dict-key access."""
        warn(
            "Accessing GraphOutput via `result[key]` is deprecated. "
            "Use `result.value` to access the output value directly, "
            "or `result.interrupts` for interrupts.",
            LangGraphDeprecatedSinceV11,
            stacklevel=2,
        )
        if key == _INTERRUPT_KEY:
            return self.interrupts
        if isinstance(self.value, dict):
            return self.value[key]
        try:
            return getattr(self.value, key)
        except AttributeError:
            raise KeyError(key)

    def __contains__(self, key: object) -> bool:
        warn(
            "Accessing GraphOutput via `key in result` is deprecated. "

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/langgraph/langgraph/types.py:384 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/bb95a3de8055a6dd. Report an issue: GitHub.