Our Architect flow uses a common module that retries invalid DTMF input by calling itself. After 3 retries, the platform throws a loop detection error and disconnects the caller.
We need 5 retries maximum. Is there a way to increase the loop detection threshold?
You cannot increase the threshold. The platform caps common module recursion at 5 levels.
Replace the recursive pattern with a Loop action and a counter variable:
Set retryCount = 0
Loop While retryCount < 5
Collect DTMF
If valid â Exit Loop
Else â retryCount = retryCount + 1
End Loop
If retryCount >= 5 â Transfer to agent
We built a reusable âSafeRetryâ utility module used across 30+ flows.
The module accepts maxRetries and currentAttempt as inputs. The PARENT flow manages the counter, completely avoiding recursion. Every new flow imports this module instead of building its own retry logic.
From a containment perspective, the number of retries directly affects self-service success.
Our data: 2 retries = 48% containment. 3 retries = 55%. 5 retries = 61%. But CSAT drops significantly after 3 retries. The sweet spot is 3 retries with a friendly âLet me connect you to an agentâ on the 4th attempt.
In CIC, custom handlers had no recursion limit. You could write infinite loops.
GCâs 5-level limit is actually a safety feature for a multi-tenant cloud platform. One customerâs infinite loop shouldnât consume shared resources. The constraint is reasonable, but the error message should be more descriptive.
Under healthcare regulations, disconnecting a patient caller due to loop detection is a reportable event.
The flow MUST provide a path to a live agent after maximum retries, never a disconnect. We audit every flow for disconnect blocks that could be reached via retry exhaustion.
Does loop detection apply across different flow types?
If an inbound call flow calls a common module, which calls an in-queue flow via transfer, which calls another common module - does the loop counter span all flow types or reset per flow?
The recursion counter tracks common module depth within a single flow execution. A transfer to a new flow (inbound, in-queue, or outbound) resets the counter. So an inbound flow with 4 levels of modules can transfer to an in-queue flow with another 4 levels without triggering detection.