DEV Community

Cover image for How to Build a WhatsApp Appointment Bot with n8n and Supabase (Step-by-Step)
אחיה כהן
אחיה כהן

Posted on • Edited on

How to Build a WhatsApp Appointment Bot with n8n and Supabase (Step-by-Step)

Every small business owner I've worked with has the same pain point: appointment scheduling eats their day alive.

They're stuck in an endless loop of WhatsApp messages. Multiply this by 20-30 conversations per day, and you've lost 3-4 hours before you've done any actual work.

Here's how to build a WhatsApp bot that handles this automatically — using open-source tools, self-hosted, for under $30/month.

Architecture Overview

Components:

  • WAHA — Self-hosted unofficial WhatsApp API (connects to WhatsApp Web)
  • n8n — Open-source workflow automation (handles all the logic)
  • Supabase — PostgreSQL database (stores appointments, availability, customer data)

Step 1: Set Up Your Database Schema

In Supabase, create three tables: availability (business hours/slots), appointments (booked slots), and conversation_state (tracks where each customer is in the booking flow).

Why conversation state? WhatsApp conversations are asynchronous. A customer might send "Tuesday" at 10am, then reply with a time at 2pm.

Step 2: Build the n8n Webhook Flow

Create a workflow with a Webhook node as the trigger. WAHA sends incoming messages here. The core logic uses a Switch node to route by conversation state:

State What We Expect Next Action
initial Any message Show welcome + available days
waiting_for_date A date Show available times
waiting_for_time A time Confirm booking
waiting_for_confirm "yes"/"no" Book or restart

Step 3: Add Reminder Workflow

Create a second n8n workflow with a Cron trigger that runs every hour, finds tomorrow's appointments, and sends WhatsApp reminders via WAHA.

Step 4: Handle Edge Cases

The difference between a frustrating bot and a helpful one:

  • Cancellation flow — detect "cancel" keyword, free the slot
  • Rescheduling — cancel existing, restart booking
  • Unrecognized input — show menu of options

Cost Breakdown

Component Monthly Cost
WAHA (self-hosted) $5 (VPS)
n8n (self-hosted) $0 (same VPS)
Supabase (free tier) $0
VPS (2GB RAM) ~$10-15
Total ~$15-20/month

Why Automated Reminders Matter

No-shows are the silent killer for appointment-based businesses. Research consistently shows that automated reminders — especially via the channel customers already use (WhatsApp) — significantly reduce no-show rates. Studies in healthcare found 40-60% reductions in missed appointments when using SMS/messaging reminders.

The advantage of WhatsApp specifically is the read receipt — you know the reminder was seen, unlike email which might be ignored.

The full code and n8n workflow templates are on my GitHub.


I'm Achiya Cohen, founder of Achiya Automation. I build WhatsApp bots and workflow automation for small businesses using open-source tools like n8n.


Over to You

Two questions for anyone running appointment systems:

  1. What's your no-show rate, and what's your reminder strategy? I've been using 24h + 2h before the appointment, but some businesses swear by 48h + 4h. What works for your industry?
  2. Do you allow rescheduling via bot, or only cancellation? Rescheduling adds complexity but might reduce no-shows even further since the customer has an easy alternative to just not showing up.

If you're building something similar and got stuck on a specific step — drop it below and I'll help debug. 👇

Top comments (0)