See llms.txt for all machine-readable content.

Back to Templates

Answer WhatsApp FAQs 24/7 with OpenAI, Google Sheets and human handoff

Quick overview

This workflow connects the WhatsApp Cloud API with a keyword-based FAQ and optional OpenAI fallback to answer customer messages, verifies Meta webhook signatures, supports STOP/START opt-outs and human handoff with owner alerts, and can send booking reminder templates from Google Sheets on a schedule.

How it works

  1. Receives Meta’s webhook verification GET request and returns the challenge only when the verify token matches.
  2. Receives incoming WhatsApp webhook POST requests, validates the X-Hub-Signature-256 HMAC signature, and immediately acknowledges Meta or rejects forged requests.
  3. Splits the webhook payload into individual customer messages, drops duplicate Meta retries by message ID, and processes STOP/START to opt numbers out or back in.
  4. Suppresses bot replies for chats currently handed off to a human, and routes non-text messages or “talk to a person” phrases directly to handoff.
  5. For remaining text questions, loads the FAQ from either a built-in list or Google Sheets and matches the best answer by keyword phrases.
  6. If no keyword match is found and AI fallback is enabled, uses OpenAI to select a single FAQ id (or null) and sends only the stored FAQ answer when the id is valid.
  7. Sends the reply via WhatsApp, or if no valid FAQ answer is found, sends a handoff acknowledgment to the customer and alerts the owner on WhatsApp while muting the bot for that chat.
  8. Runs every 30 minutes (optional) to read upcoming bookings from Google Sheets and sends an approved WhatsApp template reminder to eligible customers who have not opted out.

Setup

  1. Create a Meta app with WhatsApp Cloud API access and add WhatsApp credentials for the nodes that send replies, owner alerts, and template reminders.
  2. Update the values in the Settings code (verify token, Meta app secret, owner number, and any YOUR_* placeholders such as booking link and phone number ID).
  3. If you use AI fallback, add an OpenAI credential and confirm the selected model in the OpenAI Chat Model configuration.
  4. If you use Google Sheets for FAQs and/or bookings, add a Google Sheets credential and set the sheet URLs and tab names in Settings.
  5. Configure a Header Auth credential for the resume webhook and use it when calling the /whatsapp-support/resume endpoint.
  6. Activate the workflow and paste the production URL for the /whatsapp-support POST webhook into Meta’s webhook configuration and subscribe to WhatsApp message events.