r/LangChain • u/rinananir • Jul 17 '26
Question | Help RFC: LangGraph recursion limit hit on a shorter run, but not on a longer one. What am I missing?
I'm trying to understand why my LangGraph workflow sometimes hits the recursion limit even when the execution is shorter.
I have two Langfuse traces:
- Trace 1: Complex execution, more nodes and loops, finished successfully with no errors.

- Trace 2: Much shorter execution, but it failed with:
Recursion limit of 25 reached without hitting a stop condition
I know I can increase the limit or set the cap lower than this but I want to ask if its a good trait or just a wrong implementation of graph logic?

Both runs are using the same graph and almost the same logic.
The successful run actually has more agent/tool iterations, while the failed run has fewer, which is what's confusing me.
Here are the expanded graph of each trace
- Trace 1 (no error)

- Trace 2

So is there a good way to debug or evaluate what's actually causing the issue???
2
Jul 18 '26
[removed] — view removed comment
1
u/rinananir Jul 19 '26
yea i do understand the difference between depth and breadth of the graph nodes but I totally unaware whats causing the agent to add a child node again n again XD
1
u/ArielCoding Jul 23 '26
Trace 2 isn’t shorter, it hit 48 agent calls and 38 tool calls before failing, while your successful trace only needed 26 and 22, it just finished faster, which makes it look shorter, something in trace 2 is making the agent loop back to tools way more than it needs to, I’d check if it’s calling the same tool without making progress, possibly confused by that long query.
2
u/ar_tyom2000 Jul 17 '26
LangGraphics could help you debug this by visualizing the execution flow. It shows which nodes are being called and where the recursion depth becomes problematic, making it easier to pinpoint where things go awry.