https://retellai.com/?utm_source=discord&utm_medium=seo logo
Does Retell allow for dynamic variables to be pass...
# ❓・ai-evy-support
m
@AI Evy Does Retell allow for dynamic variables to be passed from webhook responses to the LLM for inbound calls. Specifically the retell llm not a custom llm.
a
Thanks for tagging me @mpdp. I'll look through relevant sources and get back to you shortly.
### Answer Yes, Retell allows dynamic variables to be passed from webhook responses to the LLM for inbound calls, including when using the Retell LLM (not just custom LLMs) . You can supply dynamic variables in your inbound webhook response, and these variables are then available for use in prompts, conversation flows, and other agent logic. All variable values must be passed as strings [(1) ]() . If a variable is not set, it will appear in the prompt as its raw curly-brace form (e.g., {{user_name}}) . For example, after receiving an inbound call, your webhook can respond with a JSON object containing dynamic variables, and these will be accessible to the Retell LLM during the call [(1) ]() [(2) ](

▾

) .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Two questions, where can the webhook environment variable be found which should be kept in system? Is there one outside the API Webhook Seceret that needs to be used? What are the exact steps and format needed to set this up for inbound calls? My set up is not working and I need to see where my mistake is.
a
Thanks for the follow-up, @mpdp. I'll get back to you soon.
### Answer To set up dynamic variables for inbound calls via the Retell inbound call webhook, here’s the exact process and details based on the documentation: 1. **Webhook Environment Variable / Secret**: The webhook can be verified using your Retell API Key to ensure requests come from Retell AI. There is no mention of a separate webhook secret outside of your Retell API Key for inbound call webhooks [(1) ]() . The API key is typically stored securely as an environment variable in your backend system. 2. **Steps & Format for Inbound Call Webhook Setup**: - Assign the inbound webhook URL in your Retell number configuration. - When an inbound call is received, Retell will
POST
a payload to your webhook endpoint. Example payload:
Copy code
json
     {
       "event": "call_inbound",
       "call_inbound": {
         "agent_id": "agent_12345",
         "from_number": "+12137771234",
         "to_number": "+12137771235"
       }
     }
- Your webhook should respond with a JSON object under
call_inbound
. To set dynamic variables, include them in the response:
Copy code
json
     {
       "call_inbound": {
         "override_agent_id": "agent_12345",
         "override_agent_version": 1,
         "dynamic_variables": {
           "customer_name": "John Doe"
         },
         "metadata": {
           "random_id": "12345"
         }
       }
     }
- All fields are optional. Only include what you need (e.g., just
dynamic_variables
if that’s all you want to set) . 3. **Other Notes**: - Your webhook must respond within 10 seconds with a 2xx status, or Retell will retry up to 3 times. - If you want to reject a call, respond with 200 but without
"call_inbound.override_agent_id"
in the response. - The API key for verifying webhooks is the same one used for the rest of the API and is found in your Retell dashboard. If your setup is not working: - Double-check the endpoint URL in your Retell dashboard. - Ensure your server returns a 2xx status code and the correct JSON structure. - Confirm your API key is correct and used for verification if you are validating the webhook source. For full details, see: [Inbound call webhook]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I managed to get inbound to work although now outbound is having issues with not being able to reference past conversations. It's the same issue as above but for outbound. Are the instructions the same?
a
Thanks for the follow-up, @mpdp. I'll get back to you soon.
### Answer The instructions for passing dynamic variables to the LLM are similar for outbound calls, but the implementation details are different: - For outbound calls, you set dynamic variables when making the call via the Create Phone Call API by including them in the retell_llm_dynamic_variables field. All values must be strings [(1) ]() . - For inbound calls, dynamic variables are provided in your webhook response [(2) ]() [(1) ]() . If your outbound setup isn't referencing past conversations as expected, ensure you are correctly passing dynamic variables in each outbound call request. The process for including these variables is not identical (you don't use a webhook for outbound; you include variables directly in the API call payload) [(1) ]() . Check these sources for specifics: - [Dynamic Variables]() - [Outbound Calls (Make Calls) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
What about outbound call webhook resources?
a
Thanks for the follow-up, @mpdp. I'll get back to you soon.
m
@AI Evy What about outbound call webhook resources?
a
### Answer For outbound calls, Retell AI does not use a webhook in the same way as inbound calls. Instead, you provide any required dynamic variables directly when making the outbound call via the Create Phone Call API [(1) ]() , [(2) ]() . There is no dedicated outbound call webhook for passing variables or context—your application already knows the number it is calling and can include all needed details in the API request [(1) ]() , [(2) ]() . For real-time monitoring or call status updates on outbound calls, you can set up webhooks (such as call_started, call_ended, call_analyzed, call_failed) to receive notifications about call events, but these are for receiving status and analytics, not for injecting variables into the call [(1) ]() , [(3) ]() . If you need to pass user details or context to an outbound call, include them in the dynamic variables field of the API request when initiating the call [(1) ]() , [(2) ]() .
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] Outbound webhook url](https://discord.com/channels/1186424376300679209/1285612548628025394) [[3] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @mpdp. I'll get back to you soon.
m
@AI Evy Do retell agents know the current date/time or should I pass this as a dynamic variable?
a
### Answer Retell agents have access to the current date and time through the built-in dynamic variable {{current_time}}, which is automatically provided—no need to pass it yourself [(1) ]() . You can also use timezone-specific variants like {{current_time_Australia/Sydney}} if needed . These system variables are available by default for use in prompts, conversation flow, and tool calls .
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] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
m
@AI Evy If my retell agent is having issues understanding the current date/time what should be done?
a
Thanks for the follow-up, @mpdp. I'll get back to you soon.
### Answer If your Retell agent is having issues understanding the current date/time, there are a few things to check and consider: - Retell agents have access to the built-in dynamic variable {{current_time}}, which is automatically provided and does not require you to pass it manually [(1) ]() . - The default timezone for {{current_time}} is America/Los_Angeles (PST) , but you can use variants like {{current_time_Australia/Sydney}} for other time zones . - If you need the agent to use a different time or timezone, you can pass your own value as a custom dynamic variable . If the agent is still having trouble, some users have reported intermittent issues with system variables like {{current_time}} not updating or providing unexpected results. In those cases, a workaround is to send the current time as a custom dynamic variable from your backend, formatted in a human-readable way, and reference that variable in your agent's prompts or logic [(2) ]() . This ensures the agent is always working with the correct time and timezone for your use case.
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] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Discord message from @nocodecreative.io on 2024-12-15](https://discord.com/channels/1186424376300679209/1186462578310910112/1317840635717222432) ​