mush
01/01/2026, 9:34 PMAI Evy
01/01/2026, 9:34 PMAI Evy
01/01/2026, 9:34 PMAI Evy
01/01/2026, 9:34 PMWhen user stated a time range, please check the calendar availability by calling the `check_calendar_availability` function and let user know whether that range work or not.
2. Add a Conversation Node After the Function
- This is critical—if you send directly to the next function without a conversation node, the agent won't verbally communicate the results to the user [(3) ]()
- Prompt this node to tell the user the available times from the function result
3. Book Appointment Function Node
- Only transition here after the user confirms a specific slot [(1) ]()
- Example prompt:
When user selected a slot, please book the appointment by calling the `book_appointment` function.AI Evy
01/01/2026, 9:34 PMAI Evy
01/01/2026, 9:34 PMmush
01/01/2026, 10:28 PMmush
01/01/2026, 10:28 PMAI Evy
01/01/2026, 10:28 PMAI Evy
01/01/2026, 10:28 PMbook_appointment function in Retell has limited configuration options—you can set the tool name, API key, Event Type ID, description, and timezone. [(1) ]()
However, passing custom variables like email and phone number to the booking is not supported by the preset function. As noted in the community:
> "On the cal.com book_appointment, how do we pass custom variables. Right now, it just says booked with user. Can we pass email, name etc?"
>
> "You have to create your custom function to do that" [(2) ]()
## Recommended Solution
You'll need to create a custom function that calls the Cal.com API directly, where you can include your conversation variables (email, phone, name, etc.) in the booking payload.
Some users have also found success handling the booking post-call using the transcript and webhook data rather than during the live call, which can avoid issues if the user changes their mind mid-conversation. [(3) ]()
Check out these potentially useful sources for building custom functions:
- [Book Calendar]()
- [Create Retell LLM]()
Would you like a general answer on how to structure a custom function for this use case?AI Evy
01/01/2026, 10:28 PMAI Evy
01/01/2026, 10:28 PMmush
01/01/2026, 10:33 PMAI Evy
01/01/2026, 10:33 PMmush
01/01/2026, 10:33 PMAI Evy
01/01/2026, 10:33 PM{{email}}, {{phone_number}}, and {{name}} variables that reference what you've collected in your conversation.
*6. Set response variables (optional) *
- Extract confirmation details from Cal.com's response to use later in the conversation
## Key Points
- The const field lets you inject dynamic variables directly into the API call
- Query parameters and header values can also use dynamic variables
- Retell sends the request with the function name, call object (including transcript) , and your defined arguments
For the actual Cal.com API payload structure, you'll need to reference Cal.com's documentation for their booking endpoint requirements.AI Evy
01/01/2026, 10:33 PMbook_cal_appointment (must be unique, use underscores)
- Description: Book an appointment on Cal.com with customer details
2. Select HTTP Method
- Choose POST
3. Add endpoint URL
- Use Cal.com's booking API endpoint
4. Set request headers
- Add your Cal.com API key in headers (header values can include dynamic variables)
5. Define parameters using JSON schema
You can pass your conversation variables using the const property with dynamic variable syntax. Example:
json
{
"type": "object",
"required": [
"order_id"
],
"properties": {
"name": {
"type": "object",
"description": "",
"properties": {
"first_name": {
"type": "string",
"description": "User first name"
},
"last_name": {
"type": "string",
"const": "{{last_name}}"
}
}
},
"order_id": {
"type": "number",
"const": 1234
}
}
}AI Evy
01/01/2026, 10:34 PMAI Evy
01/01/2026, 10:34 PM