https://retellai.com/?utm_source=discord&utm_medium=seo logo
I’m experiencing a persistent issue with my Retell...
# ❓・ai-evy-support
r
@AI Evy I’m experiencing a persistent issue with my Retell voice agent integration with Cal.com: Problem: When testing via chat, bookings are successful and all data is passed correctly to the Cal.com API. However, when testing via voice/live call, the booking fails every time. The logs show that either the time field is not in ISO 8601 format (e.g., shows as "Tomorrow at 4:30 PM" instead of the full timestamp) and/or the email field is missing, resulting in a Cal.com API 400 error {email}error_required_field. Troubleshooting done so far: Updated the function node/system prompt to very clearly require passing ISO 8601 time, user’s name, and email before calling the booking function. Confirmed that the call flow extracts and saves the ISO time and collects user email. Reviewed logs and verified that extracted values ARE sometimes available, but the function still sends the unformatted string (“Tomorrow at 4:30 PM”) and often a blank email. Bookings always succeed in chat, but never via live/voice. Request: Can you advise on why the extracted ISO time and email are not reliably being mapped/passed to the booking API during voice calls? Is there a known issue with variable mapping in voice flows, or specific steps to ensure the correct (extracted) variables are used as API arguments? Any guidance or debug strategies appreciated.
a
Thanks for tagging me @reyrj8145. I'll look through relevant sources and get back to you shortly.
### Answer Looking at your issue with variable mapping in voice calls vs chat, there are several configuration aspects in Retell AI that could affect how function arguments are passed to your Cal.com booking API. For function nodes, the timing of when transitions happen is crucial [(1) ]() . The documentation shows that when
wait for result
is turned on, the agent will wait for the function to finish executing before attempting to transition to any other node, which guarantees that when you reach the next node, the result is already ready to be used . For custom functions, Retell sends a POST request to your endpoint with specific structure [(2) ]() :
Copy code
json
{
  "name": "the name of the custom function",
  "call": "the call object for you to get more context about the call, it also contains real time transcript up to the time the request is sent",
  "args": "the arguments for the custom function, as a JSON object"
}
The key difference between chat and voice calls might be related to how the LLM processes and formats the arguments. For voice calls, you should ensure your function parameter schema is properly defined using JSON schema format :
Copy code
json
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "The city of the weather"
    }
  },
  "required": [
    "city"
  ]
}
For your specific case with ISO 8601 formatting and email extraction, make sure your parameter descriptions are very explicit about the expected format. The documentation emphasizes that it's best to include in the prompt explicitly when is the best time to invoke the custom function . Since you mentioned the extracted values are sometimes available but not reliably passed, this could be related to the LLM model configuration. You can set
tool_call_strict_mode
to
true
when using GPT-4o or GPT-4o mini models, which uses structured output to ensure tool call arguments follow the JSON schema [(3) ]() [(4) ]() . I don't have specific documentation about known issues with variable mapping differences between voice and chat flows. For debugging this specific integration issue, I'd recommend: Visit [Contact Sales]() or [) for more detailed troubleshooting support. Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[4] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @reyrj8145. I'll get back to you soon.
r
@AI Evy Thank you. Can you give me a working sample prompt?
a
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
### Answer Based on the documentation, here's a working sample prompt for your Cal.com booking function that explicitly instructs when to invoke the custom function [(1) ]() :
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
For your specific Cal.com booking use case, you would adapt this pattern like:
Copy code
When user provides their name, email, and preferred appointment time, please book the appointment by calling the `book_appointment` function. Always ensure the time is converted to ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ) before calling the function.
The documentation shows this example parameter schema for custom functions [(2) ]() :
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
For your Cal.com booking function, you'd want to define parameters with very explicit descriptions about the expected formats [(1) ]() :
Copy code
json
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "User's email address in valid email format"
    },
    "datetime": {
      "type": "string", 
      "description": "Appointment date and time in ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ) "
    },
    "name": {
      "type": "string",
      "description": "User's full name"
    }
  },
  "required": ["email", "datetime", "name"]
}
The documentation emphasizes that it's best to include in the prompt explicitly when is the best time to invoke the custom function .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
Thanks for the follow-up, @reyrj8145. I'll get back to you soon.
r
@AI Evy Explicitly giving the function the ISO 8601 time format doesn't work. I filed a bug report.
a
### Answer I understand your frustration with the ISO 8601 formatting issue in voice calls. Filing a bug report was the right approach since you've identified a specific behavior difference between chat and voice interactions. While you're waiting for the bug to be addressed, here are a few additional troubleshooting steps based on the documentation: For custom functions, you can include headers and query parameters in the request [(1) ]() . If your Cal.com API requires specific headers for authentication or content type, make sure these are properly configured in your custom function setup . The documentation shows that custom functions support different HTTP methods (GET, POST, PUT, PATCH, DELETE) . Ensure you're using the correct method that Cal.com expects for booking appointments. For debugging, you can check the detailed logs which contain error codes and messages [(2) ]() . This might provide additional insight into why the formatting isn't being preserved during voice calls. If the issue persists after the bug fix, you might consider implementing a middleware endpoint that receives the Retell function call and handles the ISO 8601 conversion before forwarding to Cal.com's API. Visit [Contact Sales]() or [) for updates on your bug report.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Debug outbound connection issues](https://docs.retellai.com/reliability/debug-outbound-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.