? Is this the correct workflow structure for an AI Dental Clinic Booking Agent

​Hi everyone! :waving_hand:

​I built an automated AI Booking System for dental clinics using n8n, Gemini API, Google Calendar, and Google Sheets.

​Workflow Goal:

  • ​Handle patient inquiries 24/7 using Gemini API.
  • ​Check availability and automatically book appointments in Google Calendar.
  • ​Log patient details into Google Sheets.

​My Question:

Is this the correct and optimal workflow structure for this use case? Are there any potential edge cases, errors, or best practices I should keep in mind to improve reliability?

​Here is my workflow screenshot below. I would really appreciate your feedback and advice! :rocket:

1 Like

The overall components are reasonable for a prototype, but the workflow as pictured has one immediate wiring problem: Send WhatsApp Reply (Green API) is disconnected. The WhatsApp trigger can reach the agent, but the agent’s main output cannot reach that send node, so this path cannot return the reply to WhatsApp as shown. The Chat Trigger’s response behavior does not send a Green API message.

Normalize both triggers before the agent into the same fields, for example channel, conversation_id, patient_id, text, and reply_to. Their incoming payloads are different. Also set Simple Memory’s session key from the real conversation ID, not a fixed value, or one patient’s context can be reused for another patient.

For booking, do not leave availability check, event creation, and Sheets logging as independent tools that the model can call in any order. Put them in one bounded booking sub-workflow: validate the patient and requested time, check availability, ask for explicit confirmation, recheck the slot, create the Calendar event, then log only after Calendar returns an event ID. Use a stable booking-request ID so a retried WhatsApp message cannot create the same appointment twice.

Route ambiguous dates, unavailable slots, missing identity, tool errors, and any medical or urgent-symptom question to a human. During testing, require human approval for the calendar-create tool. The bot should handle administration and booking, not clinical advice.

Official n8n references:

1 Like

Hello!

I agree with Cloudrocket’s comments about the disconnected WhatsApp reply node, the need to use the actual conversation ID for memory, and moving the booking process into a separate bounded sub-workflow with confirmation, an availability recheck, and idempotency.

I would add three points.

  1. A deterministic completeness and validation gate is needed before checking availability.

The LLM can extract the known information, but the workflow should check whether it is sufficient. If required information is missing or ambiguous, the agent should ask a specific clarification question and should not call Calendar until the booking request is fully formed.

  1. Valid slots should be generated outside the LLM.

Similar to booking an appointment at a barbershop, the duration of the appointment slot depends on the service the patient requires. The workflow should obtain the duration from the clinic’s service catalog, check the schedule of an appropriate dentist and any required resources, and then provide the LLM with only the available options.

  1. The booking state should be stored separately from Simple Memory, and partial failures should be handled.

I would store an explicit state such as COLLECTING_DETAILS → SLOT_OFFERED → CONFIRMED → BOOKED, as well as the booking request ID and the Calendar event ID. If Calendar creates the event but the following Sheets write fails, the workflow should use the returned event ID to reconcile and resume from that partial state instead of creating the Calendar event again.

1 Like

saw this is using google sheets (log_patient, append) for the patient logging, just a heads up that’ll bite you in prod. sheets rate limits are brutal, you’ll start hitting “rate limit exceeded / too many requests” once you get any real volume, especially since it’s sitting behind an ai agent that could call it multiple times per convo.

swap it for an actual db, postgres or airtable both handle concurrent writes way better. or honestly just use n8n’s own Data table node if you don’t want to spin up external infra, it’s built in, doesn’t hit any external api so no rate limit issues, and it’s noticeably faster than round-tripping to sheets every time. way more reliable for something sitting behind a live whatsapp agent

Hi Ab123,

Your workflow structure looks solid for a basic setup, but for a live Dental Clinic, you will run into 3 major production edge cases that will break the system:

  1. Timezone Misalignment: Gemini often extracts dates/times in a format that Google Calendar misinterprets (e.g., booking in UTC instead of your local timezone). You need a custom JavaScript Code Node to clean and format the ISO string before the Calendar node.
  2. Slot Overlapping (Double Booking): Your current flow lacks a verification step. If two patients request 3:00 PM, Gemini will book both. You need to integrate the Google Calendar “Free/Busy” API tool inside the AI Agent so it can check real-time availability before confirming.
  3. Google Sheets Logging Race Condition: If multiple webhooks hit simultaneously, your sheet logging will glitch or overwrite.

I help businesses build production-ready AI Booking Agents over n8n. If you want, you can paste your workflow JSON code right here over chat, and I will fix these expressions and add the availability-check tool for you.

Let’s fix this here over chat!

1 Like

​"Thank you so much @DonitoVito for these super valuable insights!
​Regarding the disconnected WhatsApp node, I deliberately kept it disconnected for now as I’m currently just testing and playing around with the logic in the internal chat.
​You spotted key points that will definitely make the workflow much more robust. I will make sure to:
​Connect the WhatsApp reply node properly and pass the conversation ID for memory once I move past local testing.
​Implement a validation gate to ensure all required patient details are present before triggering the Calendar tool.
​Separate the availability check into a bounded sub-workflow to avoid LLM hallucinations on valid slots.
​Really appreciate you taking the time to review this!"

الموضوع:‏ n8n Community: ? Is this the correct workflow structure for an AI Dental Clinic Booking Agent

1 Like

​"Thanks @Mehdi_Belkassi for the heads-up!
​That makes total sense regarding Google Sheets rate limits in production. I’m currently using Sheets just as a quick visual interface for the demo/prototype stage, but I really like your suggestion of switching to n8n’s built-in Data Table (or Airtable/Postgres) for live deployment to ensure zero rate limit issues and better speed.
​Appreciate the solid advice!

الموضوع:‏ n8n Community: ? Is this the correct workflow structure for an AI Dental Clinic Booking Agent

1 Like

Thanks @Mehdi_Belkassi for the heads-up!

​That makes total sense regarding Google Sheets rate limits in production. I’m currently using Sheets just as a quick visual interface for the demo/prototype stage, but I really like your suggestion of switching to n8n’s built-in Data Table (or Airtable/Postgres) for live deployment to ensure zero rate limit issues and better speed.

​Appreciate the solid advice!"

1 Like

​"Wow, @Cloudrocket, thank you so much for taking the time to write such a comprehensive and detailed breakdown! This is immensely helpful.

​You highlighted critical architecture improvements—especially normalizing the incoming payloads, securing the session memory with unique conversation IDs, and grouping the booking steps into a bounded sub-workflow to prevent duplicate entries and hallucinated slots.

​Also, adding human fallback for clinical questions and implementing human approval for calendar writes during testing are brilliant tips for production safety.

​I’m currently testing the base logic via internal chat, but I’m restructuring my setup step-by-step based on your exact guidelines. Thanks again for pointing me in the right direction!"

I made a gadget that can discover in advance what problems exist in your workflow, so you can experience it.Before handing an n8n workflow to a client, how do you review it? I built a free tool for that

The structure is sound for a prototype. The diagram attached shows the version I’d take to production, and these are the points that matter most:

1. Check for duplicates first. WhatsApp can resend a message, so store each message_id and stop if you’ve seen it. Otherwise one patient can end up with two bookings.

2. Let the agent only detect intent. Book, change, cancel or question. It shouldn’t write to the calendar directly.

3. Put booking in one controlled sub-workflow. Validate the details, check the slot, ask the patient to confirm, then create the Google Calendar event. Reply to the patient only after the event exists.

4. Log state, not conversations. Store the event ID and the minimum patient data (name, phone, service, slot). Keep symptoms and free-text health details out of the log.

5. Send urgent or unclear messages to a human. The bot handles scheduling, not clinical advice.

6. Plan for failures. On any error, retry, then send the patient a fallback message and alert the clinic, so nobody is left waiting in silence.

7. Check outcomes daily. Compare bookings created against replies sent. A run that looks green but sent no reply is the failure you won’t see otherwise.

If you’d rather not run this side yourself, Pond AI builds, runs and maintains custom agents like this, and maps the architecture with you before you commit. There’s a 7-day refund too.

Disclosure: I’m affiliated with Pond AI.

I have a question, is each clinic on its own calendar, or will several clinics share one workflow?