rajat20151
07/28/2025, 6:59 PMAI Evy
07/28/2025, 6:59 PMAI Evy
07/28/2025, 6:59 PMcustomer_email or shipping_address that the agent will collect from the customer.
After your function returns the order information, you can use conversation flow logic to verify the details. In your tool description and prompt, you can instruct the agent to compare the returned information with what the customer provides . For example, you could structure it like: "Use the email mentioned by the customer and call the order_status function with that, then verify the returned shipping address matches what the customer confirms" .
For handling the returned data from your API call, you can analyze specific values in the response and use conditions to determine next steps . If your function returns something like:
json
{
"email": "customer@example.com",
"shipping_address": "123 Main St"
}AI Evy
07/28/2025, 6:59 PMAI Evy
07/28/2025, 6:59 PMAI Evy
07/28/2025, 6:59 PMrajat20151
07/29/2025, 1:46 AMAI Evy
07/29/2025, 1:46 AMAI Evy
07/29/2025, 1:46 AMjson
{
"email": "customer@example.com",
"shipping_address": "123 Main St"
}AI Evy
07/29/2025, 1:46 AM{{returned_email}} and {{returned_address}} .
Step 3: Add Logic Split Node for Verification
After the function node, add a Logic Split Node to branch the conversation based on verification conditions [(2) ]() . The Logic Split Node is used to branch out the conversation flow based on conditions, and when entering this node, the agent will immediately evaluate the conditions and branch out to the corresponding destination nodes .
You can add conditions in the Logic Split Node to compare the returned data with customer-provided information . There will always be an else condition, which will be the default destination if none of the conditions are met .
Step 4: Create Conversation Nodes for Each Path
Create separate Conversation Nodes for successful verification and failed verification scenarios [(3) ]() . In Conversation Nodes, the agent can have a multi-turn conversation, so you can handle the verification dialogue within each node .
Note on Dynamic Variables:
Based on community feedback, there may be some limitations with Logic Split Nodes and dynamic variables - some users have reported that Logic Split Nodes may not always properly evaluate custom variables and may default to the "Else" path [(4) ]() . As a workaround, you might need to have the agent explicitly voice the information before the Logic Split Node evaluates it .AI Evy
07/29/2025, 1:46 AMAI Evy
07/29/2025, 1:46 AMrajat20151
07/29/2025, 3:33 AMAI Evy
07/29/2025, 3:33 AMAI Evy
07/29/2025, 3:33 AM{{returned_shipping_address}} and email as {{returned_email}}.
Step 3: Create Verification Logic
After the function node, you can either:
- Use the agent in a Conversation Node to ask the customer to confirm their shipping address, then compare it verbally
- Set up additional logic to handle the verification process
The key is leveraging the response variables feature where you can extract values from your existing function's API response and reference them later using dynamic variables like {{user_name}} .
Your existing function is sufficient - you just need to structure the conversation flow to capture the returned data and use it for verification purposes.AI Evy
07/29/2025, 3:33 AMAI Evy
07/29/2025, 3:33 AMrajat20151
07/29/2025, 3:35 AMAI Evy
07/29/2025, 3:35 AMAI Evy
07/29/2025, 3:35 AM{{returned_shipping_address}} and {{returned_email}}
Node 3: Logic Split Node - Check if Match Found [(3) ]()
- Add conditions to check if your function found a customer match
- The Logic Split Node will immediately evaluate conditions and branch to corresponding destination nodes
- Set up an "else" condition as the default destination if no match is found
Node 4a: Conversation Node - Ask for Verification (if match found) [(1) ]()
- Ask customer to confirm their shipping address or email
- Compare what they say with the {{returned_shipping_address}} or {{returned_email}} variables
Node 5: Logic Split Node - Verify Match [(3) ]()
- Check if customer's confirmation matches the returned data
- Note: Based on community feedback, Logic Split Nodes may sometimes default to the "Else" path with custom variables, so you might need the agent to explicitly voice the information before evaluation [(4) ](AI Evy
07/29/2025, 3:35 AMAI Evy
07/29/2025, 3:35 AMAI Evy
07/29/2025, 3:35 AMrajat20151
07/29/2025, 5:59 AMAI Evy
07/29/2025, 5:59 AMAI Evy
07/29/2025, 5:59 AMjson
{
"type": "object",
"properties": {
"first_name": {
"type": "string",
"description": "The customer's first name"
},
"last_name": {
"type": "string",
"description": "The customer's last name"
}
},
"required": [
"first_name",
"last_name"
]
}
Step 2: Function Description
Add a clear description for your custom function that tells the LLM when and how to use it . For example:
- Name: check_order_status
- Description: Check order status based on customer's first and last name
The LLM will automatically extract the first and last name from the conversation based on your parameter descriptions and call your function with those arguments .
Important Note: When the custom function is called, Retell sends a request to your specified URL with the function name and parameters . Your endpoint will receive the arguments as a JSON object in the request body .AI Evy
07/29/2025, 5:59 AMAI Evy
07/29/2025, 5:59 AMrajat20151
07/29/2025, 6:02 AMAI Evy
07/29/2025, 6:02 AMAI Evy
07/29/2025, 6:02 AMcheck_order_status_2 that searches by first and last name
- Configure parameters using JSON schema format :
json
{
"type": "object",
"properties": {
"first_name": {
"type": "string",
"description": "The customer's first name"
},
"last_name": {
"type": "string",
"description": "The customer's last name"
}
},
"required": [
"first_name",
"last_name"
]
}AI Evy
07/29/2025, 6:02 AM{{returned_shipping_address}} and {{returned_email}}
Node 3: Logic Split Node - Check if Match Found [(3) ]()
- Add conditions to check if your function found a customer match
- The Logic Split Node will immediately evaluate conditions and branch to corresponding destination nodes
- Set up an "else" condition as the default destination if no match is found
Node 4: Conversation Node - Ask for Verification (if match found) [(1) ]()
- Ask customer to confirm their shipping address or email
- The agent can have a multi-turn conversation inside a single node
Node 5: Logic Split Node - Verify Address/Email Match [(3) ]()
- Check if customer's confirmation matches the returned data
- Important Note: Based on community feedback, Logic Split Nodes may not properly evaluate custom variables and may default to the "Else" path [(4) ]() [(5) ]() . You may need the agent to explicitly voice the information before the Logic Split Node evaluates it [(5) ]()
Node 6a: Conversation Node - Disclose Order Info (if verification succeeds) [(1) ]()
Node 6b: Conversation Node - Double Check Spelling (if verification fails)
- Have agent repeat spelling of customer information back to them
- Give customer chance to correct any mistakes
Node 7: Call Transfer Node - Transfer to Agent (if still no match) [(6) ](AI Evy
07/29/2025, 6:02 AMAI Evy
07/29/2025, 6:02 AMAI Evy
07/29/2025, 6:02 AMrajat20151
07/29/2025, 6:05 AMAI Evy
07/29/2025, 6:05 AMAI Evy
07/29/2025, 6:05 AM{{returned_shipping_address}}) .
The Problem:
Logic Split Nodes are designed to branch conversations based on conditions [(1) ]() . However, users have reported that when they try to use dynamic variables in these conditions, the Logic Split Node ignores the variable values and always takes the "Else" path [(2) ]() [(3) ]() .
What This Means for You:
- Even if your {{returned_shipping_address}} variable contains "123 Main St", the Logic Split Node might not recognize it
- The node will act as if the variable is empty and always go to the default "Else" destination [(2) ]()
- This happens because the Logic Split Node currently only works if the underlying condition was mentioned in past conversation [(3) ]()
The Workaround:
To make it work, you need to have the agent actually say the variable information out loud in a conversation before the Logic Split Node tries to evaluate it .
For example:
1. **Conversation Node**: Agent says "I see your shipping address is {{returned_shipping_address}}" (this makes the agent voice the variable)
2. **Logic Split Node**: Now it can properly evaluate conditions based on that information
Alternative Solution:
Instead of using Logic Split Nodes with dynamic variables, you can use regular Conversation Nodes with transition conditions that work more reliably with dynamic variables .
According to Retell staff, equation-based transitionsAI Evy
07/29/2025, 6:05 AMAI Evy
07/29/2025, 6:05 AMrajat20151
07/29/2025, 6:06 AMAI Evy
07/29/2025, 6:06 AMAI Evy
07/29/2025, 6:06 AM- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}
- {{user_age}} < 18 OR {{user_location}} == "New York"
This means for your order verification scenario, you can set up equation conditions in your Logic Split Node like:
- {{returned_shipping_address}} != "" (to check if address was found)
- {{customer_confirmed_address}} == {{returned_shipping_address}} (to verify match)
All equation conditions are evaluated first, then prompt conditions are evaluated . The equation conditions are evaluated from top to bottom, and the system transitions on the first condition that evaluates to true .
You can only use variables that are passed in as dynamic variables for equation conditions . If you need to use information extracted by the LLM during the call, you would still use prompt conditions .AI Evy
07/29/2025, 6:06 AMAI Evy
07/29/2025, 6:06 AMrajat20151
07/29/2025, 6:07 AMAI Evy
07/29/2025, 6:07 AMAI Evy
07/29/2025, 6:07 AMcheck_order_status_2 function's response. You can extract values from the API response and save them as dynamic variables for use later in the conversation [(1) ]() . For example, if your function returns:
json
{
"properties": {
"user": {
"name": "John Doe",
"age": 26
}
}
}
You would set up response variables in your Function Node to capture {{returned_shipping_address}} from your API response .
For `{{customer_confirmed_address}}`:
This would be captured by the LLM during the conversation in your Conversation Node when you ask the customer to confirm their address. You don't need a separate function for this - the agent will naturally extract this information from what the customer says and you can reference it as a dynamic variable [(2) ]() .
Dynamic variables are placeholders surrounded by double curly braces that allow you to inject data into various parts of the agents for specific calls . They can be used in prompts, begin messages, tool call descriptions, and other parts of your conversation flow .
So you only need:
1. Your existing check_order_status_2 function (one endpoint)
2. Response variables to capture the returned data
3. The conversation flow to naturally collect the customer's confirmation
The LLM will handle extracting the customer's spoken confirmation without needing an additional API call.AI Evy
07/29/2025, 6:07 AMAI Evy
07/29/2025, 6:07 AMrajat20151
07/29/2025, 6:08 AMAI Evy
07/29/2025, 6:09 AMAI Evy
07/29/2025, 6:09 AMcheck_order_status function. You don't need to create a new function called check_order_status_2.
Here's how to configure your existing function:
For your existing check_order_status function:
You can modify it to accept both order number OR first/last name as parameters [(1) ]() . In the parameter schema, you can define parameters using JSON schema format :
json
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city of the weather"
}
},
"required": [
"city"
]
}
You would adapt this structure for your use case with parameters like order_number, first_name, and last_name, making them optional so the function can work with either lookup method.
Response Variables:
You can extract values from the API response and save them as dynamic variables for use later in the conversation . For example, if your response body looks like:
json
{
"properties": {
"user": {
"name": "John Doe",
"age": 26
}
}
}
You can set up response variables to capture shipping address and email as {{returned_shipping_address}} and {{returned_email}} .
The same function can handle both scenarios - looking up by order number when available, or by name when the customer can't find their order number.AI Evy
07/29/2025, 6:09 AMAI Evy
07/29/2025, 6:09 AMrajat20151
07/29/2025, 6:11 AMAI Evy
07/29/2025, 6:11 AMAI Evy
07/29/2025, 6:11 AMretell_llm_dynamic_variables parameter [(1) ]() [(2) ]() [(3) ]() [(4) ]() . For example:
json
{
"customer_name": "John Doe"
}
[(1) ]() [(3) ]() [(4) ]()
In LLM configuration:
You can set default dynamic variables in your Retell LLM using the default_dynamic_variables parameter [(5) ]() :
json
{
"customer_name": "John Doe"
}
For your specific use case:
If your check_order_status function returns shipping address and email data, you would:
1. Configure the response variables in your Function Node to extract values from your API response
2. Name the dynamic variables something like:
- {{returned_shipping_address}}
- {{returned_email}}
- {{customer_confirmed_address}}
The exact path depends on your API response structure. If your function returns:
json
{
"shipping_address": "123 Main St",
"email": "customer@example.com"
}AI Evy
07/29/2025, 6:11 AM{{shipping_address}} and {{email}} with paths pointing directly to those fields.
Important note from the community: There have been reports of issues with dynamic variables not being properly recognized in API calls, but this can sometimes be resolved by using the correct format in your webhook response [(6) ]() .AI Evy
07/29/2025, 6:12 AMAI Evy
07/29/2025, 6:12 AMrajat20151
07/29/2025, 6:13 AMAI Evy
07/29/2025, 6:13 AMAI Evy
07/29/2025, 6:13 AMjson
{
"email": "customer@example.com",
"shipping_address": "123 Main St"
}
You would configure response variables to extract these values as {{email}} and {{shipping_address}}.
Step 2: Use Equation Conditions in Logic Split Node
Once you have the response variables properly configured, you can use equation-based transition conditions in your Logic Split Node [(2) ]() . Examples of equation conditions you can use:
- {{email}} != ""
- {{shipping_address}} != ""
- {{customer_confirmed_email}} == {{email}}
- {{customer_confirmed_address}} == {{shipping_address}}AI Evy
07/29/2025, 6:13 AMAI Evy
07/29/2025, 6:13 AMAI Evy
07/29/2025, 6:13 AMrajat20151
07/29/2025, 6:14 AMAI Evy
07/29/2025, 6:14 AMAI Evy
07/29/2025, 6:14 AM{{customer_confirmed_email}} and {{customer_confirmed_address}} as dynamic variables. You can do this using an Extract Dynamic Variable Node [(1) ]() .
Step 1: Add Extract Dynamic Variable Node
After your conversation node where the customer confirms their information, add an Extract Dynamic Variable Node . This node is used to extract information from conversation and store them as dynamic variables .
Step 2: Configure the Variables
To create variables in the Extract Dynamic Variable Node, fill in the following details :
- Variable Name – A short name to reference this variable
- Description – A brief explanation of what this value should be
- Variable Type – Choose from Text, Number, Enum, or Boolean
For your use case, you would create:
1. Variable Name: customer_confirmed_email
- Description: "The email address confirmed by the customer"
- Variable Type: Text
2. Variable Name: customer_confirmed_address
- Description: "The shipping address confirmed by the customer"
- Variable Type: Text
Step 3: Use in Equation Conditions
Once defined, you can use these variables in equation-based transition conditions [(2) ]() :
- {{customer_confirmed_email}} == {{email}}
- {{customer_confirmed_address}} == {{shipping_address}}
Alternative Approach:
You can also extract values from the API response and save them as dynamic variables for use later in the conversation [(3) ]() . The function result from your custom function can be used to populate dynamic variables directly [(4) ]() .AI Evy
07/29/2025, 6:14 AMAI Evy
07/29/2025, 6:14 AMrajat20151
07/29/2025, 6:17 AMAI Evy
07/29/2025, 6:17 AMAI Evy
07/29/2025, 6:17 AM{{customer_confirmed_email}} != ""
or
{{customer_confirmed_address}} != ""
Option 2: Use a Prompt-Based Condition
You can use a prompt condition like :
- "When the customer has confirmed their email and address"
- "When the user has provided both email and shipping address confirmation"
*Option 3: Always Transition (Community Workaround) *
Based on community feedback, some users set up an equation that's always true to ensure the node doesn't get stuck [(2) ]() :
{{company_name}} = EllieGridAI Evy
07/29/2025, 6:17 AMAI Evy
07/29/2025, 6:17 AMAI Evy
07/29/2025, 6:17 AMrajat20151
07/29/2025, 6:28 AMAI Evy
07/29/2025, 6:28 AMAI Evy
07/29/2025, 6:28 AM{{customer_confirmed_address}} == {{shipping_address}}
not:
customer_confirmed_address = "shipping_address"
Issue 2: Missing Dynamic Variable References
In equation conditions, you need to use the double curly brace syntax for dynamic variables . Your conditions should look like:
- {{customer_confirmed_address}} == {{shipping_address}}
- {{customer_confirmed_address}} != {{shipping_address}}
Issue 3: Common Extract Variable Node Problem
Based on community feedback, Extract Dynamic Variable Nodes sometimes transition before actually extracting the variable [(2) ]() . One user reported: "I have noticed that sometimes the extract variable node transitions to the next node before it has actually extracted the variable" .
Recommended Solutions:
1. Use a more reliable transition condition like checking if the variable was populated [(1) ]() :
{{customer_confirmed_address}} != ""
2. Consider the community workaround of using an always-true equation to prevent getting stuck [(2) ]() :
{{company_name}} == "YourCompanyName"AI Evy
07/29/2025, 6:28 AMAI Evy
07/29/2025, 6:28 AMAI Evy
07/29/2025, 6:28 AMrajat20151
07/29/2025, 6:34 AMAI Evy
07/29/2025, 6:34 AMAI Evy
07/29/2025, 6:35 AM{{shipping_address}} in the equation editor are likely appearing because you're trying to use a dynamic variable in a string comparison context. Based on the documentation, here's what you need to know about equation conditions [(1) ]() :
For equation conditions, you can use these comparison operators :
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}
- {{user_age}} < 18 OR {{user_location}} == "New York"
The key issue: When comparing two dynamic variables directly, you shouldn't need quotes around either variable . Your condition should be:
{{customer_confirmed_address}} == {{shipping_address}}AI Evy
07/29/2025, 6:35 AMAI Evy
07/29/2025, 6:35 AMAI Evy
07/29/2025, 6:35 AMrajat20151
07/29/2025, 6:36 AMAI Evy
07/29/2025, 6:36 AMAI Evy
07/29/2025, 6:36 AMshipping_address from your check_order_status function, you need to properly configure the response variables in your Function Node to make it available as a dynamic variable [(1) ]() [(2) ]() .
Step 1: Configure Response Variables in Your Function Node
In your custom function configuration, you need to set response variables to extract values from the API response and save them as dynamic variables for use later in the conversation .
For example, if your function response body looks like:
json
{
"properties": {
"user": {
"name": "John Doe",
"age": 26
}
}
}
You would configure response variables to extract shipping_address as {{shipping_address}}.
Step 2: Verify the Variable is Available
Once you've configured the response variables properly, {{shipping_address}} should be available as a dynamic variable for use in equation conditions [(1) ]() .
Step 3: Use in Equation Conditions
Your equation condition should then work as:
{{customer_confirmed_address}} == {{shipping_address}}AI Evy
07/29/2025, 6:36 AM{{shipping_address}} variable won't be available
- All these formats (string, buffer, JSON object, blob) will be converted to string before sending to LLM for further processing [(1) ]() [(2) ]()
- The function result is capped at 15000 characters to prevent overloading LLM context window
Make sure your Function Node has the response variables section properly configured to extract the shipping address from your API response.AI Evy
07/29/2025, 6:36 AMAI Evy
07/29/2025, 6:36 AMrajat20151
07/29/2025, 4:12 PMAI Evy
07/29/2025, 4:12 PMAI Evy
07/29/2025, 4:12 PMcheck_order_status function runs and returns customer data [(1) ]() . You configure response variables to extract values from the API response and save them as dynamic variables . This creates {{shipping_address}} and {{email}} variables.
Step 2: Conversation Node
Agent asks: "Can you please confirm your shipping address to verify I have the right order?" [(2) ]()
Step 3: Extract Dynamic Variable Node
This node extracts information from conversation and stores them as dynamic variables . You create a variable called customer_confirmed_address with variable type "Text" .
Step 4: Logic Split with Equation Conditions
You use equation conditions to compare the variables [(3) ]() :
{{customer_confirmed_address}} == {{shipping_address}}
{{customer_confirmed_address}} != {{shipping_address}}
Step 5: Different Paths
- If addresses match → Continue with order
- If addresses don't match → Ask for clarification or try different lookup
Key Points:
- All equation conditions are evaluated first, then prompt conditions
- You can only use variables that are passed in as dynamic variables for equation conditions
- Extract Dynamic Variable Node is not intended for having a conversation with the user [(2) ]()
The flow ensures you verify the customer's identity by comparing what they say against what your system has on file.AI Evy
07/29/2025, 4:12 PMAI Evy
07/29/2025, 4:12 PMrajat20151
07/29/2025, 5:07 PMAI Evy
07/29/2025, 5:07 PMAI Evy
07/29/2025, 5:07 PM"{{shipping_address}}" CONTAINS {{customer_confirmed_address}}
Solution 3: Normalize Data Before Comparison
Address matching often fails due to formatting differences (spaces, punctuation, abbreviations) . The string comparison operators (==, Contains, Not Contains, and Not Equal) are string comparisons and do not require numerical input .
Solution 4: Use Multiple Condition Paths
Set up multiple equation conditions to handle variations :
{{customer_confirmed_address}} == {{shipping_address}}
"{{shipping_address}}" CONTAINS {{customer_confirmed_address}}
{{customer_confirmed_address}} != {{shipping_address}}AI Evy
07/29/2025, 5:07 PMAI Evy
07/29/2025, 5:07 PMAI Evy
07/29/2025, 5:07 PM