## TL;DR

Trace one run step by step (or log node entries). Two distinct causes, different fixes: 1.

## Steps

1. Trace one run step by step (or log node entries). Ask: does this graph have a path to END in the number of steps you expect? Watch for a pair of nodes bouncing back and forth.

2. Two distinct causes, different fixes:

3. Infinite loop: a conditional edge whose condition never selects the exit, or literal `add_edge("a", "b")` + `add_edge("b", "a")` with no conditional exit.
2. Legitimately deep graph: many sequential steps, large fan-outs, long agent loops that really do need hundreds of steps.

4. - Loop: fix the condition so some path reaches END. This is the fix in most cases.
- Deep: raise it for that invocation:

```python
graph.invoke({...}, {"recursion_limit": 1000})
```

5. Re-run and confirm it terminates. If you raised the limit, also confirm the step count is sane; a graph that needs 900 steps to do a 10-step job has a logic problem, not a limit problem.

## When to use

You are seeing this: GRAPH_RECURSION_LIMIT: the StateGraph reached the maximum number of steps before hitting a stop condition. Use this skill when you run into "Diagnose: GraphRecursionError / GRAPH_RECURSION_LIMIT in a LangGraph run".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

Two distinct causes, different fixes: 1.
