Quick overview
This workflow receives WhatsApp messages via a Meta webhook, uses Anthropic Claude to detect booking intents and extract appointment details, writes updates to Google Sheets, and sends a confirmation or error reply back to the customer on WhatsApp.
How it works
- Receives incoming WhatsApp messages through a Meta webhook endpoint and normalizes key fields like sender phone number, display name, message text, and timestamps.
- Filters out empty messages and sends the text to Anthropic Claude to classify the intent (book, reschedule, confirm, or unknown) and extract structured appointment details.
- Validates the request based on intent, including required fields and simple rules like weekday-only appointments and business hours.
- Appends a new row to the Google Sheets Appointments tab for valid bookings, or updates the appointment status/date/time in Google Sheets for reschedules and confirmations.
- Builds a personalized WhatsApp reply message describing the result (success, required missing details, or supported actions).
- Sends the reply back to the customer via the WhatsApp Cloud API and appends the interaction details to the Google Sheets ActivityLog tab.
Setup
- Create a Meta WhatsApp Business (Cloud API) app, register the workflow webhook URL as the WhatsApp callback URL, and complete webhook verification.
- Add an Anthropic API credential in n8n and ensure the Anthropic Claude model node is connected to your account.
- Add a Google Sheets OAuth2 credential in n8n and create a spreadsheet with Appointments and ActivityLog tabs and the expected header columns.
- Replace YOUR_SHEET_ID in all Google Sheets HTTP request URLs with your spreadsheet ID.
- Replace YOUR_PHONE_NUMBER_ID in the WhatsApp API URL and set the WhatsApp Authorization bearer token (preferably via an n8n credential) in the request headers.