https://retellai.com/?utm_source=discord&utm_medium=seo logo
I totally understand
# ❓・ai-evy-support
a
Thanks for tagging me @gk. I'll look through relevant sources and get back to you shortly.
### Answer To improve your prompt for accurate date handling in appointment booking, you should use the
{{current_time}}
dynamic variable and provide clear instructions for date interpretation [(1) ]() [(2) ]() . Here's an improved prompt structure:
Copy code
## Date Collection Instructions

1. **Ask for Preferred Day:**
   - Ask: "What day works best for you?"
   - Listen for specific dates (e.g., "March 15th") or relative days (e.g., "this Sunday", "next Tuesday")

2. **Interpret Relative Dates:**
   - Use today's date: {{current_time}} as your reference point
   - "This [day]" = the upcoming occurrence of that day in the current week
   - "Next [day]" = the occurrence of that day in the following week
   - "Coming [day]" = same as "next [day]"
   
3. **Confirm the Date:**
   - Convert the day to a specific date format
   - Confirm with member: "Just to confirm, you'd like to book for [specific date]?"
   - Wait for confirmation before proceeding

4. **Avoid Repetition:**
   - Do not repeat the same question if the member has already provided a day
   - Move directly to confirmation once you have their preferred day
Key Implementation Notes: - The
{{current_time}}
variable is populated by default from Retell and should be used in your prompt for accurate date calculations [(1) ]() - Convert dates to the appropriate timezone (e.g., Central Time, Mountain Time) before making booking requests [(2) ]() - Always confirm the exact date with the member before calling the booking function This approach helps the AI accurately interpret relative date references and pass the correct
booking_date
to your Cal.com integration [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Reccurent Booking issues in Conversation Flow](https://discord.com/channels/1186424376300679209/1352309134569115740) [[2] Discord message from @melvinglenford on 2025-03-06](https://discord.com/channels/1186424376300679209/1186462578310910112/1347206753783250995) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy I just want to improvise the prompt
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer To improve your prompt for accurate date collection and booking, here's a refined version:
Copy code
## Date Collection for Kickoff Session

Current reference: {{current_time}}

**Your Goal:** Help the member select a specific date for their Kickoff session before it expires.

**Instructions:**

1. **Ask Once, Listen Carefully:**
   - "What day works best for you for the Kickoff?"
   - Do NOT repeat this question if they've already mentioned a day

2. **Interpret Relative Dates:**
   - "Sunday" or "this Sunday" = the upcoming Sunday from {{current_time}}
   - "Next Tuesday" or "coming Tuesday" = Tuesday of next week from {{current_time}}
   - Use {{current_time}} as your reference point for all date calculations

3. **Confirm Specific Date:**
   - Convert their response to a specific date (e.g., "Sunday, April 6th")
   - Say: "Perfect! So that's [specific date]. Let me check availability."
   - Store the confirmed date in {{booking_date}}

4. **Avoid Repetition:**
   - Move forward immediately once you have a day
   - Don't ask for the date multiple times
   - If they're unsure, offer 2-3 specific options based on trainer availability

**Example Flow:**
- Member: "Sunday works"
- You: "Great! That's Sunday, April 6th. Let me check if we have availability."
The key improvements are: - Use
{{current_time}}
for accurate date reference [(1) ]() - Clear instructions to avoid repetition - Specific guidance on interpreting relative dates - Direct path from day mention to confirmation to booking This ensures the agent captures the correct date and passes it accurately to
{{booking_date}}
for your booking function .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy I want to create a another node if it checks the date founds no availability then we would ask for another availabilities
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer To create a node that handles no availability and asks for alternative dates in Conversation Flow, you'll need to set up an edge transition based on the booking function's response [(1) ]() . Here's the structure: 1. Current Node (where you check availability) : - Add your booking check function - Create an edge with a transition condition 2. **Edge Transition Condition**: - Use a prompt-based condition like: "No availability found for the requested date" - Set the destination to your new "Alternative Dates" node 3. **New "Alternative Dates" Node**: - Type: Conversation node - Instruction example:
Copy code
## No Availability - Offer Alternatives

The requested date {{booking_date}} has no trainer availability.

**Your Task:**
1. Acknowledge: "Unfortunately, we don't have availability on {{booking_date}}."
2. Ask: "Would you like to try a different day? What other days work for you this week or next?"
3. Listen for their alternative preference
4. Confirm the new date before checking availability again
5. Store the new date in {{booking_date}}

**Avoid:**
- Don't repeat that the original date wasn't available
- Move directly to finding a solution
The edge from your booking check node should use a transition condition that detects when the function returns no availability . You can set this up using either a prompt-based condition or by checking specific function response values. This creates a loop where the agent can keep offering alternatives until a date with availability is found.
​ To learn more, see the sources I considered: [[1] Conversation Node Overview](https://docs.retellai.com/build/conversation-flow/conversation-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy ## Date Collection Instructions 1. Ask for Preferred Day: - Ask: "What day works best for you?" - Listen for specific dates (e.g., "March 15th") or relative days (e.g., "this Sunday", "next Tuesday") 2. Interpret Relative Dates: - Use today's date: {{current_time}} as your reference point - "This [day]" = the upcoming occurrence of that day in the current week - "Next [day]" = the occurrence of that day in the following week - "Coming [day]" = same as "next [day]" 3. Confirm the Date: - Convert the day to a specific date format - Confirm with member: "Just to confirm, you'd like to book for [specific date]?" - Wait for confirmation before proceeding 4. Avoid Repetition: - Do not repeat the same question if the member has already provided a day - Move directly to confirmation once you have their preferred day make this in way it makes the user choose and confirm the date / day and pass the booking_date
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer Here's an improved prompt that ensures the user chooses, confirms, and passes the
booking_date
accurately:
Copy code
## Date Collection & Confirmation

**Reference Point:** {{current_time}}

### Step 1: Ask for Preferred Day
- Ask: "What day works best for your Kickoff session?"
- Listen for specific dates (e.g., "March 15th") or relative days (e.g., "this Sunday", "next Tuesday")

### Step 2: Interpret & Convert to Specific Date
When the member mentions a day, immediately convert it using {{current_time}} as reference:
- "This [day]" or just "[day]" = upcoming occurrence in current week
- "Next [day]" or "coming [day]" = occurrence in following week
- Calculate the exact date (e.g., "Sunday" → "Sunday, April 6th")

### Step 3: Confirm & Get Explicit Agreement
- State the specific date clearly: "Perfect! So that's [Day of week], [Month] [Date]. Does that work for you?"
- Wait for explicit confirmation ("yes", "that works", "sounds good")
- If they say no or hesitate, ask: "What other day would work better?"

### Step 4: Store Confirmed Date
- Once confirmed, extract and store the date in {{booking_date}}
- Format: YYYY-MM-DD (e.g., 2025-04-06)
- Proceed immediately to check availability

### Rules:
- Do NOT repeat the initial question once they've mentioned a day
- Do NOT move forward without explicit confirmation
- If unclear, offer 2-3 specific date options instead
- Never assume - always confirm before storing {{booking_date}}
Key points: - Use
{{current_time}}
as your reference for date calculations [(1) ]() - Extract the confirmed date into
{{booking_date}}
dynamic variable [(1) ]() [(2) ]() - When passing to your booking function, use
{{booking_date}}
directly in the function parameters [(3) ]() This ensures the agent gets explicit confirmation before passing the date to your booking system.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] Extracted Dynamic Variables not sending through custom function in Conversation Flow Prompt](https://discord.com/channels/1186424376300679209/1442542149546803312) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
Make it short and effiecient @User
Make it short and effiecient @AI Evy
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer Here's a streamlined version:
Copy code
## Date Collection

Reference: {{current_time}}

1. **Ask:** "What day works for your Kickoff?"

2. **Interpret:**
   - "Sunday" / "this Sunday" = upcoming Sunday
   - "Next Tuesday" = Tuesday next week
   
3. **Confirm:** 
   - "So that's [Day], [Month] [Date]. Does that work?"
   - Wait for "yes" before proceeding

4. **Store:** Extract confirmed date to {{booking_date}} in YYYY-MM-DD format

**Rules:**
- Don't repeat questions
- Don't proceed without confirmation
- Use {{booking_date}} in your booking function
This uses
{{current_time}}
for date reference [(1) ]() and stores the result in
{{booking_date}}
to pass to your custom function [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Extracted Dynamic Variables not sending through custom function in Conversation Flow Prompt](https://discord.com/channels/1186424376300679209/1442542149546803312) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy This prompt "## No Availability - Offer Alternatives The requested date {{booking_date}} has no trainer availability. Your Task: 1. Acknowledge 2. Ask: "What other days work for you this week or next?" 3. Listen for their alternative preference 4. Confirm the new date before checking availability again 5. Store the new date in {{booking_date}} Avoid: - Don't repeat that the original date wasn't available - Move directly to finding a solution"is hallucinating remembering the expiry date and getting the date / day and passing the bookig_date and I want to make it robust like this "## Date Collection Reference: {{current_calendar}} 1. Ask: "What day works for your Kickoff?" 2. Interpret: - "Sunday" / "this Sunday" = upcoming Sunday - "Next Tuesday" = Tuesday next week 3. Confirm: - "So that's [Day], [Month] [Date]. Does that work?" - Wait for "yes" before proceeding 4. Store: Extract confirmed date to {{booking_date}} in YYYY-MM-DD format Rules: - Don't repeat questions - Don't proceed without confirmation - Use {{booking_date}} in your booking function "
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer Here's a robust version combining both prompts:
Copy code
## No Availability - Alternative Date Collection

Reference: {{current_time}}

The requested date {{booking_date}} has no trainer availability.

1. **Acknowledge & Ask:** 
   - "Unfortunately, that date isn't available. What other day works for your Kickoff?"

2. **Interpret:**
   - "Sunday" / "this Sunday" = upcoming Sunday from {{current_time}}
   - "Next Tuesday" = Tuesday next week from {{current_time}}

3. **Confirm:** 
   - "So that's [Day], [Month] [Date]. Does that work?"
   - Wait for "yes" before proceeding

4. **Store:** Extract confirmed date to {{booking_date}} in YYYY-MM-DD format

**Rules:**
- Don't repeat that original date wasn't available
- Don't repeat questions once day is mentioned
- Don't proceed without explicit confirmation
- Use {{booking_date}} in your booking function
Key improvements: - Uses
{{current_time}}
(the correct dynamic variable name) for date reference [(1) ]() - Combines acknowledgment with immediate action - Maintains the structured date interpretation logic - Ensures confirmation before storing to
{{booking_date}}
[(1) ]() [(2) ]() - Removes hallucination risks by keeping instructions focused and specific [(3) ]() This structure prevents the agent from inventing information about expiry dates while maintaining robust date collection and confirmation.
​ To learn more, see the sources I considered: [[1] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[2] Extracted Dynamic Variables not sending through custom function in Conversation Flow Prompt](https://discord.com/channels/1186424376300679209/1442542149546803312) [[3] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy this is the output and does make sense how come the april 16th before april 10 What specific Sunday before April tenth are you thinking of, like April sixth or April thirteenth?
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer I see the issue - the AI is suggesting April 13th as an option, but April 13th comes after April 10th, not before. This is a date logic error in the agent's response. The problem: You need to use
{{current_calendar}}
instead of
{{current_time}}
for better date awareness [(1) ]() , and add explicit date range constraints to your prompt. Improved prompt:
Copy code
## No Availability - Alternative Date Collection

Reference: {{current_calendar}}
Current time: {{current_time}}

The requested date {{booking_date}} has no trainer availability.

1. **Acknowledge & Ask:** 
   - "Unfortunately, that date isn't available. What other day works for your Kickoff before [expiry date]?"

2. **Interpret using {{current_calendar}}:**
   - Use {{current_calendar}} to identify valid upcoming dates
   - "Sunday" / "this Sunday" = the next Sunday listed in {{current_calendar}}
   - "Next Tuesday" = the Tuesday in the following week per {{current_calendar}}
   - **Only suggest dates that come BEFORE the expiry deadline**

3. **Confirm:** 
   - "So that's [Day], [Month] [Date]. Does that work?"
   - Wait for "yes" before proceeding

4. **Store:** Extract confirmed date to {{booking_date}} in YYYY-MM-DD format

**Rules:**
- Use {{current_calendar}} to verify date order
- Never suggest dates after the expiry deadline
- Don't repeat questions once day is mentioned
- Don't proceed without explicit confirmation
The
{{current_calendar}}
variable provides a 14-day calendar view that helps the AI understand date sequences correctly . This should prevent the agent from suggesting April 13th when the deadline is April 10th.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy this is the output Nice, Sunday works. What specific Sunday before April tenth are you thinking of, like this coming Sunday or the one right before the tenth? there is only one sunday before april 10th
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer You're right - the AI is creating unnecessary confusion by asking for clarification when there's only one Sunday before April 10th. This is a hallucination caused by overly flexible prompt language. Simplified prompt to fix this:
Copy code
## No Availability - Alternative Date Collection

Reference: {{current_calendar}}
Current time: {{current_time}}

The requested date {{booking_date}} has no trainer availability.

1. **Acknowledge & Ask:** 
   - "That date isn't available. What other day before [expiry date] works for you?"

2. **When member says a day:**
   - Find that day in {{current_calendar}} that comes before expiry
   - If only ONE occurrence exists before expiry, use it immediately
   - Don't ask for clarification when only one option exists

3. **Confirm:** 
   - "Perfect, that's [Day], [Month] [Date]. Correct?"
   - Wait for "yes"

4. **Store:** Extract to {{booking_date}} in YYYY-MM-DD format

**Rules:**
- If only ONE valid date exists for their chosen day, don't ask which one
- Use {{current_calendar}} to count valid occurrences
- Move directly to confirmation
The key fix: Add explicit logic that when only one occurrence of the day exists before the deadline, skip the clarification question entirely and move straight to confirmation [(1) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy It just need to get a date before the expiray date and not include the previous checked date that's it give me very simple prompt and pass the updated {{booking_date}}
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer Here's a simple prompt:
Copy code
## Alternative Date Collection

Reference: {{current_calendar}}

1. Ask: "What other day before [expiry date] works for you?"

2. When they say a day, find it in {{current_calendar}} before expiry

3. Confirm: "That's [Day], [Month] [Date]. Work for you?"

4. Store confirmed date to {{booking_date}} in YYYY-MM-DD format

Rules:
- Don't suggest {{booking_date}} again
- Only offer dates before expiry
- Confirm before storing
This uses
{{current_calendar}}
for date reference [(1) ]() and stores the result in
{{booking_date}}
[(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy It just need to get a date before the expiray date and not include the previous checked date that's it give me very simple prompt and pass the updated {{booking_date}}
a
Thanks for the follow-up, @gk. I'll get back to you soon.
### Answer Here's a minimal prompt:
Copy code
## Get Alternative Date

Reference: {{current_calendar}}
Previous date checked: {{booking_date}}

1. Ask: "What other day before [expiry date] works?"

2. Get their day, convert to date using {{current_calendar}}

3. Confirm: "So [Month] [Date]?"

4. Store to {{booking_date}} in YYYY-MM-DD

Rules:
- Skip {{booking_date}} 
- Only dates before expiry
Use
{{current_calendar}}
for the 14-day calendar reference [(1) ]() and store the confirmed date in
{{booking_date}}
. When passing to your function node, reference
{{booking_date}}
directly in the function parameters [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Extracted Dynamic Variables not sending through custom function in Conversation Flow Prompt](https://discord.com/channels/1186424376300679209/1442542149546803312) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy in a similar way "## Get Alternative Date Reference: {{current_calendar}} Previous date checked: {{booking_date}} 1. Ask: "What other day before [expiry date] works?" 2. Get their day, convert to date using {{current_calendar}} 3. Confirm: "So [Month] [Date]?" 4. Store to {{booking_date}} in YYYY-MM-DD Rules: - Skip {{booking_date}} - Only dates before expiry" update this what specific day / date before {{expirationDate}} you can think of?
@AI Evy in a similar way "## Get Alternative Date Reference: {{current_calendar}} Previous date checked: {{booking_date}} 1. Ask: "What other day before [expiry date] works?" 2. Get their day, convert to date using {{current_calendar}} 3. Confirm: "So [Month] [Date]?" 4. Store to {{booking_date}} in YYYY-MM-DD Rules: - Skip {{booking_date}} - Only dates before expiry" update this prompt what specific day / date before {{expirationDate}} you can think of?