The ai agent should be able to extract from the get many events [check avaliability] calendar tool which pulls up all existing events [booked times] if the caller requested times slots for an entire day (between business hours). The output to the return webhook does not reflect what the google calendar tool found. It will list the open slots that dont have an event, but it will also include 1-3 times the had an event found.
What is the error message (if any)?
No error messages. I have retell ai connected to the workflow via webhook. The workflow uses an ai agent (gpt 4.1) along with 4 google calendar tools to do the following functions: [check availability through get many events, booking through create event, cancel through delete event, and reschedule which gets an event to identify the original appointment]
The issue is for day requests or time of day requests for checking availability (ex: “how about next tuesday” “what’s open Monday morning?”] the open ai agent is not able to reason consistently. If my calendar is mostly full for a specific day, the bot will respond with a couple of booked times in addition to the open times.
Hi there @Uku_Pyle , welcome to the community, glad to have you here
i would suggest for you to split the Check availability into 2 tools
1 to check the availability, as in it only outputs the empty time
and the other to check for existing bookings
because this is what i implement for my Retell x n8n ai voice agent
it’s way easier to maintain, and the separation of concern between the 2 is also makes it better
the check for existing bookings tool will only function for the rescheduling and cancelling, while the check availability will only function for the book appointment
Hey @Uku_Pyle, welcome to the community
First of all, you’re building a good one, keep going!
The reason you’re getting some booked times mixed into the free slots is that the AI agent isn’t filtering the Google Calendar results by itself. The “Get Many Events” node gives you all the booked events, but you still need to compare those with your business-hour slots before sending a final list back.
Best way to handle it:
After the Check Availability node, add a Code node. In there, loop through your fixed business-hour slots and remove any that overlap with events returned by Google Calendar.
Pass only the clean free slots forward to your AI agent or webhook.
Keep your prompt short and clear: “Only return slots that have zero conflicts. If there’s a conflict, don’t list it.”
This way, n8n handles the filtering, not GPT, so the responses stay consistent.