Workflow: WhatsApp business bot
Integrations: filter, googleSheets, googleSheetsTrigger, if, scheduleTrigger, splitInBatches, stickyNote, stopAndError, wait, whatsApp, whatsAppTrigger

{"id": "NzoLNV2FbS4eurJ7", "meta": {"instanceId": "workflow-f0d0d7ec", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:59.412563", "updatedAt": "2025-09-29T07:07:59.412574", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "WhatsApp business bot", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "4ca5e25a-f67b-4874-af20-680d1a6ac731", "name": "Sent notification  template", "type": "n8n-nodes-base.whatsApp", "position": [1140, 320], "parameters": {"template": "test_appointment_button|en_US", "components": {"component": [{"type": "header", "headerParameters": {"parameter": [{"text": "\ud83d\udcc5"}]}}, {"bodyParameters": {"parameter": [{"text": "={{ $json[\"Your name\"] }}"}, {"text": "={{ DateTime.fromFormat($json[\"Please pick a day and time of your appointment\"], \"M/d/yyyy HH:mm:ss\").toLocaleString(DateTime.DATE_HUGE); }}"}, {"text": "={{ $json[\"Please pick a day and time of your appointment\"].split(' ')[1] }}"}]}}]}, "phoneNumberId": "=244242975437240", "requestOptions": {}, "recipientPhoneNumber": "={{ $json[\"Your mobile number\"] }}"}, "credentials": {"whatsAppApi": {"id": "mm0r1xKc6N8XktAD", "name": "WhatsApp account 2"}}, "typeVersion": 1, "notes": "This whatsApp node performs automated tasks as part of the workflow."}, {"id": "877c62c5-9869-48fc-bd74-35897dbd2276", "name": "WhatsApp Trigger", "type": "n8n-nodes-base.whatsAppTrigger", "position": [700, 800], "webhookId": "b06b387a-481e-43f1-9035-01a87123ad88", "parameters": {"updates": ["messages"]}, "credentials": {"whatsAppTriggerApi": {"id": "bWqGRWeDXvGTdSq5", "name": "WhatsApp Trigger"}}, "typeVersion": 1, "notes": "This whatsAppTrigger node performs automated tasks as part of the workflow."}, {"id": "6c0edf48-20af-42fb-a436-aee3a9a4f6cc", "name": "Is message?", "type": "n8n-nodes-base.if", "position": [920, 800], "parameters": {"options": {"looseTypeValidation": true}, "conditions": {"options": {"leftValue": "", "caseSensitive": true, "typeValidation": "loose"}, "combinator": "and", "conditions": [{"id": "8a765e57-8e39-4547-a99a-0458df2b75f4", "operator": {"type": "object", "operation": "exists", "singleValue": true}, "leftValue": "={{ $json.messages[0] }}", "rightValue": ""}]}}, "typeVersion": 2, "notes": "This if node performs automated tasks as part of the workflow."}, {"id": "00006406-47be-4693-9763-a21d06b13d51", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [680, 1184], "parameters": {"rule": {"interval": [{"field": "minutes"}]}}, "typeVersion": 1.2, "notes": "This scheduleTrigger node performs automated tasks as part of the workflow."}, {"id": "b9919c0d-eeb2-4a5e-a91f-3dad11b778f8", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [1120, 1184], "parameters": {"options": {}}, "typeVersion": 3, "notes": "This splitInBatches node performs automated tasks as part of the workflow."}, {"id": "8f0dc664-715f-4074-b0f7-98d3c7f563a5", "name": "Get new answers", "type": "n8n-nodes-base.googleSheets", "position": [900, 1184], "parameters": {"options": {}, "filtersUI": {"values": [{"lookupValue": "Ready", "lookupColumn": "Status"}]}, "sheetName": {"__rl": true, "mode": "list", "value": 1621824221, "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WA-messages"}, "documentId": {"__rl": true, "mode": "list", "value": "1T-B0yepcrCHxQpn7Sj6QjTa0VqwwVBQhO5ZcIUSxWJE", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WhatsApp Appointments (Responses)"}}, "credentials": {"googleSheetsOAuth2Api": {"id": "RtRiRezoxiWkzZQt", "name": "Ted's Tech Talks Google account"}}, "typeVersion": 4.4, "notes": "This googleSheets node performs automated tasks as part of the workflow."}, {"id": "a7b07f7e-1287-4e8f-b28a-4c656f386f8a", "name": "Reply to the user", "type": "n8n-nodes-base.whatsApp", "position": [1340, 1184], "parameters": {"textBody": "={{ $json.ReplyText }}", "operation": "send", "phoneNumberId": "244242975437240", "requestOptions": {}, "additionalFields": {}, "recipientPhoneNumber": "=+{{ $json.UserPhone }}"}, "credentials": {"whatsAppApi": {"id": "mm0r1xKc6N8XktAD", "name": "WhatsApp account 2"}}, "typeVersion": 1, "notes": "This whatsApp node performs automated tasks as part of the workflow."}, {"id": "30f0a7da-c3ce-448c-ad05-b8b75da3d319", "name": "Update message status", "type": "n8n-nodes-base.googleSheets", "position": [1520, 1184], "parameters": {"columns": {"value": {"Status": "Replied", "row_number": "={{ $('Loop Over Items').item.json.row_number }}"}, "schema": [{"id": "UserPhone", "type": "string", "display": true, "removed": true, "required": false, "displayName": "UserPhone", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "UserName", "type": "string", "display": true, "removed": true, "required": false, "displayName": "UserName", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "UserMessage", "type": "string", "display": true, "removed": true, "required": false, "displayName": "UserMessage", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "ReplyText", "type": "string", "display": true, "removed": true, "required": false, "displayName": "ReplyText", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "Status", "type": "string", "display": true, "required": false, "displayName": "Status", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "row_number", "type": "string", "display": true, "removed": false, "readOnly": true, "required": false, "displayName": "row_number", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": ["row_number"]}, "options": {}, "operation": "update", "sheetName": {"__rl": true, "mode": "list", "value": 1621824221, "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WA-messages"}, "documentId": {"__rl": true, "mode": "list", "value": "1T-B0yepcrCHxQpn7Sj6QjTa0VqwwVBQhO5ZcIUSxWJE", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WhatsApp Appointments (Responses)"}}, "credentials": {"googleSheetsOAuth2Api": {"id": "RtRiRezoxiWkzZQt", "name": "Ted's Tech Talks Google account"}}, "typeVersion": 4.4, "notes": "This googleSheets node performs automated tasks as part of the workflow."}, {"id": "95486a27-a667-4555-8924-53d46b19de43", "name": "Wait 1 sec", "type": "n8n-nodes-base.wait", "position": [1700, 1184], "webhookId": "df4df4f8-378c-4228-b1e2-326b9d956e7e", "parameters": {"amount": 1}, "typeVersion": 1.1, "notes": "This wait node performs automated tasks as part of the workflow."}, {"id": "21551e78-428f-4730-a337-48d1a80bf703", "name": "New message from the user", "type": "n8n-nodes-base.googleSheets", "position": [1140, 800], "parameters": {"columns": {"value": {"Status": "New", "UserName": "={{ $json.contacts[0].profile.name }}", "UserPhone": "={{ $json.messages[0].from }}", "UserMessage": "={{ $json.messages[0].text.body }}"}, "schema": [{"id": "UserPhone", "type": "string", "display": true, "required": false, "displayName": "UserPhone", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "UserName", "type": "string", "display": true, "required": false, "displayName": "UserName", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "UserMessage", "type": "string", "display": true, "required": false, "displayName": "UserMessage", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "ReplyText", "type": "string", "display": true, "removed": true, "required": false, "displayName": "ReplyText", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "Status", "type": "string", "display": true, "required": false, "displayName": "Status", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": []}, "options": {}, "operation": "append", "sheetName": {"__rl": true, "mode": "list", "value": 1621824221, "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WA-messages"}, "documentId": {"__rl": true, "mode": "list", "value": "1T-B0yepcrCHxQpn7Sj6QjTa0VqwwVBQhO5ZcIUSxWJE", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WhatsApp Appointments (Responses)"}}, "credentials": {"googleSheetsOAuth2Api": {"id": "RtRiRezoxiWkzZQt", "name": "Ted's Tech Talks Google account"}}, "typeVersion": 4.4, "notes": "This googleSheets node performs automated tasks as part of the workflow."}, {"id": "e1478757-0094-4bcb-998f-7e3e81958319", "name": "Get new entries", "type": "n8n-nodes-base.googleSheetsTrigger", "position": [700, 320], "parameters": {"event": "rowAdded", "options": {}, "pollTimes": {"item": [{"mode": "everyX", "unit": "minutes", "value": 5}]}, "sheetName": {"__rl": true, "mode": "list", "value": 470797219, "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "Form Responses 1"}, "documentId": {"__rl": true, "mode": "list", "value": "1T-B0yepcrCHxQpn7Sj6QjTa0VqwwVBQhO5ZcIUSxWJE", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "WhatsApp Appointments (Responses)"}}, "credentials": {"googleSheetsTriggerOAuth2Api": {"id": "m33qCYf9eEvSgo0x", "name": "Ted's Tech Talks Google Sheets Trigger"}}, "typeVersion": 1, "notes": "This googleSheetsTrigger node performs automated tasks as part of the workflow."}, {"id": "14811434-d716-4999-ab53-761fc355ee09", "name": "User consented for WA messages?", "type": "n8n-nodes-base.filter", "position": [920, 320], "parameters": {"options": {}, "conditions": {"options": {"leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "combinator": "and", "conditions": [{"id": "b9bfdb33-0d9c-4320-b4bc-0bf0a469c8ca", "operator": {"name": "filter.operator.equals", "type": "string", "operation": "equals"}, "leftValue": "={{ $json[\"I consent to receive WhatsApp notifications regarding my appointments\"] }}", "rightValue": "Yes"}]}}, "typeVersion": 2, "notes": "This filter node performs automated tasks as part of the workflow."}, {"id": "20bec538-5d04-4382-ba88-a2c15421c8e7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [660, 83.6407185628741], "parameters": {"width": 744.5356369854154, "height": 404.8383233532937, "content": "## Send a WhatsApp (WA) template message\nOccurs after a user submitted a new Google form. If the user opted-in for WA notifications during the form submission, a template message will be sent via WhatsApp.\n\n**IMPORTANT!**\n1. You will need to create a new WA template message on the [Meta Business portal]({{ $env.WEBHOOK_URL }}\n2. To send outgoing WA messages you'll need an Access Token and a WhatsApp Business Account ID. These can be obtained via Meta Developers Portal after creating an a new App. Please refer to this [n8n blog article on creating WhatsApp bots]({{ $env.WEBHOOK_URL }}"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "ab7bd838-2ed1-4645-b3d9-69617a888090", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [660, 526.8263473053893], "parameters": {"width": 752.168692512586, "height": 437.60479041916165, "content": "## Store incoming WhatsApp user messages in a Google Sheet\nTo receive user messages, you need to add a WhatsApp Trigger node. In the credentials section provide an App ID and an App secret. These are obtained from the Meta Developers Portal, Basic App settings screen\n\nAfter the credentials are added, copy the trigger URL and enter it into the 'Callback URL' field in the WhatsApp configuration window in the Meta Developer portal.\n\nOnce the trigger receives a payload from WhatsApp, we check if the incoming data contains a message and add a new row with user data and message text in [Google Sheet]({{ $env.WEBHOOK_URL }}\n\nWhatsApp trigger also receives status notifications (i.e. message sent, message read etc.), so we ignore such notifications in this workflow."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "b0c62bd4-d6bc-425b-b506-b6820b3e6dc5", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [660, 1000], "parameters": {"width": 1197.9640718562885, "height": 369.34131736526945, "content": "## Reply to the user via WhatsApp\nWhatsApp allows sending automatic messages **with custom text** via bots only within the 24h time frame after the last incoming user message.\n\nAfter the user sends a message to the WhatsApp bot, a row is added to the [Google Sheet]({{ $env.WEBHOOK_URL }} with the Status 'New'\n\nType something in the `ReplyText` column and change the Status to 'Ready'.\nIn a few minutes, n8n timer will fetch all 'Ready' replies from the Google Sheet and send them one by one to the recipients"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "error-f72124ed", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [1000, 400], "parameters": {"message": "Workflow execution error", "options": {}}}], "active": true, "pinData": {}, "settings": {"callerPolicy": "workflowsFromSameOwner", "executionOrder": "v1", "saveManualExecutions": true, "saveDataSuccessExecution": "all", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "66863e99-c756-48d5-b8e0-af0907623e8a", "connections": {"8f0dc664-715f-4074-b0f7-98d3c7f563a5": {"main": [[{"node": "error-handler-8f0dc664-715f-4074-b0f7-98d3c7f563a5-6c4e0d74", "type": "main", "index": 0}]]}, "30f0a7da-c3ce-448c-ad05-b8b75da3d319": {"main": [[{"node": "error-handler-30f0a7da-c3ce-448c-ad05-b8b75da3d319-e6fb9fa6", "type": "main", "index": 0}]]}, "21551e78-428f-4730-a337-48d1a80bf703": {"main": [[{"node": "error-handler-21551e78-428f-4730-a337-48d1a80bf703-b38f0473", "type": "main", "index": 0}]]}, "e1478757-0094-4bcb-998f-7e3e81958319": {"main": [[{"node": "error-handler-e1478757-0094-4bcb-998f-7e3e81958319-29da785b", "type": "main", "index": 0}]]}}, "description": "Automated workflow: WhatsApp business bot. This workflow integrates 11 different services: filter, stickyNote, wait, googleSheetsTrigger, scheduleTrigger. It contains 19 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: WhatsApp business bot. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}