Workflow: Business WhatsApp AI RAG Chatbot
Integrations: googleDrive, httpRequest, if, manualTrigger, noOp, respondToWebhook, stickyNote, webhook, whatsApp

{"id": "APCp9GPNjUSFPSfJ", "meta": {"instanceId": "workflow-3551b4f7", "versionId": "1.0.0", "createdAt": "2025-09-29T07:08:01.114182", "updatedAt": "2025-09-29T07:08:01.114194", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "Business WhatsApp AI RAG Chatbot", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [1020, 1040], "parameters": {"options": {}, "respondWith": "text", "responseBody": "={{ $json.query['hub.challenge'] }}"}, "typeVersion": 1.1, "notes": "This respondToWebhook node performs automated tasks as part of the workflow."}, {"id": "cc230fcd-f88c-40d4-8835-ac9dc6228b18", "name": "AI Agent", "type": "n8n-nodes-base.noOp", "position": [1560, 1380], "parameters": {"text": "={{ $('Respond').item.json.body.entry[0].changes[0].value.messages[0].text.body }}", "agent": "conversationalAgent", "options": {"systemMessage": "You are an AI-powered assistant for an electronics store. Your primary goal is to assist customers by providing accurate and helpful information about products, troubleshooting tips, and general support. Use the provided knowledge base (retrieved documents) to answer questions with precision and professionalism.\n\n**Guidelines**:\n1. **Product Information**:\n - Provide detailed descriptions of products, including specifications, features, and compatibility.\n - Highlight key selling points and differences between similar products.\n - Mention availability, pricing, and promotions if applicable.\n\n2. **Technical Support**:\n - Offer step-by-step troubleshooting guides for common issues.\n - Suggest solutions for setup, installation, or configuration problems.\n - If the issue is complex, recommend contacting the store\u2019s support team for further assistance.\n\n3. **Customer Service**:\n - Respond politely and professionally to all inquiries.\n - If a question is unclear, ask for clarification to provide the best possible answer.\n - For order-related questions (e.g., status, returns, or cancellations), guide customers on how to proceed using the store\u2019s systems.\n\n4. **Knowledge Base Usage**:\n - Always reference the provided knowledge base (retrieved documents) to ensure accuracy.\n - If the knowledge base does not contain relevant information, inform the customer and suggest alternative resources or actions.\n\n5. **Tone and Style**:\n - Use a friendly, approachable, and professional tone.\n - Avoid technical jargon unless the customer demonstrates familiarity with the topic.\n - Keep responses concise but informative.\n\n**Example Interactions**:\n1. **Product Inquiry**:\n - Customer: \"What\u2019s the difference between the XYZ Smartwatch and the ABC Smartwatch?\"\n - AI: \"The XYZ Smartwatch features a longer battery life (up to 7 days) and built-in GPS, while the ABC Smartwatch has a brighter AMOLED display and supports wireless charging. Both are compatible with iOS and Android devices. Would you like more details on either product?\"\n\n2. **Technical Support**:\n - Customer: \"My wireless router isn\u2019t connecting to the internet.\"\n - AI: \"Please try the following steps: 1) Restart your router and modem. 2) Ensure all cables are securely connected. 3) Check if the router\u2019s LED indicators show a stable connection. If the issue persists, you may need to reset the router to factory settings. Would you like a detailed guide for resetting your router?\"\n\n3. **Customer Service**:\n - Customer: \"How do I return a defective product?\"\n - AI: \"To return a defective product, please visit our Returns Portal on our website and enter your order number. You\u2019ll receive a return label and instructions. If you need further assistance, our support team is available at support@electronicsstore.com.\"\n\n**Limitations**:\n- If the question is outside the scope of the knowledge base or requires human intervention, inform the customer and provide contact details for the appropriate department.\n- Do not provide speculative or unverified information. Always rely on the knowledge base or direct the customer to official resources."}, "promptType": "define"}, "typeVersion": 1.7, "notes": "This agent node performs automated tasks as part of the workflow."}, {"id": "283df38d-1a2b-44d9-8e29-5e928ca1c4c9", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [740, 1260], "parameters": {"width": 459, "height": 485, "content": "# STEP 4\n\n## RAG System\n\n\n\n\n\n\n\n\n\n\n\n\n\n* *Respond* webhook receives various POST Requests from Meta regarding WhatsApp messages (user messages + status notifications)\n* Check if the incoming JSON contains user message\n* Echo back the text message to the user. This is a custom message, not a WhatsApp Business template message\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "b8f5ac53-03fe-4151-ac56-b246245702b6", "name": "OpenAI Chat Model", "type": "n8n-nodes-base.noOp", "position": [1560, 1580], "parameters": {"model": {"__rl": true, "mode": "list", "value": "gpt-4o-mini"}, "options": {}}, "credentials": {"openAiApi": {"id": "CDX6QM4gLYanh0P4", "name": "OpenAi account"}}, "typeVersion": 1.2, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow."}, {"id": "a02f4e76-1895-48ad-a2d5-6daf3347f181", "name": "When clicking \u2018Test workflow\u2019", "type": "n8n-nodes-base.manualTrigger", "position": [460, 100], "parameters": {}, "typeVersion": 1, "notes": "This manualTrigger node performs automated tasks as part of the workflow."}, {"id": "35a71dd7-ae08-46c5-acb2-e66d92b311cb", "name": "Qdrant Vector Store", "type": "n8n-nodes-base.noOp", "position": [1440, 220], "parameters": {"mode": "insert", "options": {}, "qdrantCollection": {"__rl": true, "mode": "id", "value": "=COLLECTION"}}, "credentials": {"qdrantApi": {"id": "iyQ6MQiVaF3VMBmt", "name": "QdrantApi account"}}, "typeVersion": 1, "notes": "This vectorStoreQdrant node performs automated tasks as part of the workflow."}, {"id": "1538c8b1-f914-4991-b311-e533df625c5f", "name": "Create collection", "type": "n8n-nodes-base.httpRequest", "position": [760, -40], "parameters": {"url": "{{ $env.WEBHOOK_URL }}", "method": "POST", "options": {}, "jsonBody": "{\n \"filter\": {}\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth", "headerParameters": {"parameters": [{"name": "Content-Type", "value": "application/json"}]}}, "credentials": {"httpHeaderAuth": {"id": "qhny6r5ql9wwotpn", "name": "Qdrant API (Hetzner)"}}, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "423b73a6-2497-4635-9ad0-9e768f32018d", "name": "Refresh collection", "type": "n8n-nodes-base.httpRequest", "position": [760, 220], "parameters": {"url": "{{ $env.WEBHOOK_URL }}", "method": "POST", "options": {}, "jsonBody": "{\n \"filter\": {}\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "{{ $credentials.genericCredentialType }}", "genericAuthType": "httpHeaderAuth", "headerParameters": {"parameters": [{"name": "Content-Type", "value": "application/json"}]}}, "credentials": {"httpHeaderAuth": {"id": "qhny6r5ql9wwotpn", "name": "Qdrant API (Hetzner)"}}, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "9519866a-f28a-495a-9cb4-3b2170407943", "name": "Get folder", "type": "n8n-nodes-base.googleDrive", "position": [980, 220], "parameters": {"filter": {"driveId": {"__rl": true, "mode": "list", "value": "My Drive", "cachedResultUrl": "{{ $env.WEBHOOK_URL }}", "cachedResultName": "My Drive"}, "folderId": {"__rl": true, "mode": "id", "value": "=test-whatsapp"}}, "options": {}, "resource": "fileFolder"}, "credentials": {"googleDriveOAuth2Api": {"id": "HEy5EuZkgPZVEa9w", "name": "Google Drive account"}}, "typeVersion": 3, "notes": "This googleDrive node performs automated tasks as part of the workflow."}, {"id": "c9a36259-8340-4382-8bb0-84b73a8288c6", "name": "Download Files", "type": "n8n-nodes-base.googleDrive", "position": [1200, 220], "parameters": {"fileId": {"__rl": true, "mode": "id", "value": "={{ $json.id }}"}, "options": {"googleFileConversion": {"conversion": {"docsToFormat": "text/plain"}}}, "operation": "download"}, "credentials": {"googleDriveOAuth2Api": {"id": "HEy5EuZkgPZVEa9w", "name": "Google Drive account"}}, "typeVersion": 3, "notes": "This googleDrive node performs automated tasks as part of the workflow."}, {"id": "b20975d7-e367-49a3-ac8c-613289775463", "name": "Embeddings OpenAI", "type": "n8n-nodes-base.noOp", "position": [1420, 420], "parameters": {"options": {}}, "credentials": {"openAiApi": {"id": "CDX6QM4gLYanh0P4", "name": "OpenAi account"}}, "typeVersion": 1.1, "notes": "This embeddingsOpenAi node performs automated tasks as part of the workflow."}, {"id": "4c2d02a4-c954-42c4-97b0-b94ee3198f56", "name": "Default Data Loader", "type": "n8n-nodes-base.noOp", "position": [1600, 420], "parameters": {"options": {}, "dataType": "binary"}, "typeVersion": 1, "notes": "This documentDefaultDataLoader node performs automated tasks as part of the workflow."}, {"id": "72591129-1691-4caf-bf63-c04db85708dc", "name": "Token Splitter", "type": "n8n-nodes-base.noOp", "position": [1560, 580], "parameters": {"chunkSize": 300, "chunkOverlap": 30}, "typeVersion": 1, "notes": "This textSplitterTokenSplitter node performs automated tasks as part of the workflow."}, {"id": "cc74592d-6562-4816-917c-0d88913a8125", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [200, 1140], "parameters": {"color": 3, "width": 405, "height": 177, "content": "## Important!\n### Configure the webhook nodes this way:\n* Make sure that both *Verify* and *Respond* have the same URL\n* *Verify* should have GET HTTP Method\n* *Respond* should have POST HTTP Method"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "9c8d4973-dcc5-4506-967f-3b3a5df501fa", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [740, 800], "parameters": {"color": 5, "width": 618, "height": 392, "content": "# STEP 3\n\n## Create Webhook\n* Go to your [Meta for Developers App page]({{ $env.WEBHOOK_URL }} navigate to the App settings\n* Add a **production webhook URL** as a new Callback URL\n* *Verify* webhook receives a GET Request and sends back a verification code\n* After that you can delete this\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "ec013e0c-a354-4f12-8ded-97013bb8fb21", "name": "Verify", "type": "n8n-nodes-base.webhook", "position": [780, 1040], "webhookId": "f0d2e6f6-8fda-424d-b377-0bd191343c20", "parameters": {"path": "f0d2e6f6-8fda-424d-b377-0bd191343c20", "options": {}, "responseMode": "responseNode"}, "typeVersion": 2, "notes": "This webhook node performs automated tasks as part of the workflow."}, {"id": "253ddc93-5693-4362-aa6c-a80ab3f6df82", "name": "Respond", "type": "n8n-nodes-base.webhook", "position": [760, 1420], "webhookId": "f0d2e6f6-8fda-424d-b377-0bd191343c20", "parameters": {"path": "f0d2e6f6-8fda-424d-b377-0bd191343c20", "options": {}, "httpMethod": "POST"}, "typeVersion": 2, "notes": "This webhook node performs automated tasks as part of the workflow."}, {"id": "2d4b956e-92d9-41da-a6d3-9f588e453d2a", "name": "is Message?", "type": "n8n-nodes-base.if", "position": [980, 1420], "parameters": {"options": {}, "conditions": {"options": {"version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "loose"}, "combinator": "and", "conditions": [{"id": "959fbffc-876a-4235-87be-2dedba4926cd", "operator": {"type": "object", "operation": "exists", "singleValue": true}, "leftValue": "={{ $json.body.entry[0].changes[0].value.messages[0] }}", "rightValue": ""}]}, "looseTypeValidation": true}, "typeVersion": 2.2, "notes": "This if node performs automated tasks as part of the workflow."}, {"id": "2af633a9-f6b0-4989-9e85-abb619d2b3bb", "name": "Only message", "type": "n8n-nodes-base.whatsApp", "position": [1280, 1520], "parameters": {"textBody": "=You can only send text messages", "operation": "send", "phoneNumberId": "470271332838881", "requestOptions": {}, "additionalFields": {}, "recipientPhoneNumber": "={{ $('Respond').item.json.body.entry[0].changes[0].value.contacts[0].wa_id }}"}, "credentials": {"whatsAppApi": {"id": "HDUOWQXeRXMVjo0Z", "name": "WhatsApp account"}}, "typeVersion": 1, "notes": "This whatsApp node performs automated tasks as part of the workflow."}, {"id": "5235dd06-2235-4edb-904e-872848e2ed79", "name": "Send", "type": "n8n-nodes-base.whatsApp", "position": [1980, 1380], "parameters": {"textBody": "={{ $json.output }}", "operation": "send", "phoneNumberId": "470271332838881", "requestOptions": {}, "additionalFields": {}, "recipientPhoneNumber": "={{ $('Respond').item.json.body.entry[0].changes[0].value.contacts[0].wa_id }}"}, "credentials": {"whatsAppApi": {"id": "HDUOWQXeRXMVjo0Z", "name": "WhatsApp account"}}, "typeVersion": 1, "notes": "This whatsApp node performs automated tasks as part of the workflow."}, {"id": "dafe692e-7767-4ded-966c-df812f58ae63", "name": "Window Buffer Memory", "type": "n8n-nodes-base.noOp", "position": [1760, 1580], "parameters": {}, "typeVersion": 1.3, "notes": "This memoryBufferWindow node performs automated tasks as part of the workflow."}, {"id": "ba6254bd-4dad-47bb-a535-7b6b708ea763", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [960, -100], "parameters": {"color": 6, "width": 880, "height": 220, "content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "83cf4483-cd45-4de6-9b88-e00727ed8352", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [740, 160], "parameters": {"color": 4, "width": 620, "height": 400, "content": "# STEP 2\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "4e0a4245-370f-4596-b01b-4eed8acbe2c3", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [1520, 1260], "parameters": {"width": 380, "height": 260, "content": "## Configure AI Agent\nSet System prompt and chat model. If you want you can set any tools"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}], "active": false, "pinData": {}, "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "4eb1a148-185f-4f16-a6ad-01c3201d4fc0", "connections": {"2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01": {"main": [[{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-19965498", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-94fc4019", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-a7737dc2", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-3ef6ba3a", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-7596e3da", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-e98624ff", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-e1118c41", "type": "main", "index": 0}], [{"node": "error-handler-2c5b2dd1-c63f-4bc9-909e-5f4b2a385d01-02f2cb55", "type": "main", "index": 0}]]}, "1538c8b1-f914-4991-b311-e533df625c5f": {"main": [[{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-f1bb7399", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-20d8576a", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-9198b63d", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-ba6be009", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-827e9336", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-5f5ca1a4", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-14ffe6a6", "type": "main", "index": 0}], [{"node": "error-handler-1538c8b1-f914-4991-b311-e533df625c5f-f012247d", "type": "main", "index": 0}]]}, "423b73a6-2497-4635-9ad0-9e768f32018d": {"main": [[{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-f793d438", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-afcaad29", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-1e39c774", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-94ceb197", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-37dcff6b", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-a7749a0d", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-80bee161", "type": "main", "index": 0}], [{"node": "error-handler-423b73a6-2497-4635-9ad0-9e768f32018d-0fab4554", "type": "main", "index": 0}]]}, "ec013e0c-a354-4f12-8ded-97013bb8fb21": {"main": [[{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-011728e3", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-7c49849f", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-8ab95291", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-a83d0f65", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-ed1393e3", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-9d4ecedd", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-3bd3b80c", "type": "main", "index": 0}], [{"node": "error-handler-ec013e0c-a354-4f12-8ded-97013bb8fb21-9174e8ae", "type": "main", "index": 0}]]}, "253ddc93-5693-4362-aa6c-a80ab3f6df82": {"main": [[{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-99a733b5", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-8a488b77", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-9846fcca", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-aa2af787", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-1ac5ac6d", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-1b1193b0", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-b65fd1f6", "type": "main", "index": 0}], [{"node": "error-handler-253ddc93-5693-4362-aa6c-a80ab3f6df82-64ee940c", "type": "main", "index": 0}]]}, "b8f5ac53-03fe-4151-ac56-b246245702b6": {"main": [[{"node": "error-handler-b8f5ac53-03fe-4151-ac56-b246245702b6-6db3f1bb", "type": "main", "index": 0}]]}, "9519866a-f28a-495a-9cb4-3b2170407943": {"main": [[{"node": "error-handler-9519866a-f28a-495a-9cb4-3b2170407943-0a7f33fb", "type": "main", "index": 0}]]}, "c9a36259-8340-4382-8bb0-84b73a8288c6": {"main": [[{"node": "error-handler-c9a36259-8340-4382-8bb0-84b73a8288c6-68849ca3", "type": "main", "index": 0}]]}, "b20975d7-e367-49a3-ac8c-613289775463": {"main": [[{"node": "error-handler-b20975d7-e367-49a3-ac8c-613289775463-88b3a6ac", "type": "main", "index": 0}]]}}, "description": "Automated workflow: Business WhatsApp AI RAG Chatbot. This workflow integrates 16 different services: webhook, stickyNote, httpRequest, textSplitterTokenSplitter, vectorStoreQdrant. It contains 38 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Business WhatsApp AI RAG Chatbot. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}