Use caseAI agentWorkflow automation

Cancelled clinic appointments refilled from the waitlist before the slot goes empty

An agent that spots a cancellation, offers the slot to waitlisted patients who fit, books the first valid yes and keeps treatment details out of messages.

A blueprint, not a client story. The business described is illustrative; the architecture, integrations and trade-offs are real, and this is how I would build it. By Ergini, .

The short version

An AI agent for physiotherapy, dental and specialist clinics that refills cancelled appointments from the waitlist. It notices the cancellation in the practice management system, finds waitlisted patients who fit the treatment, therapist, duration and their stated availability, and offers the slot by WhatsApp or SMS in an order the practice defines. The first valid confirmation is booked and the others are told the slot is gone. Messages carry no treatment details, and medical questions go to the front desk.

Best for
Clinics with several practitioners, a waitlist kept on paper or in a spreadsheet, and cancellations that come in too late to phone around.
Connects to
Practice management system (Cliniko, Jane, Doctolib or a German practice system), WhatsApp Business Platform, Twilio SMS, Google Calendar, Waitlist database
The AI does
Reads patients' free-text replies in any language, tells a plain yes from a conditional one or a medical question, and phrases short offers and follow-ups.
People do
Set the ranking rules, answer anything medical or unusual, and approve offers themselves until the practice trusts the agent with a treatment type.
Built as
AI Agent Development, usually $12K - $30K

The 10:00 slot nobody manages to fill

Consider a physiotherapy practice in Cologne with eight therapists, two people on the front desk and a day that runs from 7:30 to 20:00. Most patients arrive with a statutory prescription for a series of sessions; some pay privately. Two therapists are qualified for manual lymph drainage and three for manual therapy, which matters every time a slot has to be given to someone else.

Cancellations come in all day and through every door: a voicemail at 6:50, a WhatsApp message at 7:10, a click on the online booking page, a patient at the desk who cannot make Thursday after all. The waitlist is a clipboard and a spreadsheet with about sixty names and notes such as 'mornings only', 'wants Lena' or 'prescription from 3 Sep'.

Filling a gap means phoning down that list while the phone keeps ringing and three patients wait at the desk. By the time someone answers, the slot is forty minutes away. The therapist has an empty half hour, the practice loses the fee, and the patient who needed the slot most, often someone whose prescription is close to lapsing, hears about it too late. Dental and specialist clinics lose slots in the same way; only the rules for who should come first differ.

Three offers, two yeses and a question about a knee

The first five minutes after a cancellation, as the patients and the front desk see them, with the calls behind each step. The rules that picked these three patients come after.

Thursday 07:09 to 07:14, WhatsApp and SMS

  1. 07:09: a patient cancels today's 10:00, a 30-minute manual therapy slot with Jonas, through the online booking page.
  2. get_cancellations(since: "07:08")1 cancelled: Thu 10:00-10:30 / Jonas K. / manual therapy / via online booking
  3. rank_waitlist(slot: "Thu 10:00", treatment: "MT", therapist: "Jonas K.")11 waiting for manual therapy / 6 can come at 10:00 / top 3: prescription must start by Monday, series gap reaches 14 days on Friday, asked for Jonas
  4. hold_slot(slot: "Thu 10:00", minutes: 10)placeholder 'held for waitlist' added to the appointment book / visible at the front desk
  5. send_offers(batch: 1, patients: 3)07:10 sent: 2 WhatsApp templates, 1 SMS / no treatment or therapist named
  6. Practice assistant · WhatsApp

    Good morning, this is the practice's automated assistant. An appointment has become free today, Thursday, at 10:00. Reply YES to take it, or NO to stay on the waiting list. It goes to the first person who confirms.

  7. Patient A · WhatsApp

    yes!! can be there at 10

  8. Patient B · SMS

    Yes please

  9. read_reply(patient: "A", text: "yes!! can be there at 10")accept / no conditions
  10. claim_slot(slot: "Thu 10:00", patient: "A", key: "offer-7731-A")claimed 07:11:41 / appointment written to the practice system / placeholder removed
  11. claim_slot(slot: "Thu 10:00", patient: "B", key: "offer-7731-B")refused: slot claimed 07:11:41 by another offer / B keeps their place on the list
  12. Practice assistant · SMS

    Sorry, that appointment has just been taken. You keep your place on the waiting list, and we will message you about the next one.

  13. Patient C · WhatsApp

    Is it normal that my knee is still swollen since Monday?

  14. read_reply(patient: "C", text: "Is it normal that my knee...")medical question / not answered by the agent / handed to the front desk with the thread
  15. Practice assistant · WhatsApp

    I can't answer medical questions, but I have passed your message to the practice team, who will get back to you this morning. The 10:00 appointment has now been taken; you keep your place on the list.

  16. At 07:30 the front desk saw the question with the conversation attached and asked the treating therapist to call before her first patient.
The model read three short replies and recognized one as a medical question. Who was asked, the hold, and which yes won were rules and a database lock. The model never decides who gets an appointment.

Who gets asked first

The order is the practice's policy, written down once and applied by code. For a German practice treating on statutory prescriptions it might look like this.

  1. Leave out everyone who cannot take the slot: a treatment the therapist is not qualified for (the Heilmittel-Richtlinie marks manual therapy and manual lymph drainage as needing completed further training), a session length that does not fit, such as a 60-minute lymph drainage in a 30-minute gap, or a time outside the patient's stated availability.
  2. Put first the patients whose prescription must start soon. Under the Heilmittel-Richtlinie, treatment on a statutory prescription has to begin within 28 calendar days of it being issued, or within 14 when it is marked urgent, so the waitlist stores the issue date and the urgency flag.
  3. Next, patients partway through a series whose next session would otherwise fall more than 14 days after the last one, since an unjustified break of that length makes the prescription invalid.
  4. Then patients who asked for this particular therapist, then anyone happy to see any qualified therapist.
  5. Within each group, the date they joined the list, so the order can be explained to a patient who asks why someone else got the slot.
  6. Skip anyone who ignored an offer in the last few hours, and anyone the front desk has marked 'phone, don't message'.

No model takes part in this ranking. For every refilled slot the front desk can see who was asked, in what order and why, which is the record you want the day a patient complains.

What runs between a cancellation and a booking

Two steps use a model: reading replies and phrasing messages. Spotting the cancellation, choosing who to ask and booking the slot are ordinary code, because they decide who gets care and when. The calendar mechanics are the ones covered in building a custom AI scheduling assistant.

  1. 01 Trigger · Practice system API

    A cancellation reaches the appointment book

    The agent asks the practice system every minute for appointments cancelled since its last check, whether the cancellation came online, by phone or at the desk. Where the system offers webhooks, it listens instead.

  2. 02 Decision

    Is the slot worth offering?

    Code checks the time left against the practice's settings.

    • Far enough ahead for a patient to get there (90 minutes by default) and inside messaging hours then rank the waitlist and send offers
    • Cancelled during quiet hours, 21:00 to 7:00 then offers wait until 7:00, if the slot is still far enough away
    • Too close to the start, or the therapist has marked the gap for notes or a break then no messages; the gap shows on the front desk screen
  3. 03 Plain code

    Rank the waitlist and hold the slot

    The ranking rules run against the waitlist and each therapist's qualifications. A placeholder marked 'held for waitlist' goes into the appointment book, so nobody at the desk books the slot while offers are out.

  4. 04 System · WhatsApp Cloud API, Twilio

    Send offers in small batches

    Three patients at a time by default, as a pre-approved WhatsApp template or an SMS, with a ten-minute wait before the next batch. The message gives the day and time only: no treatment, no diagnosis, and no therapist unless the patient asked for one.

  5. 05 AI model · Structured output

    Read the replies

    A small model sorts each reply into accept, decline, conditional ('only if it's with Lena'), question or medical, under a strict schema and in whatever language the patient writes. Only a plain accept counts as a yes; anything conditional or unclear goes to a person.

  6. 06 Plain code

    The first valid yes wins

    An acceptance claims the slot through a unique constraint in the agent's database, with an idempotency key per offer and patient, and only then is the booking written to the practice system. If that write fails, the claim is released, the patient is not told anything premature, and the desk gets an alert.

  7. 07 Person

    The front desk takes everything else

    Medical questions, conditional answers, requests to speak to someone and failed bookings arrive in the front desk inbox with the conversation attached. Staff reply in their own words; the agent never gives clinical advice.

  8. 08 Result

    Close the loop and keep the record

    Everyone still holding an offer hears that the slot has gone and keeps their place. The log holds the cancellation, the ranking with its reasons, each message and the booking, and the practice reviews it weekly.

Six ways a refilled slot turns into a complaint

Each of these shows up in the first month of any waitlist automation, so the build treats them as requirements rather than surprises.

Two yeses in the same second

Replies arrive in parallel, so the booking cannot depend on which webhook the server happens to handle first. The slot is claimed in one database transaction with a unique constraint, the second patient gets an honest 'just taken', and a retried webhook carrying the same key changes nothing.

The desk books the slot by phone while offers are out

The placeholder in the appointment book prevents most of these. Before writing any booking, the agent also re-reads the slot in the practice system. If a person got there first, their booking stands and the patient who replied is told the slot has gone.

A yes that arrives after the hold

The ten-minute timer only decides when the next batch goes out. A late yes for a slot that is still free is booked; a late yes for a filled slot gets an apology and keeps the patient's place. The lock decides, never the timer.

Health details on a lock screen

I treat anything that reveals health indirectly as health data under GDPR Article 9, and a treatment name in a message preview does. Offers carry the day and time only. Data stays on EU servers under a data processing agreement, and in Germany every service provider's contract also carries a confidentiality clause, because section 203 of the Criminal Code extends professional secrecy to the people a practice involves. More on GDPR-compliant AI builds.

The patient who asks a clinical question

The reply classifier routes anything medical to the front desk, and the agent says so plainly. It also introduces itself as automated in its first message, as Article 50 of the EU AI Act has required since 2 August 2026; the Article 50 guide covers the wording.

A list full of people who found an appointment elsewhere

Patients rarely say when they stop waiting. Anyone who ignores three offers is asked once whether to stay on the list and removed if they say no or do not answer within a week, which also keeps the stored data down to what is still needed.

From suggestions to bookings in three phases

The agent books appointments on its own only after it has shown, on real cancellations, that it picks the patient the front desk would have picked.

SuggestSpots each cancellation and shows the ranked list with a draft offer on the front desk screenPhones or messages patients as before, using the list if it helpsThe ranking matches the patient staff would have chosen for most slots
Send with approvalSends offers and handles replies once a staff member approves the slot with one clickApproves each slot and takes every handoverA few weeks pass without a double booking, a wrong patient or a complaint about a message
Autonomous by treatment typeOffers and books on its own, starting with standard 30-minute physiotherapy slotsReviews the daily log and handles handoversEach further treatment type, such as lymph drainage, is switched on separately after the same clean record
First appointments for new patients stay with the front desk longest, because the prescription and the patient's details are checked in person before the first session.

Does your practice software already do this?

Check that first. Practice systems such as Cliniko, Jane and Doctolib keep adding booking features, and if yours can already offer freed-up slots to a waiting list under rules you can live with, switch it on. A built-in feature knows your appointment book natively, which removes the hardest part of this build.

A custom agent earns its place when the rules are yours: prescription start dates, therapist qualifications, series that must not break, several sites sharing one list, or a practice system with a good API and no waitlist at all. It also fits practices that want offers on WhatsApp in the patient's own language, with free-text replies read properly instead of a rigid 'reply 1 to accept'.

The usual shape is a hybrid: the practice system stays the appointment book and the front desk's screen, and the agent works beside it through the API. Therapists change nothing, and switching the agent off never loses a booking. Related builds for practices are collected under healthcare, including referral intake.

How you would know it is working

A blueprint has no results to report, so here is what I would measure from the first week instead, on your own data.

Cancelled slots refilled
Share of cancellations made with enough notice that ended in a new booking, by weekday, therapist and treatment type.
Minutes from cancellation to booking
The median per refilled slot, which shows whether the batch size and the hold time are set right.
Prescriptions started in time
Waitlisted patients whose statutory prescription started inside the 28-day window, or whose series stayed inside the 14-day gap, because of an offer.
Handovers and complaints
Replies passed to the front desk, and any complaint about an offer, a double booking or the content of a message.
Opt-outs after offers
Patients leaving the list or the channel after being messaged, the early sign of offers that are too frequent or badly timed.

What a build like this costs

This is built as AI Agent Development, which runs $12K - $60K overall. A build like this one usually lands in the single-purpose agent tier: $12K - $30K, 2-5 weeks. The first working version runs on your real data well before the end of that window.

What it costs to run

Replies are short and read by a small model, so model costs are a fraction of a cent per reply. WhatsApp offers are templates, billed per message by Meta when sent outside a patient's 24-hour service window, and SMS through Twilio is billed per message by country. Hosting is a small EU server and a database.

What moves the price

  • The practice system's interface: a documented API covering cancellations and bookings, or a system that needs a workaround
  • How many ranking rules: prescription dates, therapist qualifications, series gaps, patient preferences
  • Channels and languages: WhatsApp templates and opt-in handling, SMS, and how many languages patients write in
  • One site, or several sharing a waitlist and therapists

Who this is for

  • Physiotherapy practices with several therapists and a waitlist on paper or in a spreadsheet
  • German practices treating on statutory prescriptions, where start dates and series gaps decide who should get a slot first
  • Dental and specialist clinics that lose short-notice cancellations because the desk is busy with the patients in front of it
  • Clinic groups whose sites share therapists and want one waitlist across locations

Questions people ask about this

Can AI fill cancelled appointments automatically?

Yes, within rules the clinic sets. The agent notices the cancellation, ranks the waitlisted patients who fit, offers the slot by WhatsApp or SMS, and books the first valid confirmation into the practice system. The model only reads replies and words messages; who gets asked and who gets the slot are decided by code, so every booking can be explained.

Can a clinic use WhatsApp for appointment offers under GDPR?

It can, with care, and the practice makes that call with its data protection officer. Patients opt in to the channel, offers carry only a day and time, and the agent's data stays on EU servers under a data processing agreement. Some practices prefer SMS or email for anything health-related, and the same flow runs on those channels with the same rules.

How do I reduce no-shows and last-minute gaps in a physiotherapy practice?

Pair reminders with a waitlist that refills what gets cancelled. A reminder a day ahead, with an easy way to cancel, gives patients who cannot come a reason to say so early, and an early cancellation is one the agent can offer to someone else. The agent then fills the gap from the waitlist while the front desk looks after the patients in the room.

Does it work with Cliniko, Jane or Doctolib?

It works with any practice system that lets software read cancellations and create bookings. Cliniko, for example, publishes a REST API with a limit of 200 requests a minute per user, plenty for checking every minute. For other systems I first check what interface the vendor offers, because that decides whether the agent books directly or only proposes to the front desk.

What happens if a patient asks the agent a medical question?

It does not answer it. The agent recognizes medical questions, tells the patient that someone from the practice will reply, and puts the message in the front desk inbox with the conversation attached. It also introduces itself as an automated assistant in its first message, as Article 50 of the EU AI Act requires.

How much does a clinic waitlist agent cost to build?

It is one of the smaller agent builds. The price moves with the practice system's interface, the number of ranking rules, the channels and languages, and whether several sites share one list. Running costs stay low: a fraction of a cent of model usage per reply, per-message fees for WhatsApp templates and SMS, and a small EU server.

Sources