Hi there, need some help.
I’m struggling with a Book Appointment Cal function in a Conversional Flow local component:
I’ve been trying different setups, including variables and prompts to explain, but the function fails to send a correct payload and returns an error. The check_availability_cal function works correctly with the same credentials, the phone number is available, and in the e.164 format - so I guess the issue is somewhere in the setup. Has anyone met and resolved such an issue before?
Book Appointments - Books appointment in a specific slot(1)
Configuration Requirements
Make sure you’ve properly set up the Cal.com integration(2):
Enter the necessary Cal.com credentials and event ID(2)
Configure the correct time zone settings on both the Cal.com platform and the Retell AI dashboard(2)
Conversation Flow Structure
Based on a similar issue reported in the community, the problem often relates to how the conversation flow is structured(3). A key insight from resolving a similar case:
After the check_availability_cal function executes, you need a conversation node to process and communicate the function result(3)
The agent needs to explicitly tell the user the available times before proceeding to book(3)
Only after the user confirms a specific time should the flow transition to the book_appointment function(3)
Recommended Flow Structure
The conversation flow should follow this pattern(3):
Execute check_availability_cal function
Add a conversation node after the function to verbalize available times to the user
Wait for user confirmation of a specific time
Only then trigger the book_appointment function with the confirmed time
Component-Specific Considerations
Since you’re using a local component, note that(4):
Tools need to be defined within the component and will not be visible outside at agent level(4)
The component needs to be added to the main Conversation Flow to be initialized properly(4)
The global prompt of the main Conversation Flow will be applied to all component nodes implicitly(4)
If these steps don’t resolve your issue, I’d recommend checking your conversation flow structure to ensure there’s a conversation node between checking availability and booking the appointment.
Looking at your component structure, I can see a potential issue based on similar problems reported in the community.
The Core Problem
From the error pattern you’re experiencing, this appears to match a known issue where the book_appointment function fails to receive the necessary date/time arguments(1). The error typically looks like:
Arguments: {}
error: Error calling Cal Book Appointment API: Date time reference does not exist, ask user to explicitly say a date time.
Based on your component screenshot, I notice you’re going directly from the check availability function to the book appointment function. This is likely causing the problem(2).
The Solution
According to a resolved case in the community, you need to add a conversation node between the two functions(2). Here’s why:
After check_availability_cal executes, the agent needs a conversation node to process and verbalize the function result to the user(2)
The agent must explicitly tell the user the available times found in the result(2)
Only after the user confirms a specific time slot should the flow proceed to book_appointment(2)
NEW: Conversation Node → Prompt the agent to tell the user all available times from the function result
User Confirmation → Wait for user to select a specific time
Book Appointment Node → Execute book_appointment with confirmed time
Prompt Suggestion for the Conversation Node
In the new conversation node between your functions, add a prompt like(2):
“Tell the user all the available times found in the check_availability_cal function result. Wait for them to confirm which specific time they want before proceeding.”
Additional Consideration
The community has reported that this issue can be intermittent - “sometimes it works and another it doesn’t”(1). Adding the conversation node creates a more reliable flow by ensuring the date/time context is properly established before the booking attempt.
Try adding that conversation node between your two function nodes and let me know if that resolves the payload issue.
Looking at your function setup, I can see you have the Cal.com API Key and Event Type ID configured. Here are the key setup requirements from the documentation:
To properly configure the Book Appointment function, you need(1):
Event Type ID - The number from your Cal.com event type URL (e.g., if the URL is https://app.cal.com/your-username/event-type/1427703, then 1427703 is your event type ID)(1)
API Key - Retrieved from Settings → Developer → API Keys in your Cal.com dashboard(1)
Timezone (optional) - Can be added to the function configuration(1)
Retell AI ensures all bookings are time zone-aware(3). You need to configure the time zone settings in both the Cal.com account and the Retell AI dashboard for accurate scheduling(3).
Common Issue
Based on your screenshot, I notice your tool description is quite brief. The documentation emphasizes updating the prompt to explicitly state when the function should be called(1). Try adding more specific guidance about when to invoke the booking function, particularly after the user has confirmed a specific time slot.
If the check_availability_cal function works correctly with the same credentials, the issue is likely in how the conversation flow is structured or how the booking function is being triggered, rather than the credentials themselves.
To configure Cal.com booking with email instead of phone number for your Retell AI agent, you’ll need to adjust the booking questions in Cal.com’s advanced settings(1).
In Cal.com, navigate to your event type’s advanced page where you can set up booking questions(1). The system allows you to add custom fields like phone number or email as input fields on the booking page(1).
When setting up the Retell AI integration, you’ll configure the book_appointment_cal tool with your Cal.com credentials(2):