Skip to content

Every 10 minutes

Fill cancelled appointments from your waitlist sheet

When an appointment is cancelled, you get an email naming the next person on your waitlist to offer the slot to.

Runs
Every 10 minutes
Apps
Google Calendar, Google Sheets
AI
Not needed
Access
Calendar read; Sheet edit

Send this to your assistant

Create a ClickRuntime automation: when an appointment is cancelled in my calendar, find the next person on my waitlist sheet and email me who to offer it to.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A physiotherapist is booked out three weeks ahead and keeps a waitlist in a sheet. When someone cancels the day before, she usually notices too late, and the hour goes unpaid while people on the list would have taken it.

Being told about each cancellation straight away, with the name and contact of the next person waiting, makes it easy to fill the slot. The waitlist finally does its job.

What you get out of it

  • Fewer empty slots

    A cancelled hour is income lost unless it is refilled. Hearing about it quickly gives you time to offer it.

  • Fair to your waitlist

    People are offered slots in the order they joined. Nobody is skipped because their name was further down.

  • Clients get seen sooner

    Someone waiting three weeks is glad to come in tomorrow. Filling gaps shortens waits for everyone.

  • The list stays tidy

    Each person offered a slot is marked in the sheet, so you know who has already been contacted.

How it works

What happens, step by step

  1. Every few minutes, ClickRuntime checks your Google Calendar for cancelled appointments.

  2. It skips cancellations it has already handled.

  3. It finds the next person on your waitlist sheet who has not been offered a slot and marks them as offered.

  4. You get an email with the cancelled time and the person to offer it to.

Before it runs live

  • Connect Google Calendar
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsEvery 10 minutes
Fill cancelled appointments from your waitlist sheettoday, 9:00Succeeded
Email · Cancelled slotCancelled: Thu 23 Oct, 10:00. Offer it to Priya Shah (07700 900123).

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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 Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
fill_cancelled_slots_from_a_waitlist.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, notify, state, report_fetched
SHEET_ID = "your-waitlist-sheet-id"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    params = {"calendarId": "primary", "showDeleted": True, "singleEvents": True}
    if state.get("sync"):
        params["syncToken"] = state.get("sync")
    resp = build("calendar", "v3", credentials=creds, cache_discovery=False).events().list(**params).execute()
    cancelled = [e for e in resp.get("items", []) if e.get("status") == "cancelled" and "start" in e]
    report_fetched(len(cancelled))
    if not cancelled:
        state.set("sync", resp.get("nextSyncToken"))
        return {"cancelled": 0}
    values = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    rows = values.get(spreadsheetId=SHEET_ID, range="Waitlist!A2:C").execute().get("values", [])
    free = [i for i, r in enumerate(rows) if len(r) < 3 or not r[2]]
    for e in cancelled:
        when = e["start"].get("dateTime", e["start"].get("date"))
        if not free:
            notify.email_me(f"Cancelled: {when}", "The waitlist is empty.")
            continue
        i = free.pop(0)
        values.update(spreadsheetId=SHEET_ID, range=f"Waitlist!C{i + 2}", valueInputOption="RAW", body={"values": [["offered"]]}).execute()
        notify.email_me(f"Cancelled: {when}", f"Offer it to {rows[i][0]} ({rows[i][1]}).")
    state.set("sync", resp.get("nextSyncToken"))
    return {"cancelled": len(cancelled)}

FAQ

Common questions

How does it notice a cancellation?
It checks your calendar regularly for appointments that have been cancelled or deleted, and reacts to each one once.
Does it contact the person on the waitlist?
No. It emails you with their name and details so you can make the offer yourself, in your own words.
What if nobody is waiting?
You still get an email about the cancellation, with a note that the waitlist is empty.
What permissions does it need?
Calendar read; Sheet edit. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Fill cancelled appointments from your waitlist sheet” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.