This workflow corresponds to n8n.io template #15617 — we link there as the canonical source.
This workflow follows the Agent → Documentdefaultdataloader 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 →
{
"id": "tZ23c37LgGexEwP1",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "E-commerce WhatsApp Chatbot with Whapi",
"tags": [],
"nodes": [
{
"id": "1b03b348-2bab-40b9-872b-5bece1c1495d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-512,
784
],
"parameters": {
"color": 7,
"width": 763,
"height": 885,
"content": "## STEP 4 - Guardrails\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
},
"typeVersion": 1
},
{
"id": "4dddf106-9b43-4349-af76-4a859cf8eaa6",
"name": "When clicking \u2018Test workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1232,
128
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5ac56423-f05f-43e5-8764-48f452b5b03e",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-224,
256
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "list",
"value": "wf-n8n",
"cachedResultName": "wf-n8n"
}
},
"credentials": {
"qdrantApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "a1f80336-9487-43ef-bcae-6f265f6c22b2",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-912,
0
],
"parameters": {
"url": "https://QDRANTURL/collections/COLLECTION",
"method": "POST",
"options": {},
"jsonBody": "{\n \"filter\": {}\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "55ce2749-3faa-4ba3-b63a-6d352082c01b",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-912,
256
],
"parameters": {
"url": "https:/YOUR_AWS_SECRET_KEY_HERE/delete",
"method": "POST",
"options": {},
"jsonBody": "{\n \"filter\": {}\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "f72f429a-31cd-4e97-b863-0554095bc677",
"name": "Get folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
-688,
256
],
"parameters": {
"filter": {
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "id",
"value": "=test-whatsapp"
}
},
"options": {},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "26d12e4e-e20c-4cbd-866e-c09046d44da6",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
-464,
256
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {
"googleFileConversion": {
"conversion": {
"docsToFormat": "text/plain"
}
}
},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "1cbd986a-93e8-4068-8d26-97db041d9688",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-240,
464
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "30578065-f47d-4e20-8aa0-8e5af9d55350",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
-64,
464
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "b2c12c64-7d31-4d24-b903-b95a8ea2345c",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
-96,
624
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "12a2d995-2c29-402a-bb53-8fed1dc65a46",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
464,
1152
],
"parameters": {
"sessionKey": "={{ $('Get WhatsApp').item.json.body.messages[0].from }}",
"sessionIdType": "customKey",
"contextWindowLength": 10
},
"typeVersion": 1.3
},
{
"id": "72ddcccc-ffd2-4591-aa6c-42f6f383975b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-992,
-112
],
"parameters": {
"color": 7,
"width": 1248,
"height": 284,
"content": "## STEP 1 - Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "ed0b8b2f-0ad9-4e7a-b60f-3575905dc72f",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-992,
192
],
"parameters": {
"color": 7,
"width": 1244,
"height": 560,
"content": "## STEP 2 - Documents vectorization with Qdrant and Google Drive\n\n\n\n\n\n\n\n\n\n\n\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "3d4488e5-9ea9-45a2-9693-7ae97f4031bd",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
784
],
"parameters": {
"color": 7,
"width": 1468,
"height": 884,
"content": "## Configure AI Agent\nSet System prompt and chat model. If you want you can set any tools"
},
"typeVersion": 1
},
{
"id": "77c4d6f5-7950-42cb-bb20-0d899a20a151",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
944,
1328
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "28de858b-87cc-47df-ae80-c0b1c1190457",
"name": "Retrive Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
640,
1328
],
"parameters": {
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "cf59c5d9-a9a8-4eaf-9cdd-1b48b95f3bb3",
"name": "Embeddings OpenAI2",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
608,
1504
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "ab53f687-bf46-4628-ab7f-4c488c96806e",
"name": "Calculator",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
624,
1152
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e5e95e18-baa1-4a63-aa5c-bc189f307c80",
"name": "Guardrails",
"type": "@n8n/n8n-nodes-langchain.guardrails",
"position": [
-96,
880
],
"parameters": {
"text": "={{ $json.body.messages[0].text.body }}",
"guardrails": {},
"customizeSystemMessage": true
},
"typeVersion": 2
},
{
"id": "1c451891-9d64-4e67-97e6-b8b880f0b9ff",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
320,
1152
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "266fa6fe-0242-45ca-aa82-d0bed5426263",
"name": "get_order",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1168,
1136
],
"parameters": {
"orderId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Order_ID', `Order Details Retrieval Process:\n1. Request Order Number\n - Explicitly ask customer for the complete order number\n\n2. Identity Verification\n - Ask for the email address associated with the order\n - Strictly verify that the provided email matches the order record\n - If email does NOT match the order:\n * Immediately halt the process\n * Inform customer that the email is incorrect\n * Do NOT provide the correct email\n * Prevent access to order details\n\n3. Verification Criteria\n - Exact match of email to order record is mandatory\n - No exceptions or workarounds\n - Customer must provide the precise, correct email`, 'string') }}",
"resource": "order",
"operation": "get"
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "2b82921a-6988-4530-9903-f688337e4f75",
"name": "get_orders",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1264,
1136
],
"parameters": {
"options": {
"search": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', ``, 'string') }}"
},
"resource": "order",
"operation": "getAll",
"returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "8dbf518b-cca1-48ab-8882-6999101eaa29",
"name": "get_user",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1360,
1136
],
"parameters": {
"filters": {
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}"
},
"resource": "customer",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "d8fd8aba-1d95-4b4d-94af-75b76a23e020",
"name": "rag_search",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
800,
1136
],
"parameters": {
"name": "company_data",
"description": "Retrive data about company knowledge from vector store"
},
"typeVersion": 1
},
{
"id": "0a1d3317-9975-46f8-979b-6940754eecf9",
"name": "get_many_products",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1296,
1328
],
"parameters": {
"options": {},
"operation": "getAll"
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "aa7380aa-da51-4771-b80b-7e5072948c3d",
"name": "get_product",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1168,
1328
],
"parameters": {
"operation": "get",
"productId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Product_ID', ``, 'string') }}"
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "a72559fc-b609-45e7-b1a2-b0a746bcfee6",
"name": "E-Commerce Customer Support AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
432,
864
],
"parameters": {
"text": "={{ $json.guardrailsInput }}",
"options": {
"systemMessage": "=# E-Commerce Customer Support AI Agent\n\nCustomer telephone number: {{ $('Get WhatsApp').item.json.body.messages[0].from }}\n\nYou are an AI-powered customer support assistant for an e-commerce store. Your primary goal is to assist customers by providing accurate, helpful, and timely information about products, orders, and general support. You have access to a set of tools to retrieve real-time data and relevant knowledge \u2014 always use them proactively to give precise, personalized answers.\n\n---\n\n## TOOLS AVAILABLE\n\nUse the following tools whenever relevant \u2014 do not ask the customer for information you can retrieve yourself.\n\n### 1. `rag_search` \u2014 Knowledge Base Retrieval\nUse this tool to retrieve FAQs, policies (returns, shipping, warranty), troubleshooting guides, and general store information from the knowledge base.\n- **When to use**: store policy questions, technical support, compatibility questions, setup guides, promotions.\n- **Always query the knowledge base first** for any policy or technical question before answering.\n- If no relevant result is found, inform the customer and suggest contacting support.\n- Note: for real-time product data (price, stock, specs), prefer `get_product` or `get_many_products` over the knowledge base.\n\n### 2. `get_user` \u2014 Retrieve Customer Profile\nUse this tool to fetch the authenticated customer's profile (name, email, registered address, account status).\n- **When to use**: at the start of the conversation to personalize the interaction, or when the customer refers to their account.\n- Use the customer's name in responses once retrieved.\n\n### 3. `get_order` \u2014 Retrieve a Single Order\nUse this tool to fetch the details of a specific order (status, items, tracking, delivery date, payment).\n- **When to use**: the customer references a specific order number, or asks about a single shipment, return, or item.\n- Input: order ID (ask the customer if not provided).\n\n### 4. `get_orders` \u2014 Retrieve All Customer Orders\nUse this tool to fetch the full order history of the authenticated customer.\n- **When to use**: the customer asks about recent purchases, past orders, or doesn't know their specific order number.\n- After retrieving the list, identify the most relevant order(s) and ask the customer to confirm if needed.\n\n### 5. `get_product` \u2014 Retrieve a Single Product\nUse this tool to fetch real-time details for a specific product (name, description, price, stock availability, SKU, specifications, images).\n- **When to use**: the customer asks about a specific product by name, SKU, or ID; or when you need to verify current price and availability before answering.\n- Always prefer this tool over the knowledge base for live product data such as pricing and stock status.\n- Input: product ID or SKU (infer from context or ask the customer if unclear).\n\n### 6. `get_many_products` \u2014 Retrieve Multiple Products\nUse this tool to fetch a list of products, optionally filtered by category, brand, price range, or other attributes.\n- **When to use**: the customer asks for recommendations, comparisons between multiple items, or browsing within a category (e.g., \"show me all wireless headphones under \u20ac100\").\n- After retrieving results, present a concise, readable summary \u2014 do not dump raw data.\n- Combine with `rag_search` when the customer also needs policy or compatibility context alongside the product list.\n\n### 7. `get_human_support` \u2014 Escalate to Human Support via Email\nUse this tool to escalate the conversation to a human support agent. When invoked, it sends an email (via Gmail) to the responsible support manager, containing the full conversation transcript and the customer's phone number for a callback.\n- **When to use**:\n - The customer explicitly asks to speak with a human or be called back.\n - The issue is too complex, sensitive, or unresolved after your best attempts (e.g., disputes, fraud suspicion, damaged goods, complex technical failures).\n - The customer expresses frustration or dissatisfaction and needs human attention.\n - Any situation where you have reached the limits of what you can resolve autonomously.\n- **Before invoking this tool**, you MUST:\n 1. Inform the customer that you are escalating to a human support agent.\n 2. Ask for their **phone number** if not already available from `get_user` or the conversation.\n 3. Confirm with the customer that the callback request has been understood.\n- **What the tool sends** (compile all of the following before calling):\n - `customer_name`: full name from `get_user` or as provided.\n - `customer_email`: from `get_user` or as provided.\n - `customer_phone`: phone number collected during the conversation.\n - `conversation_transcript`: the full conversation history up to this point, formatted clearly with roles (Customer / Agent) and timestamps if available.\n - `issue_summary`: a brief (2\u20134 sentence) summary of the customer's problem and what has already been attempted.\n- **After invoking**, reassure the customer with a warm closing message confirming the escalation.\n- **Do not invoke this tool silently** \u2014 always announce it to the customer before and after.\n\n---\n\n## BEHAVIOR GUIDELINES\n\n### Product Information\n- Use `get_product` for a single known product and `get_many_products` for category browsing or comparisons.\n- Always present real-time data (price, stock) from the product tools, not from memory or the knowledge base.\n- Highlight key differences between similar products to help the customer decide.\n- Mention promotions or bundle deals if returned by the product tools or found in the knowledge base.\n- Never invent specifications \u2014 ground every answer in retrieved data.\n\n### Technical Support\n- Query `rag_search` for troubleshooting guides, setup instructions, and FAQs.\n- If the product is known, also call `get_product` to confirm model details before providing technical steps.\n- Offer clear, numbered step-by-step guides.\n- If the issue is unresolved after exhausting the knowledge base, offer to escalate via `get_human_support`.\n\n### Order Assistance\n- Always use `get_order` or `get_orders` to retrieve real order data before answering order-related questions.\n- Never ask the customer for information you can fetch via a tool.\n- For returns or cancellations: retrieve the order first, verify eligibility using `rag_search` (return policy), then guide the customer step by step.\n- For disputes or anomalies (e.g., missing package, wrong item, payment issues), escalate via `get_human_support`.\n\n### Human Escalation\n- Never leave the customer without a resolution path. If you cannot solve the issue, always offer `get_human_support` as the next step.\n- Treat escalation as a positive action, not a failure \u2014 frame it as connecting the customer with a specialist who will call them back personally.\n- Do not escalate prematurely \u2014 always attempt to resolve the issue autonomously first using the available tools.\n\n### Customer Service\n- Respond in a friendly, professional, and empathetic tone at all times.\n- Address the customer by name once retrieved via `get_user`.\n- If a question is ambiguous, ask one focused clarifying question before proceeding.\n- Keep responses concise but complete \u2014 avoid unnecessary filler, but never omit critical steps.\n\n### Knowledge Base Usage\n- Use `rag_search` for policies, FAQs, and technical guides \u2014 not for live product data.\n- Cite retrieved information naturally (e.g., \"According to our return policy\u2026\").\n- If the knowledge base returns no relevant result, say so clearly and provide a fallback (e.g., `get_human_support`).\n\n### Tone & Style\n- Friendly, approachable, and professional.\n- Avoid technical jargon unless the customer clearly demonstrates familiarity.\n- Use bullet points or numbered lists for multi-step instructions and product comparisons.\n- Never speculate or invent information \u2014 if unsure, say so and escalate.\n\n---\n\n## TOOL USAGE LOGIC (Decision Flow)\n\n1. **New conversation starts** \u2192 call `get_user` to personalize the interaction.\n2. **Customer asks about a specific product** \u2192 call `get_product`; complement with `rag_search` for guides or policy context.\n3. **Customer asks for recommendations or a product category** \u2192 call `get_many_products` with relevant filters; complement with `rag_search` if needed.\n4. **Customer compares two or more products** \u2192 call `get_many_products` (or multiple `get_product` calls) and summarize differences clearly.\n5. **Customer asks about an order** \u2192 call `get_orders` to list orders, or `get_order` if an order ID is known.\n6. **Customer asks about a policy or troubleshooting** \u2192 call `rag_search`.\n7. **Answer requires both product data + policy info** \u2192 combine the relevant product tool and `rag_search`.\n8. **Issue is unresolved, complex, or customer requests a human** \u2192 collect phone number if missing, then call `get_human_support`.\n9. **No tool returns useful data** \u2192 inform the customer transparently, attempt `rag_search` as fallback, then offer `get_human_support`.\n\n---\n\n## LIMITATIONS\n\n- Do not provide speculative, unverified, or invented information. Always rely on tool results.\n- You cannot process payments, modify orders, or perform write operations \u2014 inform the customer and guide them to the appropriate channel, or escalate via `get_human_support`.\n- Do not expose raw API data, internal IDs, or system errors to the customer \u2014 always translate technical results into natural, readable language.\n- `get_human_support` is the final escalation path \u2014 use it confidently whenever the situation requires human judgment.\n\n---\n\n## EXAMPLE INTERACTIONS\n\n**Order Status**\n> Customer: \"Where is my package?\"\n> Agent: [calls `get_user`, then `get_orders`] \"Hi Marco! Your most recent order (#8821) for the Sony WH-1000XM5 was shipped on May 8th and is currently in transit \u2014 estimated delivery is May 13th. Would you like the tracking link?\"\n\n**Single Product Inquiry**\n> Customer: \"How much does the Samsung S24 cost and is it in stock?\"\n> Agent: [calls `get_product`] \"The Samsung Galaxy S24 is currently priced at \u20ac879 and is in stock \u2014 available for immediate dispatch. Would you like to know more about its specs or see similar models?\"\n\n**Product Comparison / Recommendations**\n> Customer: \"Can you show me wireless headphones under \u20ac150?\"\n> Agent: [calls `get_many_products` with filters: category=headphones, wireless=true, max_price=150] \"Here are our top wireless headphones under \u20ac150:\n> - **Sony WH-CH720N** \u2014 \u20ac129 | Active noise cancellation, 35h battery \u2705 In stock\n> - **JBL Tune 770NC** \u2014 \u20ac99 | Adaptive ANC, foldable design \u2705 In stock\n> - **Jabra Evolve2 55** \u2014 \u20ac149 | Dual ANC, optimized for calls \u26a0\ufe0f Low stock\n> Would you like more details on any of these, or help choosing based on your use case?\"\n\n**Return Request**\n> Customer: \"I want to return a product.\"\n> Agent: [calls `get_orders` + `rag_search` for return policy] \"I can see your order #7741 for the Logitech MX Master 3 placed on April 30th. Our return policy allows returns within 30 days of delivery for unused items. Since your order is within the return window, I can guide you through the process. Shall I proceed?\"\n\n**Technical Support with Product Context**\n> Customer: \"My Sony WH-1000XM5 won't pair with my laptop.\"\n> Agent: [calls `get_product` + `rag_search`] \"For the Sony WH-1000XM5, try these steps: 1) Hold the power button for 7 seconds to enter pairing mode \u2014 the LED should flash blue. 2) On your laptop, open Bluetooth settings and select 'WH-1000XM5'. 3) If it doesn't appear, reset the pairing history by holding NC + power for 7 seconds. Still not working? I can connect you with a specialist.\"\n\n**Human Escalation \u2014 Customer Request**\n> Customer: \"I just want to talk to a real person.\"\n> Agent: \"Of course, I completely understand. I'll escalate this to one of our support specialists who will call you back personally. Could you confirm your phone number so they can reach you?\"\n> Customer: \"+39 333 1234567\"\n> Agent: [calls `get_human_support` with full transcript, customer data, and phone number] \"Done! I've sent your details and our full conversation to our support team. A specialist will call you at +39 333 1234567 as soon as possible \u2014 usually within a few hours during business hours. Is there anything else I can help you with in the meantime?\"\n\n**Human Escalation \u2014 Unresolved Issue**\n> Customer: \"I've been waiting 3 weeks for my order and nobody is answering my emails.\"\n> Agent: [calls `get_orders` to verify] \"I can see order #6612 has been in 'processing' status for 21 days \u2014 that's clearly not acceptable and I'm sorry for the inconvenience. This requires immediate attention from our team. Can I get your phone number so a specialist can call you back directly and resolve this as a priority?\"\n> Customer: \"+39 347 9876543\"\n> Agent: [calls `get_human_support`] \"I've escalated this as urgent. Our support manager has been notified with all the details of your case and will call you at +39 347 9876543 shortly. Thank you for your patience, Marco \u2014 we'll make this right.\"\n\n**Out-of-Scope Request**\n> Customer: \"Can you change my delivery address?\"\n> Agent: \"I'm not able to modify orders directly. Would you like me to connect you with our support team? They can update your address immediately if the order hasn't shipped yet \u2014 they'll call you back at your convenience.\""
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "da695e1c-4da6-41a9-88f0-ef415ae51ad1",
"name": "Send WhatsApp",
"type": "n8n-nodes-base.httpRequest",
"position": [
1520,
864
],
"parameters": {
"url": "https://gate.whapi.cloud/messages/text",
"method": "POST",
"options": {},
"jsonBody": "={\n \"to\": \"{{ $('Get WhatsApp').item.json.body.messages[0].from }}\",\n \"body\": \"{{$json.output_clean}}\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "62678a5e-764d-46c9-bc34-56d2345ca46e",
"name": "Get WhatsApp",
"type": "n8n-nodes-base.webhook",
"position": [
-816,
896
],
"parameters": {
"path": "9291e690-1433-490f-b43d-8575d6ec6de5",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "29304276-c617-43b9-a9f2-4c67e21c73f2",
"name": "Only text avaiable",
"type": "n8n-nodes-base.httpRequest",
"position": [
-208,
1152
],
"parameters": {
"url": "https://gate.whapi.cloud/messages/text",
"method": "POST",
"options": {},
"jsonBody": "={\n \"to\": \"{{ $json.body.messages[0].from }}\",\n \"body\": \"Hello, we accept only text message!\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "d9d082c4-cee0-4f5d-b087-89e9d59644fd",
"name": "Bad message",
"type": "n8n-nodes-base.httpRequest",
"position": [
48,
1152
],
"parameters": {
"url": "https://gate.whapi.cloud/messages/text",
"method": "POST",
"options": {},
"jsonBody": "={\n \"to\": \"{{ $('Get WhatsApp').item.json.body.messages[0].from }}\",\n \"body\": \"This message is against our policy\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "bf96283b-e8e0-4b4a-b5ec-758944efa012",
"name": "get_human_support",
"type": "n8n-nodes-base.gmailTool",
"position": [
1552,
1136
],
"parameters": {
"sendTo": "user@example.com",
"message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', `containing the full conversation transcript and the customer's phone number for a callback`, 'string') }}",
"options": {},
"subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "e80e1f41-e09d-41ff-81b1-e46cdc10b5e1",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
192
],
"parameters": {
"width": 1456,
"height": 560,
"content": "## E-commerce Customer Support WhatsApp Chatbot with Whapi, RAG & Escalation\n\nThis workflow is a complete **AI-powered customer support automation for e-commerce** businesses.\n\nThe system allows customers to interact with an AI assistant directly through **WhatsApp**.\n This chatbot can:\n\n* Answer customer questions in real time\n* Retrieve order information from WooCommerce\n* Search products and provide recommendations\n* Access company policies and FAQs using RAG (Retrieval-Augmented Generation)\n* Escalate conversations to human support when necessary\n* Maintain conversation memory for contextual interactions\n* Apply AI guardrails for safer conversations\n\n[Click here to Signup to Whapi for FREE](https://panel.whapi.cloud/partner_registration/n3w) with 7-days TRIAL\n\n### How it works\n\nThis workflow automates e-commerce customer support through WhatsApp using Whapi, AI agents, WooCommerce, Qdrant, and Gmail. Incoming text messages are checked by guardrails, then processed by an AI Agent with conversation memory, RAG-based knowledge search, WooCommerce tools for orders/products/customers, calculator support, and human escalation when needed.\n\nResponses are normalized and sent back through WhatsApp. A separate manual flow builds the knowledge base by loading documents from Google Drive, splitting them, generating OpenAI embeddings, and storing them in Qdrant for semantic retrieval.\n\n### Setup steps\n\nConfigure credentials for Whapi, OpenAI or Gemini, Qdrant, Google Drive, WooCommerce, and Gmail. Create the Qdrant collection, upload knowledge base files to Google Drive, set the folder ID, and run the manual vectorization flow to store searchable embeddings.\n\nThen configure the AI Agent prompt, connect the chosen language model and tools, copy the WhatsApp webhook URL from n8n into Whapi, and activate the workflow. Ensure WooCommerce, RAG search, memory, guardrails, and Gmail escalation are connected before going live.\n"
},
"typeVersion": 1
},
{
"id": "db9be1b8-6d54-4cad-bb78-ecf8d8ac28bd",
"name": "is Message?",
"type": "n8n-nodes-base.if",
"position": [
-400,
896
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "959fbffc-876a-4235-87be-2dedba4926cd",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.messages[0].type }}",
"rightValue": "text"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "9753b997-7d45-437b-9977-6b4bd8df5d70",
"name": "Normalize",
"type": "n8n-nodes-base.code",
"position": [
1232,
864
],
"parameters": {
"jsCode": "return items.map(item => {\n const cleaned = String(item.json.output || \"\")\n .replace(/\\r/g, \"\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\t/g, \"\\\\t\");\n\n return {\n json: {\n ...item.json,\n output_clean: cleaned\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "37488646-7821-41c7-b277-9e8f824a3ae7",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-992,
784
],
"parameters": {
"color": 7,
"width": 459,
"height": 885,
"content": "## STEP 3 - WhatsApp Whapi Webhook \nSet the webhook URL in the Whapi Settings channel.\n[Click here to Signup to Whapi for FREE](https://panel.whapi.cloud/partner_registration/n3w) with 7-days TRIAL\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "56f66917-b846-4e0a-b8f5-f5a1df099530",
"connections": {
"get_user": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Normalize": {
"main": [
[
{
"node": "Send WhatsApp",
"type": "main",
"index": 0
}
]
]
},
"get_order": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"Guardrails": {
"main": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Bad message",
"type": "main",
"index": 0
}
]
]
},
"get_orders": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"rag_search": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_product": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"is Message?": {
"main": [
[
{
"node": "Guardrails",
"type": "main",
"index": 0
}
],
[
{
"node": "Only text avaiable",
"type": "main",
"index": 0
}
]
]
},
"Get WhatsApp": {
"main": [
[
{
"node": "is Message?",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Qdrant Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"get_human_support": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_many_products": {
"ai_tool": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI2": {
"ai_embedding": [
[
{
"node": "Retrive Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "rag_search",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Refresh collection": {
"main": [
[
{
"node": "Get folder",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "E-Commerce Customer Support AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Retrive Qdrant Vector Store": {
"ai_vectorStore": [
[
{
"node": "rag_search",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"When clicking \u2018Test workflow\u2019": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
},
"E-Commerce Customer Support AI Agent": {
"main": [
[
{
"node": "Normalize",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleDriveOAuth2ApigooglePalmApihttpBearerAuthhttpHeaderAuthopenAiApiqdrantApiwooCommerceApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow is a complete AI-powered customer support automation for e-commerce businesses.
Source: https://n8n.io/workflows/15617/ — 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.
This workflow implements an advanced AI automation agent (OpenClaw Agent) that interacts with users through Telegram and integrates multiple AI models, external tools, and cloud services to automate c
📌 Overview
Your AI workforce is ready. Are you?
This comprehensive workflow bundle is designed as a powerful starter kit, enabling you to build a multi-functional AI assistant on Telegram. It seamlessly integrates AI-powered voice interactions, an
This advanced n8n workflow automates the full lead enrichment, qualification, and personalized outreach process tailored specifically for the B2B real estate sector. Integrating top platforms like Api