https://retellai.com/?utm_source=discord&utm_medium=seo logo
Once I provide variables values to Retell through ...
# ❓・ai-evy-support
s
@AI Evy Once I provide variables values to Retell through API for outbound call, agent behaves like he didn't receive them or doesn't have this info available. Even though after call in call history, I can clearly see that variables were received. What could cause taht and what can be a possible fix?
a
Thanks for tagging me @spirit19952. I'll look through relevant sources and get back to you shortly.
[(1) ]() 2. **Check Prompt Syntax**: Confirm your agent's prompt includes the variables with proper syntax like
"Hello {{user_name}}, I understand you're interested in {{product_name}}"
. 3. **Test with Simple Variables**: Try using short, simple test values to rule out length or content issues [(2) ]() . 4. **Edge Case Handling**: When variables aren't set properly, they remain unchanged as
{{variable_name}}
in the output rather than being replaced [(1) ]() . You can check for this in your prompt with conditions like
{{user_name}} contains {{
. If these steps don't resolve the issue, the problem might be related to how the variables are being processed by the LLM engine itself.
### Answer Based on the documentation and community discussions, there are several potential causes for this issue: Common Causes: 1. **Variable Format Issues**: For outbound calls, dynamic variables must be set in the
retell_llm_dynamic_variables
field with all values as strings [(1) ]() . Even if you see the variables in call history, they might not be properly formatted for the LLM to use. 2. **Prompt Configuration**: The dynamic variables need to be properly referenced in your agent's prompt using the double curly brace syntax like
{{variable_name}}
. If the prompt doesn't include these placeholders, the agent won't use the variables even if they're received. 3. **Variable Length Issues**: Community discussions indicate that very long variable values can cause processing issues [(2) ]() . If your variables contain lengthy content, try testing with shorter, hardcoded values to isolate the problem. Troubleshooting Steps: 1. **Verify Variable Format**: Ensure you're passing variables in the correct format for outbound calls:
Copy code
json
{
 "user_name": "John Smith",
 "product_name": "Premium Plan",
 "account_status": "active"
}
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] agent not receiving dynamic variables from inbound webhook response](https://discord.com/channels/1186424376300679209/1394015802402930778) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.