https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> Suppose I have a function ...
# ❓・ai-evy-support
r
@AI Evy Suppose I have a function that checks order status and returns things like shipping address and email. Suppose that we have multiple customers that we want to verify that we have the right customer's info pulled up. How can we implement and check the shipping address or email returned in the phone call after we ask for the customer to confirm their shipping address or email?
a
Thanks for tagging me @rajat20151. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, you can implement customer verification by using custom tools and conversation flow logic in Retell AI. When defining a custom tool, you can specify parameters in the JSON schema that the LLM will extract from the conversation [(1) ]() . For your order status function, you can define parameters like
customer_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:
Copy code
json
{
  "email": "customer@example.com",
  "shipping_address": "123 Main St"
}
You can instruct the agent: "If the returned email matches what the customer provided, proceed with the order inquiry. If not, ask the customer to verify their information" . For email verification specifically, you can implement a confirmation process where the agent repeats the email back and spells it out for accuracy [(2) ]() . This helps ensure correct capture before making the API call. The key is structuring your prompts and tool descriptions to handle the comparison logic between the API response and customer-provided information, then using conditional transitions based on whether the verification succeeds or fails.
​ To learn more, see the sources I considered: [[1] How to pass in variables in the General Tool / State Tool function calls?](https://discord.com/channels/1186424376300679209/1229563946378203188) [[2] Discord message from @miku_42 on 2024-12-18](https://discord.com/channels/1186424376300679209/1186462578310910112/1319012969727660053) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy How do I do that with the conversation flow instead of the single prompt one? For example, do I use a function, logic split node, etc? How would I set that up?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer For conversation flow implementation, you'll use a combination of Function Nodes and Logic Split Nodes to handle customer verification. Here's the setup structure: Step 1: Create a Function Node for Order Lookup First, create a Custom Function node that calls your order status API [(1) ]() . When defining the function parameters, you can specify parameters like customer email or phone number that the LLM will extract from the conversation . Step 2: Use Response Variables After your function returns the order information, extract values from the API response and save them as dynamic variables for use later in the conversation . For example, if your API returns:
Copy code
json
{
  "email": "customer@example.com",
  "shipping_address": "123 Main St"
}
You can set response variables to capture these values as
{{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 .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[3] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[4] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy We already have a function called check order status that has things like shipping address and all that. Do we need to create another function or what
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer No, you don't need to create another function. You can reuse your existing "check order status" function within your conversation flow. Here's how to set it up with your existing function: Step 1: Use Your Existing Function in a Function Node Add your existing "check order status" custom function to a Function Node in your conversation flow [(1) ]() . The function will return the shipping address and other customer details as it already does. Step 2: Extract Response Data as Dynamic Variables After your function executes, extract values from the API response and save them as dynamic variables for use later in the conversation . For example, you can extract the returned shipping address as
{{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.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy So how should we set this up, explain in the simplest terms for me to set it up: - User gives first and last name. - We check first and last name. If we find a match, we ask the user to confirm shipping address or email. - If it matches, disclose order information. - If it does not match, double check and repeat the spelling of everything back to the customer. - If still no match, transfer to an agent.
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer Here's the simplest setup for your customer verification flow: Node 1: Conversation Node - Collect Name [(1) ]() - Set instruction to collect first and last name from the user - Use a Conversation Node where the agent can have a multi-turn conversation to gather this information Node 2: Function Node - Check Order Status [(2) ]() - Use your existing "check order status" custom function - Configure it to accept the customer's first and last name as parameters - Set up response variables to extract the returned shipping address and email as dynamic variables like
{{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) ](
0679209/1358825261986087126) 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) [(5) ]() - Configure transfer to a human agent - Set up either cold transfer or warm transfer based on your needs Important Note: Some users have reported issues with Logic Split Nodes not properly evaluating custom variables and defaulting to the "Else" path [(4) ]() . As a workaround, you may need to have the agent explicitly state the information before the Logic Split Node processes it .
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[4] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) [[5] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy In simple terms, how do I configure the check order status node to accept the custom'ers first and last name as parameters?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer To configure your check order status function to accept first and last name as parameters, you need to define the parameters in JSON schema format [(1) ]() . Here's how to set it up: Step 1: Define Parameters in JSON Schema In your custom function configuration, add parameters using this format :
Copy code
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"
  ]
}
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 .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy So how should we set this up, explain in the simplest terms for me to set it up, including which node: - Note: We have a check_order_status function that pulls the information from our API based on order number or name, we are trying to make it so that we double check that the order we pulled up is for the right person based on their shipping address and email, otherwise we find the other orders. If we need to add a new function ora djust this function, call it check_order_Status_2. User indicates they can't find their order number and wants to provide first and last name. User gives first and last name. We check first and last name. If we find a match, we ask the user to confirm shipping address or email. If it matches, disclose order information. If it does not match, double check and repeat the spelling of everything back to the customer. If still no match, transfer to an agent.
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer Here's the simplest setup for your customer verification flow: Node 1: Conversation Node - Collect Name [(1) ]() - Set instruction to ask for first and last name when customer can't find order number - Use a Conversation Node where the agent can have a multi-turn conversation to gather this information Node 2: Function Node - Check Order by Name [(2) ]() - Create a new custom function called
check_order_status_2
that searches by first and last name - Configure parameters using JSON schema format :
Copy code
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"
  ]
}
- Set response variables to extract shipping address and email as
{{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) ](
etellai.com/build/conversation-flow/call-transfer-node) - Configure transfer to a human agent - Choose between cold transfer or warm transfer based on your needs Key Setup Notes: - When a custom function is called, Retell sends a request to your specified URL with the function name and parameters [(2) ]() - You can extract values from the API response and save them as dynamic variables for use later in the conversation - Transition conditions can be either prompt-based or equation-based [(4) ]()
​ To learn more, see the sources I considered: [[1] Conversation Node](https://docs.retellai.com/build/conversation-flow/conversation-node) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[4] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) [[5] HELP: Dynamic Variables and the NEW Logic Split Node](https://discord.com/channels/1186424376300679209/1359881066168582194) [[6] Call Transfer Node](https://docs.retellai.com/build/conversation-flow/call-transfer-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy Can you clarify what you mean by this in simple terms: : 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)
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer In simple terms, there's a current limitation with Logic Split Nodes in Retell AI when using dynamic variables (like
{{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 transitions
(which would fix this issue) are currently under development [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[2] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) [[3] HELP: Dynamic Variables and the NEW Logic Split Node](https://discord.com/channels/1186424376300679209/1359881066168582194) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy Equation based transitions are implemented already.
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer You're correct! Equation-based transitions are now implemented in Retell AI. Based on the official documentation, there are two types of transition conditions [(1) ]() : - **Prompt**: The condition is a prompt that is evaluated by the LLM - **Equation**: The condition is a mathematical equation that is hardcoded For your customer verification flow, you can now use equation conditions with dynamic variables. Here are examples of equation conditions you can use :
Copy code
- {{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 .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy So returned shipping address and customer confirmed address would be coming from a new function that we would make, that we would need a new endpoitn and all of that for?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer No, you don't need a new endpoint for the customer confirmed address. Here's how the data flows: For `{{returned_shipping_address}}`: This comes from your existing
check_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:
Copy code
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.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] 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.
r
@AI Evy You mean the check order status function regular?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer Yes, you can use your existing
check_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 :
Copy code
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:
Copy code
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.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy What would the name of the dynamic variable be and the path to the value?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer The dynamic variable name and path depend on how you structure your API response and configure the response variables in your Function Node. For dynamic variables in Retell AI, you can use them in several ways: In API calls: You can pass dynamic variables using the
retell_llm_dynamic_variables
parameter [(1) ]() [(2) ]() [(3) ]() [(4) ]() . For example:
Copy code
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) ]() :
Copy code
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:
Copy code
json
{
  "shipping_address": "123 Main St",
  "email": "customer@example.com"
}
Then your dynamic variable names would be
{{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) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy What is the best way to do it so it always checks with equations? the LLM returns email and shipping_address, but I have nothing in the response variables.
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer To use equation-based transitions with dynamic variables, you need to properly configure response variables in your Function Node to extract values from your API response [(1) ]() . Step 1: Configure Response Variables in Your Function Node In your custom function configuration, you need to set up 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 API response contains:
Copy code
json
{
  "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:
Copy code
- {{email}} != ""
- {{shipping_address}} != ""
- {{customer_confirmed_email}} == {{email}}
- {{customer_confirmed_address}} == {{shipping_address}}
Important Notes: - All equation conditions are evaluated first, then prompt conditions are evaluated - 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 - The comparison operators like ==, Contains, Not Contains, and Not Equal are string comparisons and do not require numerical input If Response Variables Aren't Working: Based on community feedback, there can be issues with response variables not being properly extracted [(3) ]() . Make sure your API response format matches exactly what you're trying to extract, and verify that the response variables are configured correctly in your Function Node settings.
​ To learn more, see the sources I considered: [[1] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) [[2] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[3] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy Do we need to define customer ocnfirmed email and customer confirmed address somewhere?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer Yes, you need to define
{{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) ]() :
Copy code
- {{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) ]() .
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[3] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[4] Populating dynamic variables (caller details) based on the entity provided by the user (inbound)](https://discord.com/channels/1186424376300679209/1257709468251066439) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy What should the transition condiition be in the extract dynamic variable node?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer For the Extract Dynamic Variable Node transition condition, you have a few options based on your specific needs: Option 1: Check if Variables Were Successfully Extracted Use an equation condition to verify the variables were populated [(1) ]() :
Copy code
{{customer_confirmed_email}} != ""
or
Copy code
{{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) ]() :
Copy code
{{company_name}} = EllieGrid
(where this would always evaluate to true for your specific use case) Important Considerations: - All equation conditions are evaluated first, then prompt conditions [(1) ]() - 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 - The Extract Dynamic Variable Node is not intended for having a conversation with the user [(3) ]() Community Note: Some users have reported that Extract Dynamic Variable Nodes sometimes transition before actually extracting the variable [(2) ]() . If you experience this issue, you might need to use a more reliable transition condition or ensure the extraction completes before transitioning.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] extract variable node transition](https://discord.com/channels/1186424376300679209/1393706083108786357) [[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.
r
@AI Evy Right now I have it so that we have a conversation node saying: Thanks for waiting. Can you please clarify your rshipping address to make sure that I have the right order pulled up. THen I have an extract variables node with the varuable customer_confirmed_address The transitions are: customer_confirmed_address = "shipping_address" customer_confirmed_address does not equal "shipping address" Why is this not working?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer There are several issues with your current setup that explain why it's not working: Issue 1: Incorrect Variable Comparison Your transition conditions are comparing the extracted variable to the literal string "shipping_address" instead of the actual dynamic variable value [(1) ]() . You should be comparing:
Copy code
{{customer_confirmed_address}} == {{shipping_address}}
not:
Copy code
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:
Copy code
- {{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) ]() :
Copy code
{{customer_confirmed_address}} != ""
2. Consider the community workaround of using an always-true equation to prevent getting stuck [(2) ]() :
Copy code
{{company_name}} == "YourCompanyName"
3. Verify your variable extraction - The Extract Dynamic Variable Node is not intended for having a conversation with the user [(3) ]() . Make sure the customer actually provides their address in the previous Conversation Node before the extraction happens. Important Notes: - All equation conditions are evaluated first, then prompt conditions [(1) ]() - 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
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] extract variable node transition](https://discord.com/channels/1186424376300679209/1393706083108786357) [[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.
r
@AI Evy The extract variables node as the "" around {{shipping_address}} with no way to get rid of them. What am I doing wrong?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer The quotes around
{{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 :
Copy code
- {{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:
Copy code
{{customer_confirmed_address}} == {{shipping_address}}
However, there's an important limitation: 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 (such as information learned during the call) , you should use prompt conditions instead . Alternative approach: Instead of equation conditions, consider using prompt conditions for this comparison, such as: - "When the customer's confirmed address matches the shipping address on file" - "When the addresses match" Community insight: Based on user reports, there can be issues with Extract Variable Nodes where they sometimes transition before actually extracting the variable [(2) ]() . One workaround mentioned was using an always-true equation condition to prevent getting stuck . The string comparison operators (==, Contains, Not Contains, and Not Equal) do not require numerical input, while other comparison operators require numerical input and will always evaluate to false if the input is not a number [(1) ]() .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] extract variable node transition](https://discord.com/channels/1186424376300679209/1393706083108786357) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy We get the shipping_address from the check order status function.
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer You're correct - if you're getting
shipping_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:
Copy code
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:
Copy code
{{customer_confirmed_address}} == {{shipping_address}}
Important Notes: - You can only use variables that are passed in as dynamic variables for equation conditions - If the response variables aren't configured correctly in your Function Node, the
{{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.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy In the simplest way, describe how this will work?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer Here's how your customer verification flow will work in the simplest terms: Step 1: Function Node Your
check_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) ]() :
Copy code
{{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.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[3] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy Sometimes the shipping address is correct just as the customer provided but it still doesn't match via equation. Is there a way to fix this?
a
Thanks for the follow-up, @rajat20151. I'll get back to you soon.
### Answer ### Answer This is a common issue with exact string matching in equation conditions. Here are several solutions to fix address matching problems: Solution 1: Use Prompt Conditions Instead of Equations Since equation conditions require exact string matches, consider using prompt-based transition conditions instead [(1) ]() . Examples: - "When the customer's confirmed address matches the shipping address on file" - "When the addresses are substantially the same" - "When the customer confirms the correct address" Solution 2: Use String Comparison Operators The documentation shows that string comparison operators like CONTAINS can be more flexible :
Copy code
"{{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 :
Copy code
{{customer_confirmed_address}} == {{shipping_address}}
"{{shipping_address}}" CONTAINS {{customer_confirmed_address}}
{{customer_confirmed_address}} != {{shipping_address}}
Important Notes: - All equation conditions are evaluated first, then prompt conditions - 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 Community Insight: Based on user reports, there can be issues with dynamic variables not being properly recognized, but this can sometimes be resolved by using the correct format in webhook responses [(2) ]() . The most reliable approach is often using prompt conditions for fuzzy matching rather than exact equation comparisons, especially for user-provided data like addresses.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.