Skip to content

Errors

GraphRecursionError

Bases: RecursionError

Raised when the graph has exhausted the maximum number of steps.

This prevents infinite loops. To increase the maximum number of steps, run your graph with a config specifying a higher recursion_limit.

Troubleshooting Guides:

Examples:

graph = builder.compile()
graph.invoke(
    {"messages": [("user", "Hello, world!")]},
    # The config is the second positional argument
    {"recursion_limit": 1000},
)
Source code in libs/langgraph/langgraph/errors.py
class GraphRecursionError(RecursionError):
    """Raised when the graph has exhausted the maximum number of steps.

    This prevents infinite loops. To increase the maximum number of steps,
    run your graph with a config specifying a higher `recursion_limit`.

    Troubleshooting Guides:

    - [GRAPH_RECURSION_LIMIT](https://python.langchain.com/docs/troubleshooting/errors/GRAPH_RECURSION_LIMIT)

    Examples:

        graph = builder.compile()
        graph.invoke(
            {"messages": [("user", "Hello, world!")]},
            # The config is the second positional argument
            {"recursion_limit": 1000},
        )
    """

    pass

InvalidUpdateError

Bases: Exception

Raised when attempting to update a channel with an invalid set of updates.

Troubleshooting Guides:

Source code in libs/langgraph/langgraph/errors.py
class InvalidUpdateError(Exception):
    """Raised when attempting to update a channel with an invalid set of updates.

    Troubleshooting Guides:

    - [INVALID_CONCURRENT_GRAPH_UPDATE](https://python.langchain.com/docs/troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE)
    - [INVALID_GRAPH_NODE_RETURN_VALUE](https://python.langchain.com/docs/troubleshooting/errors/INVALID_GRAPH_NODE_RETURN_VALUE)
    """

    pass

GraphInterrupt

Bases: GraphBubbleUp

Raised when a subgraph is interrupted, suppressed by the root graph. Never raised directly, or surfaced to the user.

Source code in libs/langgraph/langgraph/errors.py
class GraphInterrupt(GraphBubbleUp):
    """Raised when a subgraph is interrupted, suppressed by the root graph.
    Never raised directly, or surfaced to the user."""

    def __init__(self, interrupts: Sequence[Interrupt] = ()) -> None:
        super().__init__(interrupts)

NodeInterrupt

Bases: GraphInterrupt

Raised by a node to interrupt execution.

Source code in libs/langgraph/langgraph/errors.py
class NodeInterrupt(GraphInterrupt):
    """Raised by a node to interrupt execution."""

    def __init__(self, value: Any) -> None:
        super().__init__([Interrupt(value=value)])

GraphDelegate

Bases: GraphBubbleUp

Raised when a graph is delegated (for distributed mode).

Source code in libs/langgraph/langgraph/errors.py
class GraphDelegate(GraphBubbleUp):
    """Raised when a graph is delegated (for distributed mode)."""

    def __init__(self, *args: dict[str, Any]) -> None:
        super().__init__(*args)

EmptyInputError

Bases: Exception

Raised when graph receives an empty input.

Source code in libs/langgraph/langgraph/errors.py
class EmptyInputError(Exception):
    """Raised when graph receives an empty input."""

    pass

TaskNotFound

Bases: Exception

Raised when the executor is unable to find a task (for distributed mode).

Source code in libs/langgraph/langgraph/errors.py
class TaskNotFound(Exception):
    """Raised when the executor is unable to find a task (for distributed mode)."""

    pass

CheckpointNotLatest

Bases: Exception

Raised when the checkpoint is not the latest version (for distributed mode).

Source code in libs/langgraph/langgraph/errors.py
class CheckpointNotLatest(Exception):
    """Raised when the checkpoint is not the latest version (for distributed mode)."""

    pass

MultipleSubgraphsError

Bases: Exception

Raised when multiple subgraphs are called inside the same node.

Troubleshooting guides:

Source code in libs/langgraph/langgraph/errors.py
class MultipleSubgraphsError(Exception):
    """Raised when multiple subgraphs are called inside the same node.

    Troubleshooting guides:

    - [MULTIPLE_SUBGRAPHS](https://python.langchain.com/docs/troubleshooting/errors/MULTIPLE_SUBGRAPHS)
    """

    pass

Comments