Run a WhatsApp support agent with memory using OpenAI, Google Sheets and Gmail
Ready for 3.0What this workflow does
This AI workflow has 19 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Google Sheets, OpenAI Chat Model and Gmail.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Agent Config (Edit Fields (Set)): sets 6 fields: PhoneNumberId, BusinessName, HandoffEmail…
- Parse WhatsApp Message (Code): runs custom JavaScript code
- Is A Real Message? (If): checks a condition and branches into true / false
- Load Conversation (Google Sheets): uses Google Sheets
- Build Conversation State (Code): runs custom JavaScript code
- Log Incoming (Google Sheets): append
- Route Conversation (Switch): routes items into 2 branches
- Handoff Message (Code): runs custom JavaScript code
- Unsupported Media Message (Code): runs custom JavaScript code
- Generate Reply (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model
…plus 5 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (11)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Google Sheets
n8n-nodes-base.googleSheets - Switch
n8n-nodes-base.switch - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail
From the author
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…