Help me to build a error-free chatbot

Hi @Raseck ,

I’ve shared your use case with Pond AI team. They’d be happy to discuss your current setup, especially the appointment availability and booking errors, and map out a cleaner hybrid architecture for all six use cases.

You can reach out directly to nihar@joinpond.ai to get things started.

Feel free to contact the team and ask for a free architecture blueprint tailored to your clinic’s workflow, which you can keep and implement yourself. And if you decide to have the team build it, every custom project comes with a 7-day refund policy.

  • Regards

@Raseck, one thing I haven’t seen discussed much in this thread is what happens to patient information as it moves between WhatsApp, the AI Agent, Google Sheets and your sub-workflows.

Since this is for a medical clinic, I would be careful about treating the chat history as ordinary conversational memory. A patient might mention symptoms, contact details or other personal information while asking about an appointment. You don’t want that information unnecessarily carried into another patient’s conversation, exposed in execution logs, or stored indefinitely just because the AI Agent needs some context.

I would separate the information into two layers. The first is the minimum operational context the bot needs to complete an action, such as the patient’s verified identifier, requested service, appointment date and current booking status. The second is the actual conversation content. Only pass the first layer between scheduling tools unless a specific FAQ genuinely needs more context.

I would also make sure every incoming WhatsApp message is associated with the correct patient session, and that the workflow never retrieves another patient’s previous conversation as fallback context. In n8n, this means being deliberate about the session key, the data passed into each sub-workflow, and what gets written to Google Sheets. Avoid putting sensitive patient details into error notifications, and define who can access execution history and how long it is retained.

The goal is not just to make the chatbot answer correctly. It is to make sure it answers the right patient without exposing someone else’s information. I would also keep medical advice outside the AI’s decision-making scope and provide a clear route to clinic staff whenever a question goes beyond appointment administration and approved FAQs.

I am affiliated with Pond AI. Pond AI builds, runs and maintains custom AI agents, and we map the architecture for free. You can keep that plan and give it to any developer to implement. A seven-day refund applies if you choose to have Pond AI handle the build.

How are you currently separating each patient’s conversation memory from the information your scheduling tools need?

Small reframe that might save you a lot of grief: there’s no such thing as an error-free chatbot, and chasing one is how these builds stall. LLM calls time out, APIs rate-limit, and the model occasionally returns something that doesn’t parse. The goal isn’t zero errors, it’s a bot that fails without falling over.

What usually breaks quietly, in order: the model returns text when you expected JSON and a downstream node chokes on it; a tool/API call hangs and takes the whole conversation down with it; or the LLM throws a transient error and there’s no retry, so the user just gets silence.

Three moves fix most of that. Force structured output and validate it before anything downstream touches it, so a malformed answer is caught, not propagated. Wrap every external call in a retry with a timeout, because most LLM/API failures are transient and a second attempt just works. And give the bot a fallback reply for when something genuinely fails, so the user sees “give me a second, I’m having trouble with that” instead of a dead end.

Then lean on n8n’s own Error Trigger workflow to catch anything that slips past, log what broke, and alert you, rather than discovering failures from an annoyed user. Keeping the conversation flow separate from the tool-calling logic also means one flaky integration can’t kill the whole chat.

Quick disclosure: I’m affiliated with Pond AI, we build, run and maintain custom AI agents. If it’s handy we’ll map out the resilience architecture for you for free, and it’s yours to keep no matter what, run it yourself or give it to whoever you like; we only take on risk through a 7-day refund if you end up building it with us.

What’s the single failure that’s biting you most right now, the parsing, the timeouts, or the model going off-script? The fix is pretty different for each.

Hi Raseck , the split between “AI decides intent, code decides facts” above is the right fix for your date and slot errors. Three things I haven’t seen mentioned yet, specific to a clinic:

  1. Check the slot again at the moment of booking. Between showing options and the patient tapping one, someone else (or another chat) can take it. In the booking sub-workflow, re-check that the slot is still free right before creating the event, and if it isn’t, offer the next options instead of failing. Also give each booking a key (patient number plus slot), so a retry or a double tap creates one event, not two.
  2. Reschedule and cancel need the right appointment. A patient may have more than one. Look the appointment up from the sender’s own number, show which one you found (“Thursday 14 Nov at 10:00, correct?”), and only change it after a tap on confirm. Never reveal or change an appointment that isn’t tied to the number that is writing.
  3. Set limits for a medical context. Add a rule that stops booking and hands over to a person, or gives the clinic’s urgent-contact instructions, when a message mentions urgent symptoms, pain or an emergency. Keep FAQ answers to text the clinic has approved, and have the bot decline to give medical advice. These checks are easy to add in code before the AI answers.

Disclosure: I’m affiliated with Pond AI. We build custom AI agents and workflows, and we start with a free architecture plan you keep whatever you decide, with a 7-day refund on custom builds.

Does the clinic have one shared calendar for all doctors, or a separate calendar for each?

Disclosure: we’re the Wafly team. If the clinic can accept a non-official WhatsApp connection, with number restriction risk, Wafly is a managed REST/webhook option for an existing n8n flow. It replaces the transport layer, not your booking logic, AI, hosting or staff inbox. It won’t fit an official-only requirement. Would that type of alternative be relevant to your comparison?