https://retellai.com/?utm_source=discord&utm_medium=seo logo
i need help with fixing email variable problem bec...
# ❓・ai-evy-support
p
@AI Evy i need help with fixing email variable problem becuase it's there during conversation but when booking cal.com node is called it's not there so booking fails
a
Thanks for tagging me @pop123450530. I'll look through relevant sources and get back to you shortly.
### Answer This is a common issue with Cal.com booking integration in Retell AI. For the Cal.com booking function to work properly, you need to ensure the agent explicitly collects the email address during the conversation [(1) ]() . Based on the documentation, here's how to set up the Cal.com booking function correctly: 1. Configure the booking function with your Cal.com API key and event type ID 2. Update your prompt to explicitly instruct when to call the booking function. The documentation recommends including this in your prompt :
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
3. Ensure email collection - The agent must collect the customer's email address during the conversation before attempting to book [(2) ](

▾

) . Cal.com requires an email address for booking appointments [(3) ](

▾

) . If you're using dynamic variables, make sure the email variable is properly set as a default dynamic variable in your LLM configuration [(4) ]() . You can see an example in the API response structure where
default_dynamic_variables
includes customer information like
"customer_name": "John Doe"
. The booking function expects the email to be available when called. If the email variable isn't being passed through, check that: - The agent is actually collecting the email during conversation - The email is stored in the correct variable format - Your prompt instructs the agent to collect email before booking You can also check the tool invocation logs in your call history dashboard to see exactly what data is being passed to the booking function [(5) ]() .
​ To learn more, see the sources I considered: [[1] Book Calendar](https://docs.retellai.com/build/book-calendar) [[2] Retell AI - How to use Cal.com Custom Field](

https://www.youtube.com/watch?v=b59o1YCcvjc▾

) [[3] MASTER THE FUTURE OF VOICE AI - Never Miss Another Appointment](

https://www.youtube.com/watch?v=Fpw3Yrg3JoY▾

) [[4] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[5] Email variable not making it to Cal.com book function](https://discord.com/channels/1186424376300679209/1358927987193413853) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy ok can you look at screenshots?
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer I can't see any screenshots in this Discord thread. To help you troubleshoot the Cal.com email variable issue, I'd need to see the specific screenshots you're referring to. However, based on the common issues documented, here are the key areas to check for email variable problems with Cal.com booking: 1. Dynamic Variable Configuration Make sure your email variable is properly set in the
retell_llm_dynamic_variables
field [(1) ]() . All values must be strings . 2. Tool Invocation Logs Check your call history dashboard to see exactly what data is being passed to the booking function [(2) ]() . This will show if the email variable is reaching the Cal.com function. 3. Prompt Instructions Ensure your prompt explicitly tells the agent to collect email before booking [(3) ]() :
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
4. Variable Extraction If using Conversation Flow, verify your Extract Dynamic Variable Node is properly configured to capture the email as a "Text" type variable [(4) ]() . Could you share the screenshots you mentioned? That would help me provide more specific guidance for your particular setup.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Email variable not making it to Cal.com book function](https://discord.com/channels/1186424376300679209/1358927987193413853) [[3] Book Calendar](https://docs.retellai.com/build/book-calendar) [[4] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy ok can you give me posts or chats where people had the same problem where the email is in the variable in retell but when running book appointment node it doesn't populate it
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer Based on the Discord discussions I have access to, here are posts where people experienced similar issues with the book appointment function: Cal.com Integration Issues: In one Discord thread, @jarek_88513 specifically asked about passing values from Retell AI to custom parameters defined in Cal.com, stating: "How to pass values from Retell AI to custom parameters defined in Cal.com under Event types / Advanced. I defined a few ones there, and I do see them when using Cal.com booking form. Now I want to pass some data to them from Retell AI. How to do it?" [(1) ]() Book Appointment Function Failures: @burza1843 reported a specific error with the book_appointment function in conversation flow: "I'm encountering an issue where my book_appointment function fails in the conversation flow, returning the following error: {"error":"Error calling Cal Event Type API: Axios Error: error code: ERR_BAD_REQUEST, error message: Request failed with status code 400\nresponse status: 400\nresponse data: [{"message":"1"},"no_available_users_found_error"]"}" [(2) ]() The solution provided by @sanava.ai was to use the
{{current_time}}
dynamic variable in the prompt: "You can say something like: This is today's date and time: {{current_time}}. Please consider this in checking calendar availability and booking." Conversation Flow Booking Issues: @jayzpio experienced similar problems: "can't seem to get the book appointment on cal function to work for the conversation flow agent... anyone got any tips" and "not only cal.com, on retell the book_appointment function doesn't work inside the conversation flow..." [(3) ](
21) Common Pattern: The recurring issue appears to be that dynamic variables work during conversation but don't properly pass through to the Cal.com booking function. The documentation shows that dynamic variables should be set in the
retell_llm_dynamic_variables
field where all values must be strings [(4) ]() . For your specific email variable issue, ensure you're using the correct dynamic variable syntax
{{email}}
in your tool description and that the email is properly extracted during the conversation before the booking function is called .
​ To learn more, see the sources I considered: [[1] Discord message from @chaddperry on 2025-05-28](https://discord.com/channels/1186424376300679209/1294891368505937952/1377418397385490494) [[2] Issue with book_appointment function](https://discord.com/channels/1186424376300679209/1341725205445476413) [[3] Discord message from @jayzpio on 2025-01-31](https://discord.com/channels/1186424376300679209/1294891368505937952/1334946038955376721) [[4] 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.
p
@AI Evy ok so i made a custom function that is connected to mmy webhook in make.com that is also activated when the survey is submitted and then it recieves the information from that survey like answers from the questions and also it has those email and name variables but since email is populated in retell but not when calling the booking appointment in the conversation i made that custom function that will add it to the conversation extra
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer That sounds like a good workaround approach! Using a custom function connected to your Make.com webhook to retrieve the email and name variables should help solve the issue where the email is available in Retell but not passed to the booking appointment function. Based on the documentation, here are key points to ensure your custom function works properly: Custom Function Configuration: 1. Set response variables to extract the email and name from your Make.com webhook response and save them as dynamic variables [(1) ]() . For example, if your webhook returns:
Copy code
json
{
  "email": "user@example.com",
  "name": "John Doe"
}
You can extract these values and reference them later using
{{email}}
and
{{name}}
. 2. Configure speech behavior - Enable "Speak after execution" so the agent can continue the conversation and use the retrieved data for booking [(1) ]() [(2) ]() . Webhook Response Handling: From the Discord discussions, there's a common issue where custom function webhook responses aren't being read by the agent [(3) ]() . The solution is to use the returned data as dynamic variables rather than expecting the agent to speak the response directly . Integration with Booking: Your approach of using a custom function to populate the email variable before calling the booking function should work. The custom function can retrieve the survey data from Make.com, set the email as a dynamic variable, and then the booking function should have access to
{{email}}
[(4) ]() . Troubleshooting: If the agent isn't using the webhook response data, make sure you're extracting the response values as dynamic variables in the custom function configuration, then referencing those variables in your booking function or prompt [(3) ]() . This workaround should resolve the issue where the email variable exists in Retell but doesn't get passed to the Cal.com booking function.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Custom function webhook](https://discord.com/channels/1186424376300679209/1361887355916648599) [[4] Calling Webhooks In The Middle of A Call](https://discord.com/channels/1186424376300679209/1376986877927886979) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy what transition to put in that custom function node that will later to lead to book appointment node
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer Based on the documentation, for your custom function node that retrieves email data to later lead to the book appointment node, you'll want to set up the transition based on the function result [(1) ]() . Transition Configuration: Since the custom function node will retrieve the email and name variables from your Make.com webhook, you can create a transition condition that checks if the function executed successfully . Here are the recommended approaches: 1. **Wait for Result Setting**: Enable "wait for result" in your custom function node so the agent waits for the function to finish executing before attempting to transition . This guarantees that when you reach the next node, the email data is already available . 2. **Transition Condition**: You can write your transition condition to be based on the function result . For example: - **Success condition**: "Email data retrieved successfully" or "Function completed" - **Failure condition**: "Function failed" (to handle error cases) 3. **Function Result Timing**: With "wait for result" enabled, the agent will transition once the function result is ready . If you also have "speak during execution" turned on, the agent will transition once the function result is ready and the agent is done talking . Recommended Setup: - Enable "Wait for Result" in your custom function node - Set the transition condition to check for successful data retrieval - Connect the success edge to your book appointment function node - Optionally, create a failure edge that handles cases where the webhook doesn't return the expected data This ensures the email variable is properly populated from your Make.com webhook before the booking function is called, solving your original issue where the email was available in Retell but not passed to the
booking appointment function.
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy also this is the body i have in that custom function { "type": "object", "properties": { "name": { "type": "string", "description": "Full name of the client." }, "email": { "type": "string", "description": "Email address of the client." }, "time": { "type": "string", "description": "The date and time of the consultation in ISO 8601 format." } }, "required": [ "time", "name", "email" ] }
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer Your custom function body looks correct for collecting the required parameters [(1) ]() . However, there are a few important considerations for making this work with your booking flow: Parameter Schema Issues: The schema you've provided requires the agent to pass
name
,
email
, and
time
as parameters to your custom function . But based on your description, you want to retrieve these values from your Make.com webhook, not have the agent provide them as input parameters. Recommended Approach: If you're retrieving data from your Make.com webhook (rather than having the agent provide the data) , you might want to simplify your parameter schema or remove the required fields entirely . For example:
Copy code
json
{
  "type": "object",
  "properties": {},
  "required": []
}
Response Variables Configuration: The key part is setting up response variables to extract the data from your Make.com webhook response and save them as dynamic variables . In your custom function configuration, you'll want to extract values from your webhook response and save them as dynamic variables like
{{name}}
,
{{email}}
, and
{{time}}
[(2) ]() . Dynamic Variable Usage: Once your custom function executes and saves the response as dynamic variables, you can reference them later using the double curly brace syntax . This should make the email variable available for your booking appointment node. Potential Issue: From the Discord discussions, there's a known issue where dynamic variables sometimes don't get passed correctly to custom functions [(3) ]() . Make sure your Make.com webhook returns the data in a format that can be extracted as response variables in your custom function configuration [(1) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] custom function unable to read dynamic variables as payload's input](https://discord.com/channels/1186424376300679209/1351866528680902697) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy ok then change my prompt if it's needed because yes i want that custom function to retrive those variables and then for next step to pass it to booking node so that node actually works
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer Based on your setup, here's how to modify your custom function and prompt to properly retrieve variables and pass them to the booking node: 1. Modify Your Custom Function Parameter Schema: Since you want to retrieve data from your Make.com webhook (not have the agent provide it) , simplify your parameter schema [(1) ]() :
Copy code
json
{
  "type": "object",
  "properties": {},
  "required": []
}
2. Configure Response Variables: In your custom function configuration, set up response variables to extract the data from your Make.com webhook response and save them as dynamic variables . For example, if your webhook returns:
Copy code
json
{
  "name": "John Doe",
  "email": "john@example.com", 
  "time": "2024-12-15T14:00:00Z"
}
Extract these values and reference them later using
{{name}}
,
{{email}}
, and
{{time}}
[(2) ]() . 3. Update Your Prompt: Include explicit instructions for when to call your custom function and the booking function [(3) ]() . Here's a recommended prompt structure:
Copy code
When the user is ready to book an appointment, first call the `retrieve_client_data` function to get their information from the system. After successfully retrieving the client data, proceed to book the appointment by calling the `book_appointment` function.
4. Function Call Sequence: Based on the documentation, it's best to include in the prompt explicitly when to invoke custom functions [(3) ]() [(4) ]() . Your prompt should guide the agent through this sequence: 1. Call your custom function to retrieve client data 2. Wait for the function result 3. Then call the booking function with the retrieved variables 5. Enable "Wait for Result": Make sure to enable "wait for result" in your custom function node so the agent waits for the function to finish executing before attempting to transition to the booking node [(1) ]() . This approach should resolve the issue where the email variable exists in Retell but doesn't get passed to the Cal.com booking function.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Book Calendar](https://docs.retellai.com/build/book-calendar) [[4] Check Calendar Availability](https://docs.retellai.com/build/check-availability) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@AI Evy modify it for me { "type": "object", "properties": { "name": { "type": "string", "description": "Full name of the client." }, "email": { "type": "string", "description": "Email address of the client." }, "time": { "type": "string", "description": "The date and time of the consultation in ISO 8601 format." } }, "required": [ "time", "name", "email" ] }
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer Based on your requirement to retrieve data from your Make.com webhook (rather than having the agent provide it) , here's the modified parameter schema [(1) ]() [(2) ]() :
Copy code
json
{
  "type": "object",
  "properties": {},
  "required": []
}
[(1) ]() , [(2) ]() Why this change: Since you want your custom function to retrieve the
name
,
email
, and
time
from your Make.com webhook response, you don't need the agent to provide these as input parameters [(1) ]() . Instead, you'll extract these values from your webhook response using the response variables configuration . Next steps: 1. Configure response variables in your custom function to extract values from your Make.com webhook response and save them as dynamic variables 2. Set up your Make.com webhook to return the data in a format that can be extracted, such as:
Copy code
json
   {
     "name": "John Doe",
     "email": "john@example.com",
     "time": "2024-12-15T14:00:00Z"
   }
3. Extract and reference these values later using
{{name}}
,
{{email}}
, and
{{time}}
[(3) ]() This approach ensures your custom function retrieves the client data from Make.com and makes it available as dynamic variables for your booking appointment node [(3) ]() [(1) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] 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.
p
@AI Evy this is the data i get from webhook
a
Thanks for the follow-up, @pop123450530. I'll get back to you soon.
### Answer I can see you mentioned you get data from your webhook, but I don't see the actual webhook data in your message. Could you share what data structure your Make.com webhook is returning? Based on the documentation, once you have the webhook response data, you'll need to configure response variables in your custom function to extract the values and save them as dynamic variables [(1) ]() . For example, if your Make.com webhook returns data like:
Copy code
json
{
  "name": "John Doe",
  "email": "john@example.com", 
  "time": "2024-12-15T14:00:00Z"
}
You would extract these values in your custom function's response variables configuration and then reference them later using
{{name}}
,
{{email}}
, and
{{time}}
[(2) ]() . The key is ensuring your webhook response format matches what you're trying to extract as dynamic variables [(1) ]() . Once you share the actual webhook data structure, I can provide more specific guidance on how to configure the response variables extraction.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] 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.