FullThrottleFu
01/04/2026, 4:55 PMAI Evy
01/04/2026, 4:55 PMAI Evy
01/04/2026, 4:55 PMretell_llm_dynamic_variables. [(1) ]()
How it works:
1. Determine the time of day in your backend before initiating the call
2. Pass the greeting as a dynamic variable when creating the call:
javascript
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
retell_llm_dynamic_variables: {
greeting: "Good morning" // or "Good evening" based on your backend logic
}
}) ;
[(2) ]()
3. Reference {{greeting}} in your agent's first sentence or prompt
This avoids the issue you're experiencing where tool execution blocks the agent from speaking. The greeting is pre-computed and injected before the call even starts.
Why tools before first speech can be problematic:
There's a known issue in Flex Mode and conversation flows where tool calls can create race conditions that prevent speech from executing properly. [(3) ]() , [(4) ]() One community member noted that in Flex Mode, a "race condition" often causes the tool to terminate or block before TTS finishes.
Alternative if you need runtime logic:
If you must determine the greeting during the call, consider putting the time-check logic in your Global Prompt instructions rather than a tool, instructing the agent to greet appropriately based on context you provide via dynamic variables.AI Evy
01/04/2026, 4:55 PMAI Evy
01/04/2026, 4:55 PMFullThrottleFu
01/04/2026, 4:58 PMAI Evy
01/04/2026, 4:58 PMAI Evy
01/04/2026, 4:58 PM{{current_time}} | Current time in America/Los_Angeles | "Thursday, March 28, 2024 at 11:46:04 PM PST" |
| {{current_time_[timezone]}} | Current time in a specified timezone, e.g., {{current_time_Australia/Sydney}} | "Thursday, March 28, 2024 at 11:46:04 PM AEDT" |
| {{current_calendar}} | 14-day calendar in America/Los_Angeles | "Thursday, March 28, 2024 PST (Today) ..." |
| {{current_calendar_[timezone]}} | 14-day calendar in a specified timezone | "Thursday, March 28, 2024 AEDT (Today) ..." |
How to use for contextual greetings:
In your agent's prompt or first sentence, you can include something like:
> "The current time is {{current_time}}. Greet the caller appropriately based on the time of day (good morning, good afternoon, or good evening) ."
For appointment booking accuracy:
Reference {{current_calendar}} or {{current_calendar_[timezone]}} in your prompt to give the LLM an accurate 14-day calendar starting from today, which should help prevent it from booking appointments in the past.AI Evy
01/04/2026, 4:58 PMAI Evy
01/04/2026, 4:58 PMAI Evy
01/04/2026, 6:18 PM