{"product_id":"n8n-whatsapp-support-agent-with-ai-memory-openai-sheets","title":"n8n WhatsApp Support Agent with AI Memory (OpenAI, Sheets)","description":"\u003ch3\u003eTurn WhatsApp messages into AI replies—while keeping the full chat history in Google Sheets\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow receives \u003cstrong\u003eMeta WhatsApp\u003c\/strong\u003e webhook messages, stores each conversation per phone number in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, generates short context-aware responses with \u003cstrong\u003eOpenAI\u003c\/strong\u003e, and supports a \u003cstrong\u003ehuman handoff\u003c\/strong\u003e via email when needed.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives WhatsApp webhooks from Meta\u003c\/strong\u003e: accepts a POST webhook event and parses the payload into \u003cem\u003ephone number\u003c\/em\u003e, \u003cem\u003emessage text\u003c\/em\u003e, and \u003cem\u003emessage type\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFilters out non-message events\u003c\/strong\u003e: ignores delivery\/read receipts and only continues for real inbound messages.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads and rebuilds conversation memory\u003c\/strong\u003e: pulls prior rows from \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e for the sender and reconstructs the last \u003cstrong\u003eN\u003c\/strong\u003e turns of history, then logs the incoming message with bot\/human status.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRoutes the request\u003c\/strong\u003e:\n    \u003cul\u003e\n      \u003cli\u003eIf the user requests a human, it triggers a \u003cstrong\u003ehuman handoff\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eIf no text is available (unsupported media), it returns an \u003cstrong\u003eunsupported-media\u003c\/strong\u003e reply.\u003c\/li\u003e\n      \u003cli\u003eOtherwise, it generates a reply using \u003cstrong\u003eOpenAI\u003c\/strong\u003e based on your knowledge base and the conversation history.\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends the reply back via Meta Graph API\u003c\/strong\u003e and appends an outgoing log entry to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSticky human handoff\u003c\/strong\u003e: emails a teammate once with the message and recent history, and stops bot responses for that contact.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSaaS support teams handling inbound WhatsApp requests with AI answers and quick escalation to a human.\u003c\/li\u003e\n  \u003cli\u003eOperators who need auditable conversation logs in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e per phone number.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers building WhatsApp-to-AI support flows with context retention.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations\u003c\/strong\u003e: Meta WhatsApp Webhooks (Meta Graph API), \u003cstrong\u003eOpenAI\u003c\/strong\u003e, \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, \u003cstrong\u003eGmail\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n node logic\u003c\/strong\u003e: \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003eno op\u003c\/strong\u003e, \u003cstrong\u003eswitch\u003c\/strong\u003e, \u003cstrong\u003egmail\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRequired auth\u003c\/strong\u003e: Meta Graph API header auth using \u003ccode\u003eAuthorization: Bearer \u0026lt;YOUR_META_ACCESS_TOKEN\u0026gt;\u003c\/code\u003e and the correct \u003cstrong\u003eMeta phone number ID\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46132916289715,"sku":"N8N-20147","price":5.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/T9wqCQJh7xhdGK5iSKOPJ_MOpHr9tK.png?v=1790760131","url":"https:\/\/buyflowscripts.com\/products\/n8n-whatsapp-support-agent-with-ai-memory-openai-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}