This workflow follows the Agent → Google Sheets Tool recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Messenger",
"nodes": [
{
"parameters": {
"multipleMethods": true,
"path": "webhook-path",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
-448,
0
],
"name": "Webhook"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"leftValue": "={{ $json.query['hub.mode'] }}",
"rightValue": "subscribe",
"operator": {
"type": "string",
"operation": "equals"
}
},
{
"leftValue": "={{ $json.query['hub.verify_token'] }}",
"rightValue": "YOUR_VERIFY_TOKEN",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"type": "n8n-nodes-base.filter",
"typeVersion": 2.3,
"position": [
-240,
-96
],
"name": "Verify Webhook"
},
{
"parameters": {
"respondWith": "text",
"responseBody": "={{ $json.query['hub.challenge'] }}"
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.5,
"position": [
-32,
-96
],
"name": "Respond to Webhook"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"leftValue": "={{ $json.body.entry[0].messaging[0].message }}",
"operator": {
"type": "object",
"operation": "exists"
}
}
]
}
},
"type": "n8n-nodes-base.filter",
"typeVersion": 2.3,
"position": [
-240,
96
],
"name": "Check Message"
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.body.entry[0].messaging[0].message.text }}",
"options": {
"systemMessage": "You are a professional lead-collection assistant. Collect Name, Phone, Email step-by-step with validation and confirmation before saving."
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
-32,
96
],
"name": "AI Agent"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $json.body.entry[0].messaging[0].sender.id }}"
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-16,
304
],
"name": "Memory"
},
{
"parameters": {
"method": "POST",
"url": "=https://graph.facebook.com/vXX.X/{{ $('Webhook').item.json.body.entry[0].messaging[0].recipient.id }}/messages",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "access_token",
"value": "YOUR_FACEBOOK_PAGE_ACCESS_TOKEN"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { \"recipient\": { \"id\": $('Webhook').item.json.body.entry[0].messaging[0].sender.id }, \"messaging_type\": \"RESPONSE\", \"message\": { \"text\": $json.output } } }}"
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
320,
96
],
"name": "Send Message"
},
{
"parameters": {
"operation": "append",
"documentId": "YOUR_GOOGLE_SHEET_ID",
"sheetName": "Sheet1",
"columns": {
"mappingMode": "defineBelow",
"value": {
"Name": "={{ $fromAI('Name', '', 'string') }}",
"Phone": "={{ $fromAI('Phone', '', 'string') }}",
"Email": "={{ $fromAI('Email', '', 'string') }}"
}
}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.7,
"position": [
128,
304
],
"name": "Save to Google Sheets"
},
{
"parameters": {
"model": "gpt-4.1-mini"
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
-176,
304
],
"name": "Chat Model"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Verify Webhook",
"type": "main",
"index": 0
}
],
[
{
"node": "Check Message",
"type": "main",
"index": 0
}
]
]
},
"Verify Webhook": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Check Message": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Send Message",
"type": "main",
"index": 0
}
]
]
},
"Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Save to Google Sheets": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Messenger. Uses agent, memoryBufferWindow, httpRequest, googleSheetsTool. Webhook trigger; 9 nodes.
Source: https://github.com/nihal1526/Messenger-Automation/blob/main/Messanger.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
12-Automate_WhatsApp_Booking_System_with_GPT_4_Assistant__Cal_com_and_SMS_Reminders. Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 26 nodes.
12-Automate_WhatsApp_Booking_System_with_GPT_4_Assistant__Cal_com_and_SMS_Reminders. Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 26 nodes.
Automate_WhatsApp_Booking_System_with_GPT_4_Assistant__Cal_com_and_SMS_Reminders. Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 26 nodes.
This workflow is designed for solo entrepreneurs, consultants, coaches, clinics, or any business that handles client appointments and wants to automate the entire scheduling experience via WhatsApp —
Automate WhatsApp bookings with an AI assistant and smart SMS reminders (24/7). Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 25 nodes.