Error Codes
Enum
Enumeration of error codes for common LangGraph errors.Each error code corresponds to a specific type of failure and links to detailed troubleshooting documentation.Defined in:
langgraph/errors.py:29Values
ErrorCode
Graph has exhausted the maximum number of steps.Troubleshooting: GRAPH_RECURSION_LIMIT
ErrorCode
Multiple nodes attempted to update the same channel concurrently with incompatible values.Troubleshooting: INVALID_CONCURRENT_GRAPH_UPDATE
ErrorCode
A node returned an invalid value that cannot be processed by the graph.Troubleshooting: INVALID_GRAPH_NODE_RETURN_VALUE
ErrorCode
Multiple subgraphs are configured incorrectly.Troubleshooting: MULTIPLE_SUBGRAPHS
ErrorCode
Chat history is in an invalid format.Troubleshooting: INVALID_CHAT_HISTORY
Exception Types
GraphRecursionError
class
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
Defined in:
recursion_limit.Inherits from: RecursionErrorDefined in:
langgraph/errors.py:45When It Occurs
This error is raised when:- A graph executes more steps than allowed by
recursion_limit(default is 25) - There’s an infinite loop in your graph logic
- Your workflow is legitimately long but needs a higher limit
How to Fix
Best Practices
- Set appropriate limits: Choose a recursion limit based on your expected workflow length
- Add loop detection: Use state fields to track iteration counts
- Add exit conditions: Ensure conditional edges eventually lead to END
InvalidUpdateError
class
Raised when attempting to update a channel with an invalid set of updates.This typically occurs when:
Defined in:
- Multiple nodes try to write incompatible values to the same channel
- A node returns a value that doesn’t match the expected state schema
ExceptionDefined in:
langgraph/errors.py:68Common Causes
- Concurrent conflicting updates: Multiple parallel nodes updating the same non-reducible channel
- Invalid return values: Node returns wrong type or structure
- Multiple Overwrite values: Multiple
Overwriteobjects for the same channel
Examples and Solutions
Concurrent Updates
Invalid Return Values
GraphInterrupt
class
Raised when a subgraph is interrupted, suppressed by the root graph.This exception is never raised directly to the user - it’s an internal exception used by LangGraph to handle interrupts. Users should use the
Defined in:
interrupt() function instead.Inherits from: GraphBubbleUpDefined in:
langgraph/errors.py:84Usage
This is an internal exception. For human-in-the-loop workflows, useinterrupt():
NodeInterrupt (Deprecated)
class
Deprecated: Use
Defined in:
Deprecated in: v1.0
interrupt() instead.Raised by a node to interrupt execution.Inherits from: GraphInterruptDefined in:
langgraph/errors.py:96Deprecated in: v1.0
Migration
ParentCommand
class
Internal exception used to bubble up commands to parent graphs.This is an internal exception used by LangGraph’s command system. Users don’t need to handle or raise this exception directly.Inherits from:
Defined in:
GraphBubbleUpDefined in:
langgraph/errors.py:111EmptyInputError
class
Raised when graph receives an empty input.Inherits from:
Defined in:
ExceptionDefined in:
langgraph/errors.py:118When It Occurs
How to Handle
TaskNotFound
class
Raised when the executor is unable to find a task (for distributed mode).This error occurs in distributed execution mode when a task cannot be located or has been lost.Inherits from:
Defined in:
ExceptionDefined in:
langgraph/errors.py:124EmptyChannelError
class
Raised when attempting to read from a channel that has no value.This error is re-exported from
langgraph.checkpoint.base.Defined in: langgraph/errors.py:9When It Occurs
Error Handling Patterns
Pattern 1: Graceful Degradation
Pattern 2: Retry with Adjusted Config
Pattern 3: State Validation
Pattern 4: Logging and Monitoring
Utilities
create_error_message
function
Create a formatted error message with a link to troubleshooting documentation.Parameters:
message(str): The error messageerror_code(ErrorCode): The error code enum value
langgraph/errors.py:37