Quick overview
This workflow answers incoming WhatsApp customer questions using an OpenAI-powered agent that reads your live website via HTTP requests, escalates unclear or sensitive cases to your support team via Gmail, and logs each conversation to Google Sheets.
How it works
- Triggers when a new WhatsApp message is received.
- Loads configuration values (company name, website root URL, AI model, language rules, escalation email, and WhatsApp phone number ID) and extracts the customer phone number and message text.
- Ignores non-text WhatsApp updates (such as images, audio, and status messages).
- Uses OpenAI with conversation memory to navigate your website by listing links and fetching relevant pages, then generates a structured result containing an answer, escalation flag, sentiment, topic, and source URLs.
- If the agent marks the request as needing a human, sends an escalation email via Gmail to your support address with the customer details and the drafted reply.
- Sends the final plain-text reply back to the customer on WhatsApp.
- Appends the conversation details to a Google Sheets log.
Setup
- Connect credentials for WhatsApp Trigger/WhatsApp Cloud API, OpenAI, Gmail, and Google Sheets.
- In the Configuration step, set your company_root_url, support_email, whatsapp_phone_number_id, and optionally adjust ai_model, output_language, memory_context_length, and max_pages_per_answer.
- In Google Sheets, select the target spreadsheet and worksheet for logging and ensure it has columns to store the conversation fields you want to capture.
- Configure your Meta WhatsApp webhook to point to the workflow’s WhatsApp trigger URL, then activate the workflow and test by sending a text message to your WhatsApp number.
Additional info
Answer customer questions on WhatsApp with an AI agent that reads your website
Need help customizing?
Contact me for consulting and support : Linkedin
MY NEW YOUTUBE CHANNEL
👉 Subscribe to my new YouTube channel. Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.
