https://retellai.com/?utm_source=discord&utm_medium=seo logo
So Im building a appointment booking bot with conv...
# ❓・ai-evy-support
a
@AI Evy So Im building a appointment booking bot with convo flow and whats happening is that when im booking the appointment with teh book appointment cal. Its not sending the phone number. Since its not sending the phone number thats why its not booking the appointment. So how do i send the phone number as a field as well when booking the appointment remebr this is in convo flow with book appointment with cal node
a
Thanks for tagging me @aaryan._t. I'll look through relevant sources and get back to you shortly.
### Answer To make sure the phone number is sent as a field when booking an appointment in a Conversation Flow agent with the book appointment cal node, you need to explicitly instruct the agent to include the phone number (and any other required fields) in the function call. The LLM may not always include variables like phone by default, especially if not specified clearly. A proven approach is to update your system prompt or node instruction to say something like: "Important: Always transfer the date/time, email, name, and telephone number to the booking function with each call." This ensures the agent includes the phone field when calling Cal.com [(1) ]() . Additionally, Cal.com expects the phone number in international format (e.g., +15551234567) , so ensure the value you provide matches this format to avoid validation errors [(2) ]() . If you use dynamic variables (e.g., {{phone}}) already collected in your flow, you can reference them directly in the API call—no need to re-ask for the information .
​ To learn more, see the sources I considered: [[1] book_appointment doesn’t send phone attribute to cal](https://discord.com/channels/1186424376300679209/1329010496765956206) [[2] CAL Issues And Questions](https://discord.com/channels/1186424376300679209/1348768358031687771) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@User Where do i prompt it. In the node? or node before that ?
@AI Evy Where do i prompt it. In the node? or node before that ?
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer You should prompt the agent to include the phone number in the same node where the booking function is called (the book appointment cal node) . The documentation recommends updating the prompt for the function node itself to explicitly instruct the agent when and how to invoke the booking function, such as:
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
You can expand this in your node instruction to specify all required fields, for example: "When user has provided a slot, name, and phone number, please book the appointment by calling the
book_appointment
function and include the phone number." This ensures the instruction is present at the point where the booking function is actually triggered, which is inside the function node [(1) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Book Calendar](https://docs.retellai.com/build/book-calendar) ​
a
@AI Evy its still sending this { "time": "Tuesday 2pm", "name": "John Smith", "email": "johnsmith@gmail.com" } not the email
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer You need to update the prompt in the node where the book_appointment function is called to explicitly instruct the agent to include the phone number in the function call. The LLM may not include the phone variable unless you clearly tell it to do so. A user with the same problem fixed it by adding a line like this to the instruction: “Important: Always transfer the date/time, email, name, and telephone number to the functions with each call.” This prompt should be in the function node itself where the booking happens [(1) ]() . If your JSON output still doesn’t include the phone number after this change, double-check that the phone variable is actually collected and available as a dynamic variable in your flow before the booking node [(2) ]() , [(1) ]() .
​ To learn more, see the sources I considered: [[1] book_appointment doesn’t send phone attribute to cal](https://discord.com/channels/1186424376300679209/1329010496765956206) [[2] Book Calendar](https://docs.retellai.com/build/book-calendar) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy heres the tool result : tool_call_id: tool_call_47d4a2 {"error":"Error calling Cal Booking API: Axios Error: error code: ERR_BAD_REQUEST, error message: Request failed with status code 400\nresponse status: 400\nresponse data: [{\"message\":\"1\",\"data\":null},\"custom in 'responses': {attendeePhoneNumber}error_required_field\"]"} here's the Tool Invocation: book_appointment_cal tool_call_id: tool_call_47d4a2 { "time": "Tuesday 2pm", "name": "John Smith", "email": "johnsmith@gmail.com" } Then heres the book appointment cal node prompt Im booking your appointment right now bear with me as i add you to the system. Always transfer the date/time, email, name and telephone number to the functions with each call .Also when you get a result and it isnt succesful then ask the patient for their detail which is missing which is making the booking unsuccessful. So what do i need to fix
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer The error message indicates that Cal.com is expecting a required field called attendeePhoneNumber (or similar) , but your tool invocation does not include a phone number field in the payload. Your JSON only has time, name, and email. To fix this: 1. Ensure the phone number is collected and stored as a dynamic variable before the booking node. 2. Update your prompt in the book appointment cal node to clearly instruct the agent to include the phone number field in the function call. Example:
Copy code
When user has provided a slot, name, and phone number, please book the appointment by calling the `book_appointment` function and include the phone number as attendeePhoneNumber.
3. Confirm the function call includes the phone number variable in the correct format and with the correct key (likely attendeePhoneNumber) . The payload should look like:
Copy code
json
   {
     "time": "Tuesday 2pm",
     "name": "John Smith",
     "email": "johnsmith@gmail.com",
     "attendeePhoneNumber": "+15551234567"
   }
Replace +15551234567 with your collected variable. If you still get errors, double-check the exact field name Cal.com expects for the phone number and ensure your dynamic variable is populated at runtime [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Book Calendar](https://docs.retellai.com/build/book-calendar) [[2] My agent often gives wrong answers when I try to arrange (test) booking. Calender settings are all c](https://discord.com/channels/1186424376300679209/1348311726898151505) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@User Maybe i need to collect the phoen number before as a extracted response dynamic variable so how do i do that in convo flow function
@AI Evy Maybe i need to collect the phoen number before as a extracted response dynamic variable so how do i do that in convo flow function
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer To collect the phone number as a dynamic variable in Conversation Flow, add an "Extract Dynamic Variable Node" before your booking node. In this node: 1. Set up a variable with: - Variable Name: e.g., phone_number - Description: e.g., "User's phone number" - Variable Type: Text (since phone numbers are text) 2. Place this node in your flow before the booking node so the agent asks for and extracts the phone number from the user. 3. In your booking node, reference the dynamic variable (e.g., {{phone_number}}) so it gets passed in the function call. This ensures the phone number is collected and available as a variable when booking the appointment [(1) ]() , [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
a
@AI Evy Im talking about this Response Variables Extracted values from API response saved as dynamic variables.New key value pair
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer To use response variables extracted from an API response as dynamic variables in Retell AI, you need to save the values from the API response as key-value pairs and make sure they are assigned to dynamic variables using the double curly braces syntax (e.g., {{phone_number}}) . These variables can then be referenced in subsequent nodes or function calls within your Conversation Flow [(1) ]() . When you extract a value from an API response, set it as a dynamic variable by assigning it to a new key (e.g., "phone_number") in your flow configuration. This allows you to use that value later in prompts or tool calls by referencing {{phone_number}} . Make sure all values assigned to dynamic variables are strings, as numbers or other data types are not supported for dynamic variables in Retell AI .
​ 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.
a
@AI Evy its not working man. Its still sending email,time,name not phoen number. So whats happneing is that
a
Thanks for the follow-up, @aaryan._t. I'll get back to you soon.
### Answer If your tool call is still not including the phone number—even after collecting it as a dynamic variable and updating your node prompt—there are two likely causes according to the documentation: 1. The phone number variable might not be actually set (populated) before the booking function is called. Double-check that the dynamic variable (e.g., {{phone_number}} or whatever key you are using) is definitely being collected and assigned a value earlier in your conversation flow. You can test this by outputting the variable in a debug prompt or message before the booking step to confirm it has a value [(1) ]() . 2. The booking function may require the phone number field to be sent with a specific key name (such as attendeePhoneNumber) . Your prompt should explicitly instruct the agent to include the phone number in the function call under the correct key. For example: "When user has provided a slot, name, and phone number, please book the appointment by calling the book_appointment function and include the phone number as attendeePhoneNumber." The payload should look like:
Copy code
json
{
  "time": "Tuesday 2pm",
  "name": "John Smith",
  "email": "johnsmith@gmail.com",
  "attendeePhoneNumber": "+15551234567"
}
Make sure your dynamic variable is referenced with the correct key in the function node [(2) ]() . If you have verified both steps and it's still not working, confirm that your dynamic variable name matches exactly between where it is set and where it is referenced, and that all values are strings [(1) ]() . If the field is missing, Retell AI will leave the variable in curly braces (e.g., {{phone_number}}) , which means it was never set .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Book Calendar](https://docs.retellai.com/build/book-calendar) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.