GenAiHub

Last checked 8 October 2026 — responded normally.

Run a WhatsApp support agent with memory using OpenAI, Google Sheets and Gmail

Quick Overview

Live
Open / InstallLast updated October 8, 2026

Description

Quick Overview This workflow receives WhatsApp webhooks from Meta, stores conversation history in Google Sheets per phone number, generates short context-aware replies with OpenAI, and supports a “sticky” human handoff by emailing a teammate and stopping bot responses for that contact. How it works Receives a POST webhook from Meta WhatsApp and parses the event into phone number, message text, and message type. Filters out non-message webhook events (such as delivery/read receipts) so only real inbound messages continue. Loads prior conversation rows for the sender from Google Sheets, rebuilds the last N turns of history, and logs the incoming message with a bot/human status. Routes the conversation to either a human-handoff reply, an unsupported-media reply (when no text is available), or an OpenAI-generated reply that can only use the configured knowledge base and conversation history. Sends the chosen reply back to the user via the Meta Graph API and appends an outgoing log entry to Google Sheets. If the user asked for a human, sends a single notification email via Gmail with the message and recent history. Setup Configure your Meta WhatsApp webhook to point to this workflow’s production webhook URL and ensure your Meta app is sending events for your WhatsApp number. Add an HTTP Header Auth credential for Meta Graph API (Authorization: Bearer ) and set the correct Meta phone number ID in the workflow configuration. Connect Google Sheets credentials, create a spreadsheet with a “Conversations” sheet containing the required headers (Timestamp, Phone, Name, Direction, Message, Status), and update the spreadsheet ID in all Google Sheets steps. Add OpenAI credentials for the Chat model used to generate replies and update the business name, knowledge base text, and history length settings as needed. Connect Gmail credentials and set the handoff notification email address and handoff keywords that should trigger human escalation. An n8n automation workflow template by Thomas Abraham.

Community Metrics

Views
0
Avg Rating
N/A
Ratings
0
Likes
0
Comments
—

Author

Thomas Abraham

Platform

web

Pricing model

free

Categories

  • Automation
  • AI

Tags

  • n8n
  • workflow
  • google-sheets
  • http-request
  • gmail
  • code
  • basic-llm-chain
  • openai-chat-model

Capabilities

  • 6 nodes

Information

TypeWorkflow
Sourcen8n
AddedOctober 1, 2026

Comments

?

Others in the same category, ranked by how often they are opened.