CORTEXFLOW · FREE FOREVER

Automation

WhatsApp Appointment Booking + Recall

↓ Download workflow JSON

Import in n8n: Workflows → ⋯ → Import from file, then add your credentials. Free download with a free account.

How it works

Your AI receptionist on WhatsApp, running two independent flows in one workflow:

  1. STEP 1 — WhatsApp trigger + AI intent parsing — every incoming WhatsApp message fires the workflow, gets logged to Google Sheets with status RECEIVED, and an AI Agent classifies the intent (book / cancel / reschedule / other) through a Structured Output Parser, extracting the customer name, preferred date/time, and notes. A Switch routes the conversation by intent.
  2. STEP 2 — Calendar availability + booking — for book, the workflow builds a ±1 hour availability window around the requested time, fetches overlapping Google Calendar events, and a Code node decides if the slot is free. If free: the event is created, the sheet flips to BOOKED, and the customer gets a WhatsApp confirmation. If busy: three alternative 1-hour slots are computed and suggested on WhatsApp, and the sheet flips to PENDING_SLOT. If the AI couldn’t parse a date/time, WhatsApp asks the customer for one instead of guessing.
  3. STEP 3 — Cancel / reschedule / fallback — for cancel, the customer’s upcoming event is found (sender’s phone number in the event description first, then name in the summary), deleted from Google Calendar, the sheet flips to CANCELLED, and WhatsApp confirms. For reschedule, WhatsApp asks for the new preferred time and the sheet flips to RESCHEDULE_REQUESTED — the customer’s reply re-enters the booking flow. For other, a fallback reply explains the BOOK / CANCEL / RESCHEDULE commands and the sheet flips to HANDLED.
  4. STEP 4 — Weekly inactive-customer recall — every Monday at 10 AM the workflow reads your Customers tab, keeps customers whose last visit is 60+ days ago, sends each a WhatsApp re-engagement message with your offer, flips the sheet to RECALLED with today’s contact date, and sends you a Telegram digest. Note: Meta requires an approved message template for business-initiated WhatsApp messages — keep the text simple and approve it in WhatsApp Manager first.
  5. STEP 5 — Sheets logging + Telegram digests — every booking branch merges into one booking summary sent to Telegram, and the weekly recall builds its own digest. Both read the chat ID from a single CONFIG node.

Status flow (Bookings tab): RECEIVED → BOOKED / PENDING_SLOT / CANCELLED / RESCHEDULE_REQUESTED / HANDLED Recall flow (Customers tab): inactive 60+ days → WhatsApp re-engagement → RECALLED

Set up steps

You’ll need:

  • n8n (self-hosted or cloud)
  • WhatsApp Business API access via Meta — developers.facebook.com → WhatsApp → get a test number or connect your business number; approve your re-engagement message template in WhatsApp Manager (required for business-initiated messages in Flow B)
  • An OpenAI API key — platform.openai.com → API keys
  • Google Calendar + Google Sheets OAuth2 credentials — n8n Credentials → Google Calendar OAuth2 / Google Sheets OAuth2
  • A Telegram bot — message @BotFather, send /newbot, copy the token; get your chat ID from @userinfobot

Steps:

  1. Import the workflow — in n8n, Workflows → Import from File → select whatsapp-appointment-booking.json.
  2. CONFIG — Business — open the Set node and fill in:
    • business_name — e.g. Sharma Dental Clinic
    • calendar_id — your Google Calendar ID (usually your Gmail address, or the calendar’s ID under Settings)
    • timezone — e.g. Asia/Calcutta
    • whatsapp_number — your WhatsApp Business number in international format
    • spreadsheet_id — paste your Google Sheet ID
    • Then select your WhatsApp credential in the trigger and all WhatsApp send nodes, and your Google Calendar credential in the three Calendar nodes.
  3. Google Sheets tabs — in that spreadsheet create two tabs with these exact headers:
    • Bookings: Date | From | Message | Intent | Status
    • Customers: Name | Phone | Last Visit | Status | Last Contact
    • Select your Google Sheets credential in every Sheets node.
  4. CONFIG — Recall — set recall_days (60 is the default), and edit reengagement_message — replace PASTE_YOUR_BUSINESS_NAME and PASTE_YOUR_OFFER with your real business name and offer ({name} is auto-replaced with the customer’s name). Keep it close to the template you got approved in WhatsApp Manager.
  5. AI intent parsing — select your OpenAI credential in the “OpenAI Chat Model — Intent” node (model is gpt-4o-mini by default). No prompt editing needed — the agent reads the business name and timezone from CONFIG — Business.
  6. CONFIG — Notifications — paste your Telegram chat ID, select your Telegram credential in both Telegram nodes, and activate the workflow. Send a test WhatsApp message (“I want to book tomorrow 4pm”) and watch the execution flow.

Customize it

  • Appointment length — the Code nodes assume 1-hour slots (3600000 ms). Search the two Code nodes in the book branch for 3600000 and change it to e.g. 1800000 for 30-minute appointments.
  • Business hours guard — add an IF node after intent parsing to auto-reply “we’re closed” outside working hours, before the Switch.
  • Richer confirmations — the “Calendar — Create Event” node writes the customer’s phone into the event description, which is what the cancel branch matches on. Add a Google Meet link via additionalFields → conferenceData if you do video appointments.
  • Recall cadence — change the “Weekly Recall — Mondays 10AM” trigger to bi-weekly, or lower recall_days to 30 for faster-moving businesses.
  • Human handoff — route the other intent to a staff WhatsApp number when the message contains words like “urgent” or “human”, using an extra IF branch after the Switch.
  • Double-booking safety — the ±1 hour window prevents back-to-back collisions; widen it to ±2 hours in “Code — Build Availability Window” if you need buffer time between appointments.

Workflow nodes

This workflow is built from 39 nodes. Here's what each one does:

#NodeTypeWhat it does
1 New WhatsApp Message WhatsApp Trigger Starts the workflow when a WhatsApp message arrives.
2 CONFIG — Business Set Holds editable configuration values — fill in your own settings here before activating.
3 Log Message — RECEIVED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
4 AI Agent — Understand Booking Intent AI Agent The AI brain — reasons over the task and calls tools to get it done.
5 OpenAI Chat Model — Intent OpenAI Chat Model The language model powering the AI agent.
6 Structured Output Parser — Intent Structured Output Parser Forces the AI to return clean, structured JSON instead of free text.
7 Switch — Route by Intent Switch Routes items to one of several outputs based on rules.
8 Code — Build Availability Window Code Runs custom JavaScript to transform, filter, or compute data between steps.
9 Calendar — Check Availability Google Calendar Creates or reads events in Google Calendar.
10 Code — Check Slot & Find Alternatives Code Runs custom JavaScript to transform, filter, or compute data between steps.
11 IF — Slot Free? IF Splits the flow into branches based on a condition.
12 Calendar — Create Event Google Calendar Creates or reads events in Google Calendar.
13 Update Sheet — BOOKED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
14 WhatsApp — Send Confirmation WhatsApp Sends WhatsApp messages through the Meta Cloud API.
15 WhatsApp — Suggest Alternatives WhatsApp Sends WhatsApp messages through the Meta Cloud API.
16 Update Sheet — PENDING_SLOT Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
17 Calendar — Find Upcoming Events Google Calendar Creates or reads events in Google Calendar.
18 Code — Match Event to Cancel Code Runs custom JavaScript to transform, filter, or compute data between steps.
19 IF — Event Found? IF Splits the flow into branches based on a condition.
20 Calendar — Delete Event Google Calendar Creates or reads events in Google Calendar.
21 Update Sheet — CANCELLED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
22 WhatsApp — Confirm Cancellation WhatsApp Sends WhatsApp messages through the Meta Cloud API.
23 WhatsApp — Ask to Clarify Cancel WhatsApp Sends WhatsApp messages through the Meta Cloud API.
24 WhatsApp — Ask for New Time WhatsApp Sends WhatsApp messages through the Meta Cloud API.
25 Update Sheet — RESCHEDULE_REQUESTED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
26 WhatsApp — Fallback Reply WhatsApp Sends WhatsApp messages through the Meta Cloud API.
27 Update Sheet — HANDLED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
28 Merge — Booking Branches Merge Combines the outputs of two or more branches back into one flow.
29 Code — Build Booking Summary Code Runs custom JavaScript to transform, filter, or compute data between steps.
30 CONFIG — Notifications Set Holds editable configuration values — fill in your own settings here before activating.
31 Telegram — Booking Activity Digest Telegram Sends you a Telegram message or alert.
32 Weekly Recall — Mondays 10AM Schedule Trigger Starts the workflow automatically on a schedule.
33 CONFIG — Recall Set Holds editable configuration values — fill in your own settings here before activating.
34 Read Customers Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
35 Code — Filter Inactive 60+ Days Code Runs custom JavaScript to transform, filter, or compute data between steps.
36 WhatsApp — Send Re-engagement WhatsApp Sends WhatsApp messages through the Meta Cloud API.
37 Update Sheet — RECALLED Google Sheets Reads from or writes to a Google Sheet — this workflow's log and state store.
38 Code — Build Recall Digest Code Runs custom JavaScript to transform, filter, or compute data between steps.
39 Telegram — Send Recall Digest Telegram Sends you a Telegram message or alert.

Setup instructions

1. Add your credentials

In n8n go to Credentials → New, create each credential below, then open the named node and select it:

NodeCredential to add
New WhatsApp Message WhatsApp Cloud API
Log Message — RECEIVED Google Sheets OAuth2
OpenAI Chat Model — Intent OpenAI API
Calendar — Check Availability Google Calendar OAuth2
Calendar — Create Event Google Calendar OAuth2
Update Sheet — BOOKED Google Sheets OAuth2
WhatsApp — Send Confirmation WhatsApp Cloud API
WhatsApp — Suggest Alternatives WhatsApp Cloud API
Update Sheet — PENDING_SLOT Google Sheets OAuth2
Calendar — Find Upcoming Events Google Calendar OAuth2
Calendar — Delete Event Google Calendar OAuth2
Update Sheet — CANCELLED Google Sheets OAuth2
WhatsApp — Confirm Cancellation WhatsApp Cloud API
WhatsApp — Ask to Clarify Cancel WhatsApp Cloud API
WhatsApp — Ask for New Time WhatsApp Cloud API
Update Sheet — RESCHEDULE_REQUESTED Google Sheets OAuth2
WhatsApp — Fallback Reply WhatsApp Cloud API
Update Sheet — HANDLED Google Sheets OAuth2
Telegram — Booking Activity Digest Telegram Bot API
Read Customers Google Sheets OAuth2
WhatsApp — Send Re-engagement WhatsApp Cloud API
Update Sheet — RECALLED Google Sheets OAuth2
Telegram — Send Recall Digest Telegram Bot API

2. Fill in your config values

Open the config node listed below and replace each placeholder with your own value before activating the workflow:

NodeFieldWhat to paste
CONFIG — Business business_name PASTE_YOUR_BUSINESS_NAME
Your business name
CONFIG — Business calendar_id PASTE_YOUR_CALENDAR_ID
Your calendar id
CONFIG — Business whatsapp_number PASTE_YOUR_WHATSAPP_NUMBER
Your whatsapp number
CONFIG — Business spreadsheet_id PASTE_YOUR_SPREADSHEET_ID
Your spreadsheet id
CONFIG — Notifications telegram_chat_id PASTE_YOUR_TELEGRAM_CHAT_ID
Your telegram chat id
CONFIG — Recall reengagement_message PASTE_YOUR_BUSINESS_NAME
Your business name
CONFIG — Recall reengagement_message PASTE_YOUR_OFFER
Your offer

How this workflow starts

  • WhatsApp Trigger: Fires automatically on its event — activate the workflow and connect the service.
  • Schedule Trigger: Runs every weeks.

Use cases

For appointment businesses, the phone is both the lifeline and the bottleneck: the receptionist is with a customer, so the next customer goes to voicemail and books elsewhere. This template is an AI receptionist on WhatsApp that never steps away. Every incoming message is logged to the Bookings sheet as RECEIVED, then an AI Agent classifies the intent (book, cancel, reschedule, other) and extracts the name, date and time, and notes. A Switch routes by intent. For bookings, the workflow builds a ±1-hour availability window around the requested time, checks Google Calendar for overlaps, and either creates the event (the sheet flips to BOOKED and the customer gets a WhatsApp confirmation) or suggests three alternative one-hour slots (PENDING SLOT). If the AI could not parse a date or time, WhatsApp asks the customer for one instead of guessing. Cancellations find the event by the sender's phone in the event description (then name), delete it, and confirm (CANCELLED). Reschedules ask for the new time (RESCHEDULE REQUESTED); the reply re-enters the booking flow. Anything else gets a fallback reply and the sheet flips to HANDLED. Every Monday at 10 AM a second flow finds customers inactive 60+ days, sends a WhatsApp re-engagement with the business's offer, flips them to RECALLED, and sends the owner a Telegram digest. It is built for clinics, salons, studios, and service businesses that live on booked slots.

The dental clinic with two chairs

A dental clinic with two chairs and one receptionist loses bookings every time the receptionist is chairside. Patients now message the clinic's WhatsApp: I need a cleaning tomorrow afternoon. The AI extracts the intent and the time, the plus-or-minus one-hour window prevents back-to-back collisions with the existing calendar, and the patient gets a confirmation in under a minute.

  • Variation: add a business-hours guard after intent parsing that auto-replies that the clinic is closed outside working hours, before the Switch routes anything.

The salon where reschedules eat the day

A unisex salon's stylists lose an hour a day to reschedule phone tag: the client calls, nobody picks up, the slot goes empty. Now the client messages want to move my 4 PM to Friday, the intent parser flags reschedule, WhatsApp asks for the new preferred time, and the sheet flips to RESCHEDULE REQUESTED.

  • Variation: change the slot math in the two Code nodes from 3600000 milliseconds to 1800000 for 30-minute services like beard trims, so alternatives pack correctly.

The physiotherapy practice winning back lapsed patients

A physiotherapy practice has 400 past patients in its Customers tab and a quiet truth: patients who finished their plan six months ago often need a follow-up and just never book it. Every Monday at 10 AM the recall flow filters for patients inactive 60 or more days and sends each a WhatsApp re-engagement with the practice's offer, the name auto-inserted, and flips them to RECALLED. The Telegram recall digest tells the owner exactly how many messages went out. Business-initiated messages need an approved WhatsApp template, so the text stays close to the approved version.

  • Variation: lower recall days to 30 for faster-moving practices, or switch the Monday trigger to bi-weekly if weekly feels too frequent for the patient base.

The car service center juggling service bays

A car service center with four bays takes bookings over WhatsApp all day, and double-booking a bay cascades into an afternoon of angry customers. The plus-or-minus one-hour availability window is the safety mechanism: a booking request at 10 AM checks 9 to 11, so back-to-back jobs cannot collide. The owner gets the booking activity digest on Telegram without opening the sheet.

  • Variation: widen the availability window to plus-or-minus two hours in Code Build Availability Window if the center needs buffer time between jobs for overruns.

The tutoring center booking demo classes

A tutoring center offers free demo classes as its main acquisition channel, and parents message at night asking to book one for the weekend. The AI parses the intent, checks the demo calendar, and confirms the slot while the parent is still thinking about it. Fee questions hit the other intent and get the fallback reply explaining the BOOK, CANCEL, and RESCHEDULE commands.

  • Variation: add a human handoff after the Switch: if the other intent message contains words like urgent or human, route it to a staff WhatsApp number instead of the fallback reply.

← All templates