How to Stop Losing a Client When They Cancel: A Script That Catches the Open Slot Itself
A client writes "can't make it today, let's reschedule" an hour before the meeting. The slot opens up on your calendar. You only find out about it once it has already passed: someone else booked with another specialist in the meantime, and someone else never even knew the slot existed.
Contents
- What the scheduling script actually does
- Four steps that map onto a consultation calendar
- A waitlist isn't a service, it's a plain table
- How to build this on Calendly or Google Calendar
- Adapting the script's logic yourself, through an AI model
- How long to wait before moving to the next person
- An example: what this looks like in real time
- What this setup doesn't solve
- Where to start today
- Checklist
- FAQ
- Sources
What follows is a familiar routine. You open the thread with your waitlist, if it exists anywhere outside your own memory. You try to recall who asked about the nearest opening, message one person, wait, try the next one. By the time a reply finally lands, the slot is open again, but there's no point to it anymore, because nobody else ever found out it was free.
There's a way to hand that checking off to a machine. A free, open-source script called "emias-slot-hunter" sits on GitHub. It watches a doctor's schedule every 30 seconds, and the moment a slot opens up, it books or reschedules the appointment to the earlier time on its own. The same mechanic maps onto a consultant's calendar once a few details get swapped out. Below: what the script actually does on a technical level, how to build an equivalent for booking consultations, and how to adapt the logic without writing code, using nothing but plain language with an AI model.
What the scheduling script actually does
The name "slot hunter" sounds like something complicated, but the mechanism behind it is simple. Technically, it's a userscript, a small program that runs in the browser. It loads through the Tampermonkey extension and works alongside the open booking page. The author describes it plainly: the script runs in the user's own browser, no data gets sent to any outside server.
Every 30 seconds, the script looks at the schedule page again. If a free hour shows up that wasn't there on the previous check, it books the user into that slot on its own. Or it reschedules an existing appointment to the earlier time. What sets this apart from an ordinary "go check the schedule yourself" reminder is one thing: it checks on its own, with no person involved. And it acts the moment the opening appears, not whenever someone happens to remember to look.
Four steps that map onto a consultation calendar
The "check on a loop, act on the first opening" idea isn't tied to medical bookings. For a consultation calendar, it breaks down into four steps, each one answering for its own link in the chain.
- A client cancels. A slot that was booked a second ago opens up on the calendar.
- The loop catches it. A script or bot checks the schedule every 20-30 seconds and notices the open slot almost immediately, not an hour or a day later.
- A message goes to the first person on the waitlist. Whoever asked about booking earlier and didn't get a slot hears about the opening first, not as part of a mass notice.
- They confirm, the slot is theirs. They stay quiet, it goes to the next person. If the first person replies within the set window, the slot is locked in for them. If not, the same message goes out to whoever's next in line.
The difference from doing the same thing by hand isn't the idea of "message the waitlist" itself. The difference is speed: the check doesn't depend on whether you happened to remember to glance at your calendar.
A waitlist isn't a service, it's a plain table
The most common assumption about a setup like this is that it needs a separate service or a CRM. In practice, a plain table with four columns is enough: name, contact, the date someone was added to the list, and how long they're willing to wait for a reply, if that matters for your practice.
The order of the rows in that table is the queue itself. When a script or bot sees an open slot, it takes the first row without a "booked" mark and messages exactly that person. It's a plain first-come order, no complicated logic behind it.
How to build this on Calendly or Google Calendar
If your booking already runs through Calendly or Google Calendar, there's no need to move the schedule anywhere else. Both services expose data about busy and free hours: Calendly through its own integration settings, Google Calendar through its own access protocol. That's enough for an outside script or bot to read the schedule and notice changes.
The build follows the same order as the original script, just with a different data source:
- Tell the AI model which calendar to watch and how to get read-only access to free and busy hours.
- Agree on a check frequency, say every 20-30 seconds, the same as in the original script.
- Connect the waitlist table, the message pulls the next person from it in order.
- Set the channel for the message to the first person in line: Telegram, WhatsApp, or whichever messenger you usually use with clients.
- Write the rule for the wait window and the handoff to the next person if the first one doesn't reply in time.
None of this requires opening the script's code and reading it line by line. You spell out the conditions, and an AI model handles turning the logic into something that works.
Adapting the script's logic yourself, through an AI model
The script's code is open source, which means you can use it as a base and ask for it to be rewritten for your own task, instead of starting from scratch. The gap between a medical booking and a consultant's booking is small at the logic level: instead of "book the doctor's appointment," it becomes "message the person on the waitlist." Instead of "the clinic's booking page," the source becomes your own calendar.
A brief for an AI model might read like this: "Here's a link to an open-source script, it checks a schedule on a loop and books an open slot on its own. I need similar logic for my own calendar: check every 20-30 seconds, and when a slot opens, message the first person on my waitlist. If they don't reply in 15 minutes, message whoever's next on the list." From there, the model suggests a concrete way to wire this up for your calendar and your messaging channel.
It's the same principle behind other automations for client booking: a person doesn't need to understand the code, an AI model turns plain-language conditions into a working setup.
How long to wait before moving to the next person
The number of minutes you wait isn't a minor detail, it's the thing that decides how fast an open slot actually gets filled. Too long a wait brings back the original problem: the slot sits open longer than it needs to while the first person in line thinks it over. Too short a wait doesn't give someone enough time to notice the message and reply, especially if they're away from their phone.
Fifteen minutes works as a reasonable middle ground for most practices: almost everyone can notice a message in that window, and the slot doesn't sit idle for too long either. The number can be adjusted for your own practice. What matters is spelling it out explicitly, not leaving it to "however it goes."
An example: what this looks like in real time
The cancellation happens at 11:40. The script catches the open slot on its next check, at 11:41, and sends the message to the first person on the waitlist right away. If that person replies in time, the slot is filled again by lunch. But filled by another client who was waiting their turn, not by whoever happened to check at the right moment.
Without this setup, the same cancellation would likely sit unnoticed until evening, when someone finally opens the calendar by hand and spots the empty hour after the fact.
What this setup doesn't solve
This setup has honest limits, and it's worth naming them upfront instead of finding out the hard way. If the waitlist is empty, the slot simply stays open, same as before. This setup doesn't conjure new clients out of thin air.
It doesn't replace booking and payment themselves. If a consultation requires a deposit, confirming the slot and collecting the payment are two separate things. I wrote about building that reminder and payment link as a separate bot in how to build a bot for reminders and payments. It also doesn't answer anything beyond the basic fact of "this slot is open, confirm it." If someone replies with a question about format or price, a person takes over the conversation from there, not the automation.
Where to start today
Before connecting anything technically, write out your own version of the four steps in plain words. What a cancellation looks like for you, where your waitlist lives, which channel you message clients through, and how many minutes is reasonable to wait for the first person in line. That's enough for a first draft of the brief for an AI model.
Run through the whole chain once with a test contact before connecting real clients. Cancel a test booking yourself and confirm the message actually reaches the first person on the list. Then check the handoff to the second person: it should trigger at exactly the set number of minutes, not sooner and not later.
Checklist
- A four-step loop: a client cancels, a script checks the calendar on a cycle, the first person on the waitlist gets a message, they confirm or after N minutes the slot goes to the second person.
- A waitlist is just a plain table: name, contact, date added, and how long someone is willing to wait for a reply.
- The open slot is checked on a loop every 20-30 seconds, not once a day.
- The wait window for the first person in line (say, 15 minutes) is a fixed number, not a judgment call.
- The script's code is open source, an AI model can rewrite the logic for your own calendar without a developer.
- Calendly and Google Calendar both expose schedule data through settings or a standard protocol, the script only needs to read free hours.
- Before connecting real clients, run the whole chain once with a test contact from start to finish.
FAQ
Do I need to know how to code to set this up?
No. The base version already exists in the open-source repository, you just describe in plain words what to change for your calendar and your waitlist. The AI model handles the technical side, your part is to spell out the conditions.
What if the first person on the waitlist never replies?
That's exactly why there's a time limit built into the loop. If someone stays quiet past the set number of minutes, the message about the open slot goes to the next person in line, and the first one simply stays in their spot for next time.
Does this only work for medical appointments?
The original script was written for a clinic booking system, but the underlying idea, check on a loop and act on the first opening, carries over to any consultation calendar that has cancellations and a waitlist.
How is a waitlist different from a plain list of "people who asked"?
Nothing, formally, except the order. It's a table with a name, a contact, and the date someone was added, and that order is exactly what tells the script who to message first when a slot opens.
Does the script need to run all the time?
Yes, it checks the schedule in a loop as long as the page or process stays open. Close the tab or stop the process, and the loop stops checking.
Can I let the script book a client automatically, with no confirmation step?
Technically, yes, but for consultations it's safer to keep a confirmation step: the person gets a message about the open slot and replies to claim it, rather than ending up booked without taking any action.
Sources
- emias-slot-hunter (open-source scheduling script)accessed: 2026-11-19
Want a system like this for your niche?
Book a free review: I'll show you what can come off your plate in content and sales.
Book a review →