I have a (super)graph, where one node in that graph calls a (sub)graph.
I want to pick the right recursion_limit, but it’s not clear to me how recursion_limit works.
Here are some assumptions I’ve made that may or may not be correct - I’d love to get some clarity on the following statements:
- Edges and conditional edges do not count towards the recursion limit - only nodes
- For a supergraph that calls a subgraph as a node, only the recursion_limit configured on the supergraph is checked during graph invocation
- recursion_limit counts the combined number of supersteps hit across both the supergraph AND the subgraph
- For a supergraph START → A → B → C → END, where B is a subgraph that calls START → D → E → F → END, by the time the supergraph ends, a total of 6 supersteps have been counted: A, B, D, E, F, C
- START and END nodes do not count towards the recursion_limit
- All nodes called in parallel count as one single superstep
- A graph START → A → B, A → C, B → D, C → D, D → END has 3 supersteps
- Nodes called in series each count as their own distinct superstep
- A GraphRecursionError fires after recursion_limit total supersteps have run without reaching the END node of the supergraph.
- Setting {“defer”: True } on a node should not impact the number of supersteps counted.
Thanks for your help!