Revert "change to json formatted text and reformat all .txt to .json & fix error json format"

This commit is contained in:
Enes Cingöz
2025-07-05 22:28:12 +01:00
committed by GitHub
parent 8a54e700d3
commit bdad1cd2e9
585 changed files with 196640 additions and 189747 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,700 +0,0 @@
{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
},
"nodes": [
{
"id": "77ee6494-4898-47dc-81d9-35daf6f0beea",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
1360,
-280
],
"webhookId": "aaa71f03-f7af-4d18-8d9a-0afb86f1b554",
"parameters": {
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "H3uYNtpeczKMqtYm",
"name": "WhatsApp OAuth account"
}
},
"typeVersion": 1
},
{
"id": "57210e27-1f89-465a-98cc-43f890a4bf58",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1960,
-200
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e1053235-0ade-4e36-9ad2-8b29c78fced8",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2080,
-200
],
"parameters": {
"sessionKey": "=whatsapp-75-{{ $json.messages[0].from }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "69f1b78b-7c93-4713-863a-27e04809996f",
"name": "Vector Store Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
2200,
-200
],
"parameters": {
"name": "query_product_brochure",
"description": "Call this tool to query the product brochure. Valid for the year 2024."
},
"typeVersion": 1
},
{
"id": "170e8f7d-7e14-48dd-9f80-5352cc411fc1",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
80
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "ee78320b-d407-49e8-b4b8-417582a44709",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2440,
-60
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "9dd89378-5acf-4ca6-8d84-e6e64254ed02",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
-240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e68fc137-1bcb-43f0-b597-3ae07f380c15",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
760,
-20
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "2d31e92b-18d4-4f6b-8cdb-bed0056d50d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
900,
-20
],
"parameters": {
"options": {},
"jsonData": "={{ $('Extract from File').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "ca0c015e-fba2-4dca-b0fe-bac66681725a",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
900,
100
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": {}
},
"typeVersion": 1
},
{
"id": "63abb6b2-b955-4e65-9c63-3211dca65613",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
360,
-240
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "be2add9c-3670-4196-8c38-82742bf4f283",
"name": "get Product Brochure",
"type": "n8n-nodes-base.httpRequest",
"position": [
180,
-240
],
"parameters": {
"url": "https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "1ae5a311-36d7-4454-ab14-6788d1331780",
"name": "Reply To User",
"type": "n8n-nodes-base.whatsApp",
"position": [
2820,
-280
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "b6efba81-18b0-4378-bb91-51f39ca57f3e",
"name": "Reply To User1",
"type": "n8n-nodes-base.whatsApp",
"position": [
1760,
80
],
"parameters": {
"textBody": "=I'm unable to process non-text messages. Please send only text messages. Thanks!",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "52decd86-ac6c-4d91-a938-86f93ec5f822",
"name": "Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
2200,
-60
],
"parameters": {
"memoryKey": "whatsapp-75"
},
"typeVersion": 1
},
{
"id": "6dd5a652-2464-4ab8-8e5f-568529299523",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-88.75,
-473.4375
],
"parameters": {
"color": 7,
"width": 640.4375,
"height": 434.6875,
"content": "## 1. Download Product Brochure PDF\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\n\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. "
},
"typeVersion": 1
},
{
"id": "116663bc-d8d6-41a5-93dc-b219adbb2235",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
-476
],
"parameters": {
"color": 7,
"width": 614.6875,
"height": 731.1875,
"content": "## 2. Create Product Brochure Vector Store\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\n\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\n\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io)."
},
"typeVersion": 1
},
{
"id": "86bd5334-d735-4650-aeff-06230119d705",
"name": "Create Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
760,
-200
],
"parameters": {
"mode": "insert",
"memoryKey": "whatsapp-75",
"clearStore": true
},
"typeVersion": 1
},
{
"id": "b8078b0d-cbd7-423f-bb30-13902988be38",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1254,
-552
],
"parameters": {
"color": 7,
"width": 546.6875,
"height": 484.1875,
"content": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages."
},
"typeVersion": 1
},
{
"id": "5bf7ed07-282b-4198-aa90-3e5ae5180404",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
280
],
"parameters": {
"width": 338,
"height": 92,
"content": "### Want to handle all message types?\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/"
},
"typeVersion": 1
},
{
"id": "a3661b59-25d2-446e-8462-32b4d692b69d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
-40
],
"parameters": {
"color": 7,
"width": 337.6875,
"height": 311.1875,
"content": "### 3a. Handle Unsupported Message Types\nFor non-text messages, we'll just reply with a simple message to inform the sender."
},
"typeVersion": 1
},
{
"id": "ea3c9ee1-505a-40e7-82fe-9169bdbb80af",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1840,
-682.5
],
"parameters": {
"color": 7,
"width": 746.6875,
"height": 929.1875,
"content": "## 4. Sales AI Agent Responds To Customers\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\n\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier."
},
"typeVersion": 1
},
{
"id": "5c72df8d-bca1-4634-b1ed-61ffec8bd103",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2620,
-560
],
"parameters": {
"color": 7,
"width": 495.4375,
"height": 484.1875,
"content": "## 5. Repond to WhatsApp User\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\n\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\n\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent."
},
"typeVersion": 1
},
{
"id": "48ec809f-ca0e-4052-b403-9ad7077b3fff",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
-620
],
"parameters": {
"width": 401.25,
"height": 582.6283033962263,
"content": "## Try It Out!\n\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\n\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\n* A product brochure is imported via HTTP request node and its text contents extracted.\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\n* The Agent's response is sent back to the user via the WhatsApp node.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
},
"typeVersion": 1
},
{
"id": "87cf9b41-66de-49a7-aeb0-c8809191b5a0",
"name": "Handle Message Types",
"type": "n8n-nodes-base.switch",
"position": [
1560,
-280
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
},
{
"outputKey": "Not Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "89971d8c-a386-4e77-8f6c-f491a8e84cb6",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "e52f0a50-0c34-4c4a-b493-4c42ba112277",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-20
],
"parameters": {
"color": 5,
"width": 345.10906976744184,
"height": 114.53583720930231,
"content": "### You only have to run this part once!\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version."
},
"typeVersion": 1
},
{
"id": "c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
-40
],
"parameters": {
"color": 5,
"width": 364.6293255813954,
"height": 107.02804651162779,
"content": "### Activate your workflow to use!\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server."
},
"typeVersion": 1
},
{
"id": "a36524d0-22a6-48cc-93fe-b4571cec428a",
"name": "AI Sales Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1960,
-400
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}",
"options": {
"systemMessage": "You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so."
},
"promptType": "define"
},
"typeVersion": 1.6
}
],
"pinData": {},
"connections": {
"AI Sales Agent": {
"main": [
[
{
"node": "Reply To User",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Handle Message Types",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Create Product Catalogue",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Product Catalogue": {
"ai_vectorStore": [
[
{
"node": "Vector Store Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Tool": {
"ai_tool": [
[
{
"node": "AI Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Create Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Vector Store Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Create Product Catalogue",
"type": "ai_document",
"index": 0
}
]
]
},
"Handle Message Types": {
"main": [
[
{
"node": "AI Sales Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Reply To User1",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Sales Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"get Product Brochure": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "get Product Brochure",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,700 @@
{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
},
"nodes": [
{
"id": "77ee6494-4898-47dc-81d9-35daf6f0beea",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
1360,
-280
],
"webhookId": "aaa71f03-f7af-4d18-8d9a-0afb86f1b554",
"parameters": {
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "H3uYNtpeczKMqtYm",
"name": "WhatsApp OAuth account"
}
},
"typeVersion": 1
},
{
"id": "57210e27-1f89-465a-98cc-43f890a4bf58",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1960,
-200
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e1053235-0ade-4e36-9ad2-8b29c78fced8",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2080,
-200
],
"parameters": {
"sessionKey": "=whatsapp-75-{{ $json.messages[0].from }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "69f1b78b-7c93-4713-863a-27e04809996f",
"name": "Vector Store Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
2200,
-200
],
"parameters": {
"name": "query_product_brochure",
"description": "Call this tool to query the product brochure. Valid for the year 2024."
},
"typeVersion": 1
},
{
"id": "170e8f7d-7e14-48dd-9f80-5352cc411fc1",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
80
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "ee78320b-d407-49e8-b4b8-417582a44709",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2440,
-60
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "9dd89378-5acf-4ca6-8d84-e6e64254ed02",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
-240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e68fc137-1bcb-43f0-b597-3ae07f380c15",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
760,
-20
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "2d31e92b-18d4-4f6b-8cdb-bed0056d50d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
900,
-20
],
"parameters": {
"options": {},
"jsonData": "={{ $('Extract from File').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "ca0c015e-fba2-4dca-b0fe-bac66681725a",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
900,
100
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": {}
},
"typeVersion": 1
},
{
"id": "63abb6b2-b955-4e65-9c63-3211dca65613",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
360,
-240
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "be2add9c-3670-4196-8c38-82742bf4f283",
"name": "get Product Brochure",
"type": "n8n-nodes-base.httpRequest",
"position": [
180,
-240
],
"parameters": {
"url": "https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "1ae5a311-36d7-4454-ab14-6788d1331780",
"name": "Reply To User",
"type": "n8n-nodes-base.whatsApp",
"position": [
2820,
-280
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "b6efba81-18b0-4378-bb91-51f39ca57f3e",
"name": "Reply To User1",
"type": "n8n-nodes-base.whatsApp",
"position": [
1760,
80
],
"parameters": {
"textBody": "=I'm unable to process non-text messages. Please send only text messages. Thanks!",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "52decd86-ac6c-4d91-a938-86f93ec5f822",
"name": "Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
2200,
-60
],
"parameters": {
"memoryKey": "whatsapp-75"
},
"typeVersion": 1
},
{
"id": "6dd5a652-2464-4ab8-8e5f-568529299523",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-88.75,
-473.4375
],
"parameters": {
"color": 7,
"width": 640.4375,
"height": 434.6875,
"content": "## 1. Download Product Brochure PDF\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\n\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. "
},
"typeVersion": 1
},
{
"id": "116663bc-d8d6-41a5-93dc-b219adbb2235",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
-476
],
"parameters": {
"color": 7,
"width": 614.6875,
"height": 731.1875,
"content": "## 2. Create Product Brochure Vector Store\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\n\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\n\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io)."
},
"typeVersion": 1
},
{
"id": "86bd5334-d735-4650-aeff-06230119d705",
"name": "Create Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
760,
-200
],
"parameters": {
"mode": "insert",
"memoryKey": "whatsapp-75",
"clearStore": true
},
"typeVersion": 1
},
{
"id": "b8078b0d-cbd7-423f-bb30-13902988be38",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1254,
-552
],
"parameters": {
"color": 7,
"width": 546.6875,
"height": 484.1875,
"content": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages."
},
"typeVersion": 1
},
{
"id": "5bf7ed07-282b-4198-aa90-3e5ae5180404",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
280
],
"parameters": {
"width": 338,
"height": 92,
"content": "### Want to handle all message types?\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/"
},
"typeVersion": 1
},
{
"id": "a3661b59-25d2-446e-8462-32b4d692b69d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
-40
],
"parameters": {
"color": 7,
"width": 337.6875,
"height": 311.1875,
"content": "### 3a. Handle Unsupported Message Types\nFor non-text messages, we'll just reply with a simple message to inform the sender."
},
"typeVersion": 1
},
{
"id": "ea3c9ee1-505a-40e7-82fe-9169bdbb80af",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1840,
-682.5
],
"parameters": {
"color": 7,
"width": 746.6875,
"height": 929.1875,
"content": "## 4. Sales AI Agent Responds To Customers\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\n\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier."
},
"typeVersion": 1
},
{
"id": "5c72df8d-bca1-4634-b1ed-61ffec8bd103",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2620,
-560
],
"parameters": {
"color": 7,
"width": 495.4375,
"height": 484.1875,
"content": "## 5. Repond to WhatsApp User\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\n\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\n\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent."
},
"typeVersion": 1
},
{
"id": "48ec809f-ca0e-4052-b403-9ad7077b3fff",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
-620
],
"parameters": {
"width": 401.25,
"height": 582.6283033962263,
"content": "## Try It Out!\n\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\n\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\n* A product brochure is imported via HTTP request node and its text contents extracted.\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\n* The Agent's response is sent back to the user via the WhatsApp node.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
},
"typeVersion": 1
},
{
"id": "87cf9b41-66de-49a7-aeb0-c8809191b5a0",
"name": "Handle Message Types",
"type": "n8n-nodes-base.switch",
"position": [
1560,
-280
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
},
{
"outputKey": "Not Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "89971d8c-a386-4e77-8f6c-f491a8e84cb6",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "e52f0a50-0c34-4c4a-b493-4c42ba112277",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-20
],
"parameters": {
"color": 5,
"width": 345.10906976744184,
"height": 114.53583720930231,
"content": "### You only have to run this part once!\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version."
},
"typeVersion": 1
},
{
"id": "c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
-40
],
"parameters": {
"color": 5,
"width": 364.6293255813954,
"height": 107.02804651162779,
"content": "### Activate your workflow to use!\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server."
},
"typeVersion": 1
},
{
"id": "a36524d0-22a6-48cc-93fe-b4571cec428a",
"name": "AI Sales Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1960,
-400
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}",
"options": {
"systemMessage": "You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so."
},
"promptType": "define"
},
"typeVersion": 1.6
}
],
"pinData": {},
"connections": {
"AI Sales Agent": {
"main": [
[
{
"node": "Reply To User",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Handle Message Types",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Create Product Catalogue",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Product Catalogue": {
"ai_vectorStore": [
[
{
"node": "Vector Store Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Tool": {
"ai_tool": [
[
{
"node": "AI Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Create Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Vector Store Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Create Product Catalogue",
"type": "ai_document",
"index": 0
}
]
]
},
"Handle Message Types": {
"main": [
[
{
"node": "AI Sales Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Reply To User1",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Sales Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"get Product Brochure": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "get Product Brochure",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -1,700 +0,0 @@
{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
},
"nodes": [
{
"id": "77ee6494-4898-47dc-81d9-35daf6f0beea",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
1360,
-280
],
"webhookId": "aaa71f03-f7af-4d18-8d9a-0afb86f1b554",
"parameters": {
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "H3uYNtpeczKMqtYm",
"name": "WhatsApp OAuth account"
}
},
"typeVersion": 1
},
{
"id": "57210e27-1f89-465a-98cc-43f890a4bf58",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1960,
-200
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e1053235-0ade-4e36-9ad2-8b29c78fced8",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2080,
-200
],
"parameters": {
"sessionKey": "=whatsapp-75-{{ $json.messages[0].from }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "69f1b78b-7c93-4713-863a-27e04809996f",
"name": "Vector Store Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
2200,
-200
],
"parameters": {
"name": "query_product_brochure",
"description": "Call this tool to query the product brochure. Valid for the year 2024."
},
"typeVersion": 1
},
{
"id": "170e8f7d-7e14-48dd-9f80-5352cc411fc1",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
80
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "ee78320b-d407-49e8-b4b8-417582a44709",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2440,
-60
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "9dd89378-5acf-4ca6-8d84-e6e64254ed02",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
-240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e68fc137-1bcb-43f0-b597-3ae07f380c15",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
760,
-20
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "2d31e92b-18d4-4f6b-8cdb-bed0056d50d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
900,
-20
],
"parameters": {
"options": {},
"jsonData": "={{ $('Extract from File').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "ca0c015e-fba2-4dca-b0fe-bac66681725a",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
900,
100
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": {}
},
"typeVersion": 1
},
{
"id": "63abb6b2-b955-4e65-9c63-3211dca65613",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
360,
-240
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "be2add9c-3670-4196-8c38-82742bf4f283",
"name": "get Product Brochure",
"type": "n8n-nodes-base.httpRequest",
"position": [
180,
-240
],
"parameters": {
"url": "https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "1ae5a311-36d7-4454-ab14-6788d1331780",
"name": "Reply To User",
"type": "n8n-nodes-base.whatsApp",
"position": [
2820,
-280
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "b6efba81-18b0-4378-bb91-51f39ca57f3e",
"name": "Reply To User1",
"type": "n8n-nodes-base.whatsApp",
"position": [
1760,
80
],
"parameters": {
"textBody": "=I'm unable to process non-text messages. Please send only text messages. Thanks!",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "52decd86-ac6c-4d91-a938-86f93ec5f822",
"name": "Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
2200,
-60
],
"parameters": {
"memoryKey": "whatsapp-75"
},
"typeVersion": 1
},
{
"id": "6dd5a652-2464-4ab8-8e5f-568529299523",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-88.75,
-473.4375
],
"parameters": {
"color": 7,
"width": 640.4375,
"height": 434.6875,
"content": "## 1. Download Product Brochure PDF\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\n\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. "
},
"typeVersion": 1
},
{
"id": "116663bc-d8d6-41a5-93dc-b219adbb2235",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
-476
],
"parameters": {
"color": 7,
"width": 614.6875,
"height": 731.1875,
"content": "## 2. Create Product Brochure Vector Store\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\n\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\n\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io)."
},
"typeVersion": 1
},
{
"id": "86bd5334-d735-4650-aeff-06230119d705",
"name": "Create Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
760,
-200
],
"parameters": {
"mode": "insert",
"memoryKey": "whatsapp-75",
"clearStore": true
},
"typeVersion": 1
},
{
"id": "b8078b0d-cbd7-423f-bb30-13902988be38",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1254,
-552
],
"parameters": {
"color": 7,
"width": 546.6875,
"height": 484.1875,
"content": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages."
},
"typeVersion": 1
},
{
"id": "5bf7ed07-282b-4198-aa90-3e5ae5180404",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
280
],
"parameters": {
"width": 338,
"height": 92,
"content": "### Want to handle all message types?\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/"
},
"typeVersion": 1
},
{
"id": "a3661b59-25d2-446e-8462-32b4d692b69d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
-40
],
"parameters": {
"color": 7,
"width": 337.6875,
"height": 311.1875,
"content": "### 3a. Handle Unsupported Message Types\nFor non-text messages, we'll just reply with a simple message to inform the sender."
},
"typeVersion": 1
},
{
"id": "ea3c9ee1-505a-40e7-82fe-9169bdbb80af",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1840,
-682.5
],
"parameters": {
"color": 7,
"width": 746.6875,
"height": 929.1875,
"content": "## 4. Sales AI Agent Responds To Customers\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\n\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier."
},
"typeVersion": 1
},
{
"id": "5c72df8d-bca1-4634-b1ed-61ffec8bd103",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2620,
-560
],
"parameters": {
"color": 7,
"width": 495.4375,
"height": 484.1875,
"content": "## 5. Repond to WhatsApp User\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\n\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\n\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent."
},
"typeVersion": 1
},
{
"id": "48ec809f-ca0e-4052-b403-9ad7077b3fff",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
-620
],
"parameters": {
"width": 401.25,
"height": 582.6283033962263,
"content": "## Try It Out!\n\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\n\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\n* A product brochure is imported via HTTP request node and its text contents extracted.\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\n* The Agent's response is sent back to the user via the WhatsApp node.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
},
"typeVersion": 1
},
{
"id": "87cf9b41-66de-49a7-aeb0-c8809191b5a0",
"name": "Handle Message Types",
"type": "n8n-nodes-base.switch",
"position": [
1560,
-280
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
},
{
"outputKey": "Not Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "89971d8c-a386-4e77-8f6c-f491a8e84cb6",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "e52f0a50-0c34-4c4a-b493-4c42ba112277",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-20
],
"parameters": {
"color": 5,
"width": 345.10906976744184,
"height": 114.53583720930231,
"content": "### You only have to run this part once!\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version."
},
"typeVersion": 1
},
{
"id": "c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
-40
],
"parameters": {
"color": 5,
"width": 364.6293255813954,
"height": 107.02804651162779,
"content": "### Activate your workflow to use!\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server."
},
"typeVersion": 1
},
{
"id": "a36524d0-22a6-48cc-93fe-b4571cec428a",
"name": "AI Sales Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1960,
-400
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}",
"options": {
"systemMessage": "You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so."
},
"promptType": "define"
},
"typeVersion": 1.6
}
],
"pinData": {},
"connections": {
"AI Sales Agent": {
"main": [
[
{
"node": "Reply To User",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Handle Message Types",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Create Product Catalogue",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Product Catalogue": {
"ai_vectorStore": [
[
{
"node": "Vector Store Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Tool": {
"ai_tool": [
[
{
"node": "AI Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Create Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Vector Store Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Create Product Catalogue",
"type": "ai_document",
"index": 0
}
]
]
},
"Handle Message Types": {
"main": [
[
{
"node": "AI Sales Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Reply To User1",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Sales Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"get Product Brochure": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "get Product Brochure",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,700 @@
{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
},
"nodes": [
{
"id": "77ee6494-4898-47dc-81d9-35daf6f0beea",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
1360,
-280
],
"webhookId": "aaa71f03-f7af-4d18-8d9a-0afb86f1b554",
"parameters": {
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "H3uYNtpeczKMqtYm",
"name": "WhatsApp OAuth account"
}
},
"typeVersion": 1
},
{
"id": "57210e27-1f89-465a-98cc-43f890a4bf58",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1960,
-200
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e1053235-0ade-4e36-9ad2-8b29c78fced8",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2080,
-200
],
"parameters": {
"sessionKey": "=whatsapp-75-{{ $json.messages[0].from }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.2
},
{
"id": "69f1b78b-7c93-4713-863a-27e04809996f",
"name": "Vector Store Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
2200,
-200
],
"parameters": {
"name": "query_product_brochure",
"description": "Call this tool to query the product brochure. Valid for the year 2024."
},
"typeVersion": 1
},
{
"id": "170e8f7d-7e14-48dd-9f80-5352cc411fc1",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
80
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "ee78320b-d407-49e8-b4b8-417582a44709",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2440,
-60
],
"parameters": {
"model": "gpt-4o-2024-08-06",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "9dd89378-5acf-4ca6-8d84-e6e64254ed02",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
-240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e68fc137-1bcb-43f0-b597-3ae07f380c15",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
760,
-20
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "2d31e92b-18d4-4f6b-8cdb-bed0056d50d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
900,
-20
],
"parameters": {
"options": {},
"jsonData": "={{ $('Extract from File').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "ca0c015e-fba2-4dca-b0fe-bac66681725a",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
900,
100
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": {}
},
"typeVersion": 1
},
{
"id": "63abb6b2-b955-4e65-9c63-3211dca65613",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
360,
-240
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "be2add9c-3670-4196-8c38-82742bf4f283",
"name": "get Product Brochure",
"type": "n8n-nodes-base.httpRequest",
"position": [
180,
-240
],
"parameters": {
"url": "https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "1ae5a311-36d7-4454-ab14-6788d1331780",
"name": "Reply To User",
"type": "n8n-nodes-base.whatsApp",
"position": [
2820,
-280
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "b6efba81-18b0-4378-bb91-51f39ca57f3e",
"name": "Reply To User1",
"type": "n8n-nodes-base.whatsApp",
"position": [
1760,
80
],
"parameters": {
"textBody": "=I'm unable to process non-text messages. Please send only text messages. Thanks!",
"operation": "send",
"phoneNumberId": "477115632141067",
"requestOptions": {},
"additionalFields": {
"previewUrl": false
},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "9SFJPeqrpChOkAmw",
"name": "WhatsApp account"
}
},
"typeVersion": 1
},
{
"id": "52decd86-ac6c-4d91-a938-86f93ec5f822",
"name": "Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
2200,
-60
],
"parameters": {
"memoryKey": "whatsapp-75"
},
"typeVersion": 1
},
{
"id": "6dd5a652-2464-4ab8-8e5f-568529299523",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-88.75,
-473.4375
],
"parameters": {
"color": 7,
"width": 640.4375,
"height": 434.6875,
"content": "## 1. Download Product Brochure PDF\n[Read more about the HTTP Request Tool](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nImport your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.\n\nFor this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure ([Source](https://usa.yamaha.com/files/download/brochure/1/1474881/Yamaha-Powered-Loudspeakers-brochure-2024-en-web.pdf)) and an Extract from File node to extract the text contents. "
},
"typeVersion": 1
},
{
"id": "116663bc-d8d6-41a5-93dc-b219adbb2235",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
-476
],
"parameters": {
"color": 7,
"width": 614.6875,
"height": 731.1875,
"content": "## 2. Create Product Brochure Vector Store\n[Read more about the In-Memory Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)\n\nVector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.\n\nTo keep things simple, we'll use the **In-memory Vector Store** which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either [Qdrant](https://qdrant.tech) or [Pinecone](https://pinecone.io)."
},
"typeVersion": 1
},
{
"id": "86bd5334-d735-4650-aeff-06230119d705",
"name": "Create Product Catalogue",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
760,
-200
],
"parameters": {
"mode": "insert",
"memoryKey": "whatsapp-75",
"clearStore": true
},
"typeVersion": 1
},
{
"id": "b8078b0d-cbd7-423f-bb30-13902988be38",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1254,
-552
],
"parameters": {
"color": 7,
"width": 546.6875,
"height": 484.1875,
"content": "## 3. Use the WhatsApp Trigger\n[Learn more about the WhatsApp Trigger](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.whatsapptrigger/)\n\nThe WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.\n\nNote that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages."
},
"typeVersion": 1
},
{
"id": "5bf7ed07-282b-4198-aa90-3e5ae5180404",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
280
],
"parameters": {
"width": 338,
"height": 92,
"content": "### Want to handle all message types?\nCheck out my other WhatsApp template in my creator page! https://n8n.io/creators/jimleuk/"
},
"typeVersion": 1
},
{
"id": "a3661b59-25d2-446e-8462-32b4d692b69d",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
-40
],
"parameters": {
"color": 7,
"width": 337.6875,
"height": 311.1875,
"content": "### 3a. Handle Unsupported Message Types\nFor non-text messages, we'll just reply with a simple message to inform the sender."
},
"typeVersion": 1
},
{
"id": "ea3c9ee1-505a-40e7-82fe-9169bdbb80af",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1840,
-682.5
],
"parameters": {
"color": 7,
"width": 746.6875,
"height": 929.1875,
"content": "## 4. Sales AI Agent Responds To Customers\n[Learn more about using AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nn8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.\n\nIn this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier."
},
"typeVersion": 1
},
{
"id": "5c72df8d-bca1-4634-b1ed-61ffec8bd103",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2620,
-560
],
"parameters": {
"color": 7,
"width": 495.4375,
"height": 484.1875,
"content": "## 5. Repond to WhatsApp User\n[Learn more about the WhatsApp Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.whatsapp/)\n\nThe WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.\n\nHere, we'll keep it simple by replying with a text message which is the output of the AI agent."
},
"typeVersion": 1
},
{
"id": "48ec809f-ca0e-4052-b403-9ad7077b3fff",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
-620
],
"parameters": {
"width": 401.25,
"height": 582.6283033962263,
"content": "## Try It Out!\n\n### This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.\n\n* This template is in 2 parts: creating the product catalog vector store and building the WhatsApp AI chatbot.\n* A product brochure is imported via HTTP request node and its text contents extracted.\n* The text contents are then uploaded to the in-memory vector store to build a knowledgebase for the chatbot.\n* A WhatsApp trigger is used to capture messages from customers where non-text messages are filtered out.\n* The customer's message is sent to the AI Agent which queries the product catalogue using the vector store tool.\n* The Agent's response is sent back to the user via the WhatsApp node.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
},
"typeVersion": 1
},
{
"id": "87cf9b41-66de-49a7-aeb0-c8809191b5a0",
"name": "Handle Message Types",
"type": "n8n-nodes-base.switch",
"position": [
1560,
-280
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
},
{
"outputKey": "Not Supported",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "89971d8c-a386-4e77-8f6c-f491a8e84cb6",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "e52f0a50-0c34-4c4a-b493-4c42ba112277",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-20
],
"parameters": {
"color": 5,
"width": 345.10906976744184,
"height": 114.53583720930231,
"content": "### You only have to run this part once!\nRun this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version."
},
"typeVersion": 1
},
{
"id": "c1a7d6d1-191e-4343-af9f-f2c9eb4ecf49",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1260,
-40
],
"parameters": {
"color": 5,
"width": 364.6293255813954,
"height": 107.02804651162779,
"content": "### Activate your workflow to use!\nTo start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server."
},
"typeVersion": 1
},
{
"id": "a36524d0-22a6-48cc-93fe-b4571cec428a",
"name": "AI Sales Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1960,
-400
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}",
"options": {
"systemMessage": "You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don't know the answer or unable to obtain the information from the datastore, then tell the user so."
},
"promptType": "define"
},
"typeVersion": 1.6
}
],
"pinData": {},
"connections": {
"AI Sales Agent": {
"main": [
[
{
"node": "Reply To User",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Handle Message Types",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Create Product Catalogue",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Product Catalogue": {
"ai_vectorStore": [
[
{
"node": "Vector Store Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Tool": {
"ai_tool": [
[
{
"node": "AI Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Create Product Catalogue",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Vector Store Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Create Product Catalogue",
"type": "ai_document",
"index": 0
}
]
]
},
"Handle Message Types": {
"main": [
[
{
"node": "AI Sales Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Reply To User1",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Sales Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"get Product Brochure": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "get Product Brochure",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -1,669 +0,0 @@
{
"id": "APCp9GPNjUSFPSfJ",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Business WhatsApp AI RAG Chatbot",
"tags": [],
"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
},
{
"id": "cc230fcd-f88c-40d4-8835-ac9dc6228b18",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"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 stores 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 stores 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: \"Whats 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 isnt 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 routers 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. Youll 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
},
{
"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
},
{
"id": "b8f5ac53-03fe-4151-ac56-b246245702b6",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1560,
1580
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "a02f4e76-1895-48ad-a2d5-6daf3347f181",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
460,
100
],
"parameters": {},
"typeVersion": 1
},
{
"id": "35a71dd7-ae08-46c5-acb2-e66d92b311cb",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
1440,
220
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "1538c8b1-f914-4991-b311-e533df625c5f",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
760,
-40
],
"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": {
"id": "qhny6r5ql9wwotpn",
"name": "Qdrant API (Hetzner)"
}
},
"typeVersion": 4.2
},
{
"id": "423b73a6-2497-4635-9ad0-9e768f32018d",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
760,
220
],
"parameters": {
"url": "https://QDRANTURL/collections/COLLECTION/points/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": {
"id": "qhny6r5ql9wwotpn",
"name": "Qdrant API (Hetzner)"
}
},
"typeVersion": 4.2
},
{
"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": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "id",
"value": "=test-whatsapp"
}
},
"options": {},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "HEy5EuZkgPZVEa9w",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"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
},
{
"id": "b20975d7-e367-49a3-ac8c-613289775463",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1420,
420
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "4c2d02a4-c954-42c4-97b0-b94ee3198f56",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
1600,
420
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "72591129-1691-4caf-bf63-c04db85708dc",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
1560,
580
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"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
},
{
"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](https://developers.facebook.com/apps/), 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
},
{
"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
},
{
"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
},
{
"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
},
{
"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
},
{
"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
},
{
"id": "dafe692e-7767-4ded-966c-df812f58ae63",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1760,
1580
],
"parameters": {},
"typeVersion": 1.3
},
{
"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
},
{
"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
},
{
"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
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4eb1a148-185f-4f16-a6ad-01c3201d4fc0",
"connections": {
"Verify": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Respond": {
"main": [
[
{
"node": "is Message?",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Send",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"is Message?": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Only 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
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"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": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,669 @@
{
"id": "APCp9GPNjUSFPSfJ",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Business WhatsApp AI RAG Chatbot",
"tags": [],
"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
},
{
"id": "cc230fcd-f88c-40d4-8835-ac9dc6228b18",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"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 stores 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 stores 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: \"Whats 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 isnt 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 routers 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. Youll 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
},
{
"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
},
{
"id": "b8f5ac53-03fe-4151-ac56-b246245702b6",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1560,
1580
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "a02f4e76-1895-48ad-a2d5-6daf3347f181",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
460,
100
],
"parameters": {},
"typeVersion": 1
},
{
"id": "35a71dd7-ae08-46c5-acb2-e66d92b311cb",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
1440,
220
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "1538c8b1-f914-4991-b311-e533df625c5f",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
760,
-40
],
"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": {
"id": "qhny6r5ql9wwotpn",
"name": "Qdrant API (Hetzner)"
}
},
"typeVersion": 4.2
},
{
"id": "423b73a6-2497-4635-9ad0-9e768f32018d",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
760,
220
],
"parameters": {
"url": "https://QDRANTURL/collections/COLLECTION/points/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": {
"id": "qhny6r5ql9wwotpn",
"name": "Qdrant API (Hetzner)"
}
},
"typeVersion": 4.2
},
{
"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": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "id",
"value": "=test-whatsapp"
}
},
"options": {},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "HEy5EuZkgPZVEa9w",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"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
},
{
"id": "b20975d7-e367-49a3-ac8c-613289775463",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1420,
420
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "4c2d02a4-c954-42c4-97b0-b94ee3198f56",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
1600,
420
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "72591129-1691-4caf-bf63-c04db85708dc",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
1560,
580
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"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
},
{
"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](https://developers.facebook.com/apps/), 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
},
{
"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
},
{
"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
},
{
"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
},
{
"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
},
{
"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
},
{
"id": "dafe692e-7767-4ded-966c-df812f58ae63",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1760,
1580
],
"parameters": {},
"typeVersion": 1.3
},
{
"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
},
{
"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
},
{
"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
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4eb1a148-185f-4f16-a6ad-01c3201d4fc0",
"connections": {
"Verify": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Respond": {
"main": [
[
{
"node": "is Message?",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Send",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"is Message?": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Only 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
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"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": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff