https://retellai.com/?utm_source=discord&utm_medium=seo logo
what is the best way to setup business hours and a...
# ❓・ai-evy-support
a
Thanks for tagging me @Joey. I'll look through relevant sources and get back to you shortly.
### Answer For reliable business hours handling with a single prompt agent, the most robust approach is to determine open/closed status on your server and pass it as a dynamic variable, rather than relying on the LLM to interpret time. [(1) ]() ## Recommended Approach 1. Use your inbound webhook or custom function to calculate whether the business is currently open based on your business hours and holidays. 2. Pass the result as a dynamic variable (e.g.,
{{is_open}}
set to
"true"
or
"false"
, or
{{business_status}}
set to
"open"
or
"closed"
) . [(2) ]() 3. Reference the variable in your prompt to control agent behavior:
Copy code
If {{business_status}} is "closed", inform the caller that the business is currently closed and offer to take a message or ask them to call back during business hours.

If {{business_status}} is "open", proceed with normal call handling.
## Why This Is More Reliable - Relying on the LLM to interpret
{{current_time}}
and compare it to business hours introduces hallucination risk, even if small. [(1) ]() - Server-side logic gives you deterministic control over time zones, holidays, and edge cases. - Dynamic variables are injected at call start via the [Create Phone Call API](/api-references/create-phone-call) for outbound or the [Inbound Call Webhook](/features/inbound-call-webhook) for inbound calls. [(2) ]() ## Note on Single Prompt Limitations Time-based conditional logic (like routing differently based on hours) is more naturally handled in Conversation Flow, which supports equation-based transitions. [(3) ]() However, if you pre-calculate the status externally and pass it as a variable, single prompt can work effectively.
​ To learn more, see the sources I considered: [[1] Unable to do Operational Time](https://discord.com/channels/1186424376300679209/1428140976492384399) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Discord message from @dunbar_68134_54083 on 2026-01-24](https://discord.com/channels/1186424376300679209/1186462578310910112/1464721085064020028) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy so using th time zone variable on retell with ai instructions won’t be consistent?
a
Thanks for the follow-up, @Joey. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Time variable?](https://discord.com/channels/1186424376300679209/1391129251356475433) ​
### Answer Using the
{{current_time_[timezone]}}
variable with AI instructions can work, but it introduces some reliability concerns because you're asking the LLM to interpret the time and compare it against business hours. [(1) ]() ## What the Documentation Shows Retell provides system variables like
{{current_time}}
(defaults to America/Los_Angeles) and
{{current_time_[timezone]}}
(e.g.,
{{current_time_Australia/Sydney}}
) . A community member shared this prompt approach:
Copy code
# Context 
current_time : {{current_time}}
business hours :
   - Monday – Friday: 9:00 AM – 5:00 PM
   - Saturday – Sunday: Closed

If the time is not in business hours, inform the customer that we are closed and end the call using this function "end_call"
[(2) ]() ## Why It May Not Be Fully Consistent Community reports indicate users have experienced issues with this approach—one user mentioned it worked intermittently and then stopped, despite no prompt changes. Another user reported the conversational flow "has trouble understanding future dates and times." The inconsistency stems from relying on the LLM to correctly parse and compare time values against your business hours logic. LLMs can occasionally misinterpret or hallucinate these comparisons. ## More Reliable Alternative Pre-calculate the open/closed status on your server (via inbound webhook or before making outbound calls) and pass it as a simple dynamic variable like
{{is_open}}
set to
"true"
or
"false"
. [(1) ]() This removes the LLM's interpretation from the equation entirely.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy client wants it as the call beings. So I call the webhook before greeting?
a
Thanks for the follow-up, @Joey. I'll get back to you soon.
### Answer Yes, for inbound calls the Inbound Call Webhook fires before the call connects and before the agent speaks. [(1) ]() This is exactly what you need—your webhook calculates the business hours status and returns the dynamic variable, which is then available for the agent's greeting. ## How It Works 1. The inbound webhook is triggered when a call comes in, before the call is connected and before a call object is created. 2. Your webhook calculates whether the business is open/closed and returns the result as a dynamic variable. 3. The agent receives the variable and uses it in the greeting. ## Webhook Response Structure Your webhook should return the
dynamic_variables
nested under `call_inbound`: , [(2) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "is_open": "false",
      "business_status": "closed"
    }
  }
}
[(1) ]() , [(2) ]() ## Important Setup Note Make sure the inbound webhook URL is configured at the phone number level (in the Phone Numbers tab) , not just at the agent level. , [(3) ]() The webhook must be set on the specific phone number to trigger before the call connects. [(2) ]() While the call is waiting for the webhook response, it stays in the ringing state. [(1) ]() The webhook has a 10-second timeout.
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Inbound webhook returns retell_llm_dynamic_variables but agent doesn't receive them](https://community.retellai.com/t/inbound-webhook-returns-retell-llm-dynamic-variables-but-agent-doesnt-receive-them/733) [[3] Inbound Calls Webhook Issue](https://discord.com/channels/1186424376300679209/1420797324535533740) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.