https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can I set a static value for a variable in the...
# ❓・ai-evy-support
m
@AI Evy How can I set a static value for a variable in the prompt? For example, userRequest = 'Call back request'
a
Thanks for tagging me @manucmt_18551. I'll look through relevant sources and get back to you shortly.
### Answer You can set static values for dynamic variables at the agent level using default dynamic variables [(1) ]() . These serve as fallback values and will only be used when specific variables aren't included in the call request . Here are two ways to set static values: ## Agent-Level Default Variables Configure default values in your agent settings . For example, in the API response, you can see default dynamic variables configured like this [(2) ]() :
Copy code
json
"default_dynamic_variables": {
  "customer_name": "John Doe"
}
## In Your Prompts You can also reference static values directly in your prompts using the
{{variable_name}}
syntax [(1) ]() . For your example, you could set up: - A default dynamic variable called
userRequest
with the value
"Call back request"
- Then reference it in your prompt as
{{userRequest}}
The agent will use your static default value unless a different value is provided in the API call through the
retell_llm_dynamic_variables
field .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Instead of providing a default value, I want to give it a static value using any note (conversation/extract variable) Is it possible?
a
Thanks for the follow-up, @manucmt_18551. I'll get back to you soon.
### Answer Yes, you can set static values for variables using Extract Variables nodes in Conversation Flow [(1) ]() . Based on a community discussion, you can add an Extract Variables node after a transition and set a variable with a static value instead of a dynamic one based on the conversation . Here's how it works: ## Using Extract Variables Node You can place an Extract Variables node in your conversation flow and configure it to set a static value . For example, if you have different nodes and want to set a static value like
userRequest = 'Call back request'
, you can: 1. Add an Extract Variables node after your desired transition 2. Set a variable (like
userRequest
) with a static value rather than prompting it to extract from conversation context 3. Use this variable throughout your flow or in subsequent nodes ## Variable Scope These variables appear to be accessible throughout your conversation flow, as the discussion mentions being able to use them later and reference them in Logic split nodes for directing flow to different nodes based on the variable values . This approach gives you more control over when and how variables are set during the conversation flow, rather than relying only on default values or API-passed 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] Discord message from @rkrausse on 2025-08-20](https://discord.com/channels/1186424376300679209/1186462578310910112/1407859048426115163) ​
m
@AI Evy Can you give me an example prompt or Description to use to Set a variable (like userRequest) with a static value rather than prompting it to extract from conversation context
a
Thanks for the follow-up, @manucmt_18551. I'll get back to you soon.
### Answer For setting a static value in an Extract Variable node, you can configure it to set the variable to a specific value unconditionally [(1) ]() . Based on the community discussion, to set a variable to true (or any static value) unconditionally in an Extract Variable node, you would : 1. **Variable Name**: Specify the variable you want to set, e.g.,
userRequest
2. **Value**: Directly assign the static value to the variable For your specific example of
userRequest = 'Call back request'
, you would: - Set the Variable Name to
userRequest
[(2) ]() - Set the Description to something like "Set static value for user request type" - Choose Variable Type as
Text
- Configure it to assign the static value
'Call back request'
directly The Extract Dynamic Variable node is designed to extract information from conversation and store them as dynamic variables, but it's noted that it's not intended for having a conversation with the user . This makes it suitable for setting static values that don't require user interaction. You can then reference this variable later in your flow using the
{{userRequest}}
syntax [(3) ]() .
​ To learn more, see the sources I considered: [[1] Extract Variable always True Unconditionally](https://discord.com/channels/1186424376300679209/1390309243860680704) [[2] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[3] 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.