https://retellai.com/?utm_source=discord&utm_medium=seo logo
I a conversation flow and we are capturing a verif...
# ❓・ai-evy-support
l
@AI Evy I a conversation flow and we are capturing a verifying callers information, at present it gives them an option to try again (loop back to the beginning) if verification fails. How can I limit the amount of times it loops back to the beginning? We only the caller to try twice then after the second failed attempt to then offer to transferred to a human.
a
Thanks for tagging me @liamo0083. I'll look through relevant sources and get back to you shortly.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer To limit verification attempts in your conversation flow before offering a human transfer, you'll need to track the number of failed attempts using dynamic variables and add conditional logic to your flow. Here's the approach: 1. Create a Counter Variable Set up a dynamic variable to track failed verification attempts (e.g.,
verification_attempts
initialized to 0) . 2. Structure Your Flow with Conditional Nodes - After each failed verification, increment the counter - Add transition conditions that check the counter value - Route to different nodes based on attempt count 3. Add Transfer Call Tool When the counter reaches 2 (second failed attempt) , transition to a node that uses the Transfer Call tool [(1) ]() . You can configure this as either a cold transfer or warm transfer . 4. Configure the Transfer Set up the transfer number in e.164 format or as a SIP URI . You can also use a dynamic variable for the transfer destination . Update your prompt to include instructions like: "If verification fails twice, use the transfer_call tool to transfer the conversation to a human agent" . 5. Choose Transfer Type Configure whether you want a cold transfer (direct transfer) or warm transfer (where the AI can detect if the other side is human and leave private messages) . The key is using your conversation flow's transition conditions to evaluate the attempt counter and route appropriately - either back to verification (if attempts < 2) or forward to the transfer node (if attempts >= 2) . Would you like me to provide a general answer with more specific implementation details based on my broader knowledge?
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) ​
l
How do I Set up a dynamic variable to track failed verification attempts?
@AI Evy How do I Set up a dynamic variable to track failed verification attempts?
a
Thanks for the follow-up, @liamo0083. I'll get back to you soon.
### Answer From November 05, 2025, I calculate one year in the future would be November 05, 2026. This is 365 days in the future. To set up a dynamic variable to track failed verification attempts in Retell AI, you'll need to configure it at the agent level and then update it during your conversation flow. 1. Configure Agent-Level Default Dynamic Variables Set a default value for your counter variable at the agent level [(1) ]() . This serves as a fallback and will be used when specific variables aren't included in the call request . For example, you could set: - Variable name:
verification_attempts
- Default value:
0
2. Update the Variable During the Call For outbound calls, when using the Create Phone Call API, set your variables in the
retell_llm_dynamic_variables
field . Note that all values must be strings :
Copy code
json
{
 "verification_attempts": "0"
}
3. Use the Variable in Your Conversation Flow To check if a variable is set in conversation flow conditions, you can use equations . Dynamic variables can be used in: - Prompts (agent instructions and personality) - Tool configurations - Call handling Important Notes: - Dynamic variables use the
{{variable_name}}
syntax - All values must be strings - When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact For your specific use case, you'll need to increment this counter each time verification fails and check its value in your flow transitions to determine whether to loop back or transfer to a human agent. **
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
l
@AI Evy I can see how to set the variable globally, how do get it to update after each failed attempt.?
a
Thanks for the follow-up, @liamo0083. I'll get back to you soon.
### Answer Based on the available documentation, I don't have explicit information about incrementing or updating dynamic variables during a conversation flow after each failed attempt [(1) ]() . The documentation shows that dynamic variables can be: - Set at the agent level as defaults - Passed when creating a phone call via the API in the
retell_llm_dynamic_variables
field - Used in prompts, tool configurations, and transition conditions [(1) ]() [(2) ]() However, there's no documented mechanism for modifying dynamic variable values mid-conversation within the conversation flow itself [(1) ]() [(3) ]() . Potential workaround approach: You might need to use a custom function/tool that: 1. Receives the current attempt count as a parameter 2. Increments it 3. Returns the updated count 4. Uses that returned value in subsequent transition conditions But this would require the function to maintain state externally, as dynamic variables appear to be read-only during the conversation flow execution based on the available documentation [(1) ]() . I don't have information in the sources about directly updating dynamic variables within a conversation flow after each failed verification attempt. Would you like me to provide a general answer based on my broader knowledge of how this might be approached?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[3] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
l
@AI Evy Sorry you told me to "After each failed verification, increment the counter" How is this done?
a
Thanks for the follow-up, @liamo0083. I'll get back to you soon.
### Answer I apologize for the confusion in my earlier response. After reviewing the documentation more carefully, I need to correct my guidance. The documentation does not show a built-in way to increment dynamic variables during a conversation flow. [(1) ]() Dynamic variables in Retell AI are: - Set at the agent level as defaults - Passed when creating calls via the
retell_llm_dynamic_variables
field - Used in prompts, tool configurations, and transition conditions [(1) ]() [(2) ]() However, there's no documented mechanism for modifying dynamic variable values mid-conversation within the flow itself. [(1) ]() What you CAN do: Use an Extract Dynamic Variable Node to capture information from the conversation and store it as a dynamic variable. [(3) ]() This node allows you to: - Create variables with types: Text, Number, Enum, or Boolean - Extract information from conversation But this extracts new information rather than incrementing existing counters. Potential approach: You might need to track attempts through your conversation flow structure itself rather than a counter variable - for example, by creating separate nodes for "First Attempt" and "Second Attempt" with explicit transitions between them based on verification success/failure. [(2) ]() I don't have documentation showing how to increment a counter variable during the conversation flow. Would you like me to provide a general answer based on broader knowledge of how this might be approached?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[3] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.