bohmez
02/19/2026, 12:45 AMAI Evy
02/19/2026, 12:45 AMAI Evy
02/19/2026, 12:45 AM{{transfer_number}}) , which your webhook populates based on the time logic.
3. Intent-based routing with lookup logic works well for this. [(1) ]() [(3) ]()
- The agent calls a dynamic function, passes the detected intent or time context, your webhook looks up the associated number, and returns it for the transfer.
Example Setup:
Using n8n with a Google Sheet (or database) as the lookup table—Retell calls a dynamic function, the webhook checks the time and returns the correct number for the transfer. [(1) ]()
Relevant Documentation:
- [Transfer call]() [(2) ]()
There isn't a built-in "time of day" routing feature in RetellAI Evy
02/19/2026, 12:45 AMAI Evy
02/19/2026, 12:45 AMAI Evy
02/19/2026, 12:46 AMbohmez
02/19/2026, 12:59 AMAI Evy
02/19/2026, 12:59 AMAI Evy
02/19/2026, 1:00 AM{{current_time}} — Current time in America/Los_Angeles (e.g., "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}})
- {{current_hour}} — Current hour in America/Los_Angeles (e.g., "3 PM")
- {{current_hour_[timezone]}} — Current hour in a specified timezone
For time-based routing, you can reference these variables directly in your prompt logic. For example, in your agent prompt:
If {{current_hour}} is between 9 AM and 5 PM, transfer to {{daytime_agent_number}}.
Otherwise, transfer to {{afterhours_agent_number}}.
Using nested variables:
If you want the timezone to be dynamic, you can use nested variable syntax:
{{current_time_{{my_timezone}} }}
This evaluates the inner variable first, then resolves the full expression.
For more complex logic (like checking if the time falls within business hours) , you'd use a custom function that your webhook handles—the function receives the call context, your server evaluates the time, and returns the appropriate transfer number. [(2) ]()AI Evy
02/19/2026, 1:00 AMAI Evy
02/19/2026, 1:00 AMbohmez
02/21/2026, 12:21 AMAI Evy
02/21/2026, 12:21 AMAI Evy
02/21/2026, 12:22 AM{{current_time_America/New_York}}
This returns the current time in your specified timezone (e.g., "Thursday, March 28, 2024 at 11:46:04 PM EST") .
## Step 4: Add Transfer Tools
Option A - Agent Transfer (recommended for AI-to-AI transfers) :
Click "Add" in the tools section and select "Agent Transfer." Configure the transfer agent ID and version for each destination. [(2) ]()
Option B - Transfer Call (for phone number transfers) :
Click "+ Add" in the tools section and select "Transfer Call." Set the transfer number to either a number in e.164 format or a dynamic variable like {{transfer_number}}. [(3) ]()
## Step 5: Update the Prompt with Time Logic
Add clear conditional instructions in your agent prompt: [(4) ]()AI Evy
02/21/2026, 12:22 AM## Transfer Guidelines
Before every response, check the current time using {{current_time_America/New_York}}.
- If the day is Monday through Friday AND the hour is between 8 AM and 5 PM:
- Say: "Let me transfer you to our daytime team."
- Immediately call the function: transfer_to_daytime_agent
- If the day is Saturday or Sunday, OR the hour is before 8 AM or after 5 PM:
- Say: "Let me transfer you to our afterhours team."
- Immediately call the function: transfer_to_afterhours_agent
## Step 6: Test and Debug
Test the agent transfer both in web call and playground to verify the routing logic works correctly. [(2) ]()
Important Note: Function calling reliability depends on the LLM model. GPT-4.1 and GPT-4o tend to perform better for function calling. Using a lower temperature value (closer to 0) improves reliability for function calling use cases. [(4) ]()AI Evy
02/21/2026, 12:22 AMAI Evy
02/21/2026, 12:22 AMbohmez
02/24/2026, 11:39 PMAI Evy
02/24/2026, 11:39 PMAI Evy
02/24/2026, 11:39 PM{{current_time_[timezone]}} — Current time in your specified timezone (e.g., {{current_time_America/New_York}})
- {{current_hour_[timezone]}} — Current hour in your specified timezone (e.g., "3 PM EST")
Faster implementation:
Instead of calling n8n, put the time-checking logic directly in your agent's prompt using these variables:
Check {{current_time_America/New_York}} before transferring.
If Monday-Friday between 8 AM and 5 PM:
- Transfer to [daytime number]
Otherwise:
- Transfer to [afterhours number]
This removes the external HTTP round-trip to n8n, which is likely adding most of that 12-second delay. The LLM evaluates the time logic locally using the pre-populated system variable.
Additional latency tips:
- Use a lower temperature value (closer to 0) for more reliable function calling. [(2) ]()
- Consider using GPT-4o or GPT-4.1 for better function calling consistency.AI Evy
02/24/2026, 11:39 PMAI Evy
02/24/2026, 11:39 PMbohmez
03/07/2026, 5:17 AMAI Evy
03/07/2026, 5:17 AMAI Evy
03/07/2026, 5:17 AMAI Evy
03/07/2026, 5:17 AMcall_analysis object. [(2) ]()
Option 2: Capture from webhooks
The call_analyzed webhook only contains extracted/spoken data, not telephony metadata. The caller number lives at the call level (e.g., from_number) and is sent in call_started or call_completed webhooks, or available via Get Call by ID. [(3) ]()
Recommended approach:
Capture the caller number from the initial call_started webhook, store it, then merge it with the call_analyzed data before sending to your destination (like Google Sheets) .
This way you get both the phone number from call metadata and the post-call analysis insights in one combined record.AI Evy
03/07/2026, 5:17 AM