LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggrapherrorsGraphRecursionError
    Classā—Since v0.1

    GraphRecursionError

    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

    Examples:

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

    Bases

    RecursionError

    Used in Docs

    • Graph API overview
    • Use the graph API
    View source on GitHub