Every 10 minutes
Offer cancelled appointments to your waitlist by text
When an appointment is cancelled, everyone on your waitlist is texted the open slot, and the first to reply YES gets booked.
- Runs
- Every 10 minutes
- Apps
- Google Calendar, Twilio
- AI
- Not needed
- Access
- calendar.events; Twilio send
Send this to your assistant
Create a ClickRuntime automation: every 10 minutes, check my Google Calendar for cancelled appointments; text my waitlist the open slot, book the first person who replies YES, and tell the others it's been filled.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Busy practices have a waitlist of people who'd take an earlier slot, and cancellations every week. Phoning down the list takes time, and by the time someone says yes the slot has often passed.
Texting the whole waitlist the moment a slot opens, and booking whoever answers first, fills cancellations within minutes and keeps the others informed without any phone calls.
What you get out of it
Cancelled slots filled
Openings go to people who want them, often within minutes.
Fair to the waitlist
Everyone hears at the same time and the first reply wins.
Booked for you
The new appointment is added to your calendar automatically.
Others kept informed
People who replied too late are told it's been filled.
How it works
What happens, step by step
Every 10 minutes it checks your Google Calendar for appointments cancelled since the last check.
Everyone on your waitlist gets a text offering the open slot.
The first person to reply YES gets a new calendar event and a confirmation text.
Anyone who replies after that is told the slot has been filled.
Before it runs live
- Connect Google Calendar
- Connect Twilio
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Calendar and Twilio steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
from datetime import datetime, timezone
from clickruntime import on_trigger, on_event, credentials, http, state, report_fetched
WAITLIST = {"+447700900111": "Ali", "+447700900222": "Bo"}
FROM = "+15005550006"
def sms(to, body):
return Client(credentials.secret("TWILIO_ACCOUNT_SID"), credentials.secret("TWILIO_AUTH_TOKEN")).messages.create(to=to, from_=FROM, body=body)
cal = lambda: build("calendar", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).events()
@on_trigger
def run(event):
now = datetime.now(timezone.utc).isoformat()
since = state.get("since") or now
state.set("since", now)
items = cal().list(calendarId="primary", updatedMin=since, showDeleted=True, singleEvents=True).execute()["items"]
gone = [e for e in items if e["status"] == "cancelled" and e.get("start", {}).get("dateTime", "") > now]
report_fetched(len(gone))
if not gone:
return {"summary": "No cancellations"}
state.set("open", {"start": gone[0]["start"], "end": gone[0]["end"]})
for phone in WAITLIST:
sms(phone, f"A slot opened: {gone[0]['start']['dateTime'][:16].replace('T', ' ')}. Reply YES to take it.")
return {"offered": gone[0]["start"]["dateTime"]}
@on_event
def handle(event):
f, slot = event.json or {}, state.get("open")
if (f.get("Body") or "").strip().upper() != "YES" or f.get("From") not in WAITLIST:
return {"skipped": True}
if slot:
cal().insert(calendarId="primary", body={"summary": f"Appointment – {WAITLIST[f['From']]}", "description": f["From"], **slot}).execute()
state.delete("open")
sms(f["From"], "You're booked! See you then." if slot else "Sorry, that slot has already been filled.")
return {"booked": bool(slot)}FAQ
Common questions
Where is the waitlist kept?
What if nobody replies?
Can it skip slots that are too soon?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Text clients to confirm tomorrow's appointments
Clients with an appointment tomorrow get a text, and their YES or NO reply updates the event in your Google Calendar.
See how it worksGet today's schedule by text each morning
Every weekday morning you get a text listing today's events from your Google Calendar.
See how it worksText missed callers open times and book them by reply
Missed callers get a text with your next free times, and replying with a number books that slot in your Google Calendar.
See how it worksKeep exploring
Set up “Offer cancelled appointments to your waitlist by text” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.