https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is there a way to explicitly set a dynamic variabl...
# ❓・ai-evy-support
c
@AI Evy Is there a way to explicitly set a dynamic variable during a conversation flow instead of having the LLM infer the value from the conversation?
a
Thanks for tagging me @cotton96473. I'll look through relevant sources and get back to you shortly.
### Answer Yes, Retell AI supports extracting and storing dynamic variables in real time during a conversation. [(1) ]() You can use the Extract Dynamic Variable node in Conversation Flow to explicitly capture and store variables mid-conversation. This feature allows your agent to automatically save information like names, emails, budgets, and preferences, and then reference that collected data anytime during the call. The variable types you can collect include: - Text (names, addresses, feedback) - Numbers (ages, quantities, prices) - Boolean (yes/no decisions, preferences) - Enum (predefined lists like services or products) This works in single, multi-prompt, and conversation flow agents. For more details on implementing this, check out the [Extract Dynamic Variable Node documentation]() .
​ To learn more, see the sources I considered: [[1] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy If I want to define the boolean variable "call_needed" to TRUE, how could I do that with an Extract Dynamic Variable node without requiring the LLM to infer its value?
a
Thanks for the follow-up, @cotton96473. I'll get back to you soon.
### Answer Based on the available sources, the Extract Dynamic Variable node is designed to extract information from the conversation and store it as a dynamic variable. [(1) ]() [(2) ]() The node's purpose is specifically to "extract information from conversation and store them as dynamic variable." [(1) ]() The Extract Dynamic Variable node requires the LLM to infer values from the conversation - that's its fundamental design. [(1) ]() [(2) ]() The sources don't describe a method to explicitly set a boolean variable to a hardcoded value like
TRUE
without LLM inference through this node type. For setting variables to explicit values without LLM inference, you would typically: - Use
retell_llm_dynamic_variables
when creating or updating a call to inject predefined values [(3) ]() [(4) ]() [(5) ]() - Pass variables through your backend/custom functions rather than extracting them from conversation If you need to set
call_needed
to
TRUE
based on reaching a specific point in your conversation flow (rather than extracting it from user speech) , you might need to handle this through your backend logic or custom function calls rather than the Extract Dynamic Variable node. **
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[3] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[4] Update Call](https://docs.retellai.com/api-references/update-call) [[5] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Can I use a custom function to define a variable that would be included in the call_analysis webhook response?
a
Thanks for the follow-up, @cotton96473. I'll get back to you soon.
### Answer ### Answer Yes, you can use custom functions to set variables that appear in the
call_analysis
webhook response. [(1) ]() When you configure a custom function, you can set response variables to extract values from the API response and save them as dynamic variables for use later in the conversation. These extracted values become part of the call's dynamic variables. The
call_analysis
object in webhook responses includes
custom_analysis_data
, which can contain custom variables. [(2) ]() While the sources don't explicitly detail how custom function response variables map to
custom_analysis_data
, the mechanism for extracting and storing variables from custom function responses is documented. [(1) ]() Here's how to set response variables in a custom function: 1. Configure your custom function with an endpoint URL 2. Define the function parameters 3. Set response variables to extract values from the API response For example, if your API returns:
Copy code
json
{
 "properties": {
 "user": {
 "name": "John Doe",
 "age": 26
 }
 }
}
You can extract
user.name
and save it as a dynamic variable like
{{user_name}}
to reference later. These dynamic variables collected during the call are included in the call object under
collected_dynamic_variables
. [(2) ]()
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Could I achieve the goal of setting a dynamic variable named "call_needed" to "true" by creating an enum type with an Extract Dynamic Variables node with only one option of "true"? If so, what would I put in the description?
a
Thanks for the follow-up, @cotton96473. I'll get back to you soon.
### Answer --- While technically possible, this approach wouldn't achieve your goal of setting a variable without LLM inference. The Extract Dynamic Variable node is designed to extract information from the conversation, [(1) ]() meaning the LLM would still need to infer when to extract the value—even if there's only one enum option available. [(1) ]() [(2) ]() The Extract Dynamic Variable node requires you to provide: - Variable Name – A short name to reference the variable - Description – A brief explanation of what the value should be - Variable Type – In your case, Enum - Enum Options – Your single "true" option However, the LLM would still need to determine when during the conversation to extract this value based on your description. This means you're not explicitly setting it—you're still relying on the LLM to infer the appropriate moment to capture it. For truly explicit variable setting without LLM inference, you'd need to use
retell_llm_dynamic_variables
when creating or registering calls, [(3) ]() [(4) ]() or handle this through custom function response variables that get stored in
collected_dynamic_variables
. **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[3] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[4] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​