Created
December 30, 2025 17:14
-
-
Save unlocomqx/529a219fe1a20174044709e8e2addeb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nodes": [ | |
| { | |
| "parameters": {}, | |
| "id": "071695a2-8238-4f65-864d-d7600c30895b", | |
| "cid": "Ikx1Y2FzIFBleXJpbiI", | |
| "name": "Simple Memory", | |
| "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", | |
| "creator": "Lucas Peyrin", | |
| "position": [ | |
| 80, | |
| -48 | |
| ], | |
| "typeVersion": 1.3, | |
| "notes": "© 2025 Lucas Peyrin" | |
| }, | |
| { | |
| "parameters": { | |
| "modelName": "models/gemini-2.5-pro", | |
| "options": { | |
| "temperature": 0 | |
| } | |
| }, | |
| "id": "67c86c0a-2da7-466b-8a59-efe71222e25c", | |
| "cid": "Ikx1Y2FzIFBleXJpbiI", | |
| "name": "Gemini 2.5 Flash", | |
| "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", | |
| "creator": "Lucas Peyrin", | |
| "position": [ | |
| -48, | |
| -48 | |
| ], | |
| "typeVersion": 1, | |
| "credentials": { | |
| "googlePalmApi": { | |
| "id": "1hVMDAeIReNMOdNs", | |
| "name": "Google Gemini(PaLM) Api account" | |
| } | |
| }, | |
| "notes": "© 2025 Lucas Peyrin" | |
| }, | |
| { | |
| "parameters": {}, | |
| "id": "59635a7c-b31e-4bb4-aea5-93a4c93137c6", | |
| "cid": "Ikx1Y2FzIFBleXJpbiI", | |
| "name": "Gemini Query Embedding", | |
| "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini", | |
| "creator": "Lucas Peyrin", | |
| "position": [ | |
| 288, | |
| 160 | |
| ], | |
| "typeVersion": 1, | |
| "credentials": { | |
| "googlePalmApi": { | |
| "id": "1hVMDAeIReNMOdNs", | |
| "name": "Google Gemini(PaLM) Api account" | |
| } | |
| }, | |
| "notes": "© 2025 Lucas Peyrin" | |
| }, | |
| { | |
| "parameters": { | |
| "options": { | |
| "systemMessage": "=<role>\nYou are a specialized AI assistant, an expert in the Dynamic Product module documentation. Your sole mission is to help users by providing accurate and factual information extracted exclusively from this documentation. You are meticulous, factual, and never deviate from your knowledge scope.\n</role>\n\n<instructions>\n<goal>\nYour primary goal is to provide precise and factual answers to user questions about the Dynamic product module, which is a module that supports many types of fields and makes dynamic calculations to calculate the price & weight of a product.\n</goal>\n\n<context>\nYou operate according to a RAG (Retrieval-Augmented Generation) model. For each user question, use the appropriate tool to retrieve the necessary information from the Dynamic product documentation's vector database.\n\n**Mandatory rules:**\n\n1. **Single source of truth:** Your answer MUST be entirely and solely derived from the information present in the provided documentation.\n2. **Accuracy and implicit citation:** Base your answer as literally as possible on the documentation text. Rephrase for clarity and conciseness, but do not add any information not found there. Act as if the documentation is your only knowledge in the world.\n3. **Do not mention the process:** Never mention your tool or the fact that you are a RAG system in your answer to the user. Respond as an expert who directly consults their documentation.\n</context>\n\n<output_format>\n* **Clarity:** Provide a clear, concise, and direct answer.\n* **Structuring:** If the context contains steps, lists, or code examples, use Markdown syntax to format them legibly (bullet points, numbered lists, code blocks for code snippets, JSON, etc.).\nIt is very import to remove any white spaces before the code block delimiters in order to have a correct display.\n* **Tone:** Adopt a professional, helpful, and confident tone, that of a technical Dynamic product expert.\n</output_format>\n</instructions>" | |
| } | |
| }, | |
| "id": "fab96186-a2f7-46e6-9a9c-00878fc72490", | |
| "cid": "Ikx1Y2FzIFBleXJpbiI", | |
| "name": "n8n Docs AI Agent", | |
| "type": "@n8n/n8n-nodes-langchain.agent", | |
| "creator": "Lucas Peyrin", | |
| "position": [ | |
| 16, | |
| -272 | |
| ], | |
| "typeVersion": 2.1, | |
| "notes": "© 2025 Lucas Peyrin" | |
| }, | |
| { | |
| "parameters": { | |
| "public": true, | |
| "initialMessages": "Hi there! 👋\nHow can I assist you today?", | |
| "options": { | |
| "customCss": ":root {\n /* Colors */\n --chat--color-primary: #e74266;\n --chat--color-primary-shade-50: #db4061;\n --chat--color-primary-shade-100: #cf3c5c;\n --chat--color-secondary: #20b69e;\n --chat--color-secondary-shade-50: #1ca08a;\n --chat--color-white: #ffffff;\n --chat--color-light: #f2f4f8;\n --chat--color-light-shade-50: #e6e9f1;\n --chat--color-light-shade-100: #c2c5cc;\n --chat--color-medium: #d2d4d9;\n --chat--color-dark: #101330;\n --chat--color-disabled: #d2d4d9;\n --chat--color-typing: #404040;\n\n /* Base Layout */\n --chat--spacing: 1rem;\n --chat--border-radius: 0.25rem;\n --chat--transition-duration: 0.15s;\n --chat--font-family: (\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Oxygen-Sans,\n Ubuntu,\n Cantarell,\n 'Helvetica Neue',\n sans-serif\n );\n\n /* Window Dimensions */\n --chat--window--width: 400px;\n --chat--window--height: 600px;\n --chat--window--bottom: var(--chat--spacing);\n --chat--window--right: var(--chat--spacing);\n --chat--window--z-index: 9999;\n --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n --chat--window--border-radius: var(--chat--border-radius);\n --chat--window--margin-bottom: var(--chat--spacing);\n\n /* Header Styles */\n --chat--header-height: auto;\n --chat--header--padding: var(--chat--spacing);\n --chat--header--background: var(--chat--color-dark);\n --chat--header--color: var(--chat--color-light);\n --chat--header--border-top: none;\n --chat--header--border-bottom: none;\n --chat--header--border-left: none;\n --chat--header--border-right: none;\n --chat--heading--font-size: 2em;\n --chat--subtitle--font-size: inherit;\n --chat--subtitle--line-height: 1.8;\n\n /* Message Styles */\n --chat--message--font-size: 1rem;\n --chat--message--padding: var(--chat--spacing);\n --chat--message--border-radius: var(--chat--border-radius);\n --chat--message-line-height: 1.5;\n --chat--message--margin-bottom: calc(var(--chat--spacing) * 1);\n --chat--message--bot--background: var(--chat--color-white);\n --chat--message--bot--color: var(--chat--color-dark);\n --chat--message--bot--border: none;\n --chat--message--user--background: var(--chat--color-secondary);\n --chat--message--user--color: var(--chat--color-white);\n --chat--message--user--border: none;\n --chat--message--pre--background: rgba(0, 0, 0, 0.05);\n --chat--messages-list--padding: var(--chat--spacing);\n\n /* Toggle Button */\n --chat--toggle--size: 64px;\n --chat--toggle--width: var(--chat--toggle--size);\n --chat--toggle--height: var(--chat--toggle--size);\n --chat--toggle--border-radius: 50%;\n --chat--toggle--background: var(--chat--color-primary);\n --chat--toggle--hover--background: var(--chat--color-primary-shade-50);\n --chat--toggle--active--background: var(--chat--color-primary-shade-100);\n --chat--toggle--color: var(--chat--color-white);\n\n /* Input Area */\n --chat--textarea--height: 50px;\n --chat--textarea--max-height: 30rem;\n --chat--input--font-size: inherit;\n --chat--input--border: 0;\n --chat--input--border-radius: 0;\n --chat--input--padding: 0.8rem;\n --chat--input--background: var(--chat--color-white);\n --chat--input--text-color: initial;\n --chat--input--line-height: 1.5;\n --chat--input--placeholder--font-size: var(--chat--input--font-size);\n --chat--input--border-active: 0;\n --chat--input--left--panel--width: 2rem;\n\n /* Button Styles */\n --chat--button--color: var(--chat--color-light);\n --chat--button--background: var(--chat--color-primary);\n --chat--button--padding: calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing);\n --chat--button--border-radius: var(--chat--border-radius);\n --chat--button--hover--color: var(--chat--color-light);\n --chat--button--hover--background: var(--chat--color-primary-shade-50);\n --chat--close--button--color-hover: var(--chat--color-primary);\n\n /* Send and File Buttons */\n --chat--input--send--button--background: var(--chat--color-white);\n --chat--input--send--button--color: var(--chat--color-secondary);\n --chat--input--send--button--background-hover: var(--chat--color-primary-shade-50);\n --chat--input--send--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--input--file--button--background: var(--chat--color-white);\n --chat--input--file--button--color: var(--chat--color-secondary);\n --chat--input--file--button--background-hover: var(--chat--input--file--button--background);\n --chat--input--file--button--color-hover: var(--chat--color-secondary-shade-50);\n --chat--files-spacing: 0.25rem;\n\n /* Body and Footer */\n --chat--body--background: var(--chat--color-light);\n --chat--footer--background: var(--chat--color-light);\n --chat--footer--color: var(--chat--color-dark);\n}\n\n\n/* You can override any class styles, too. Right-click inspect in Chat UI to find class to override. */\n.chat-message {\n\tmax-width: 50%;\n}\n\n/* 🏷️ Style for Inline Code (`<code>` tag) */\ncode {\n /* 1. Background and Padding: Make the code snippet visually distinct */\n background-color: #f0f0f0; /* A light gray background */\n padding: 2px 4px; /* Small padding to give it breathing room */\n border-radius: 3px; /* Slightly rounded corners for a softer look */\n \n /* 2. Font: Use a monospace font for readability, which is standard for code */\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 0.9em; /* Slightly smaller than surrounding text */\n \n /* 3. Color: Choose a color that stands out but isn't jarring */\n color: #c7254e; /* A deep, distinct red/pink */\n}" | |
| } | |
| }, | |
| "id": "522a156d-73fb-4ed2-87e3-0c954923cf46", | |
| "cid": "Ikx1Y2FzIFBleXJpbiI", | |
| "name": "RAG Chatbot", | |
| "type": "@n8n/n8n-nodes-langchain.chatTrigger", | |
| "creator": "Lucas Peyrin", | |
| "position": [ | |
| -272, | |
| -272 | |
| ], | |
| "webhookId": "e80f40f5-f8dc-4d0e-9ce5-594c61d233df", | |
| "typeVersion": 1.1, | |
| "notes": "© 2025 Lucas Peyrin" | |
| }, | |
| { | |
| "parameters": { | |
| "mode": "retrieve-as-tool", | |
| "toolDescription": "Get related chunks of the official Dynamic Product documentation.", | |
| "qdrantCollection": { | |
| "__rl": true, | |
| "value": "dp-docs", | |
| "mode": "list", | |
| "cachedResultName": "dp-docs" | |
| }, | |
| "topK": 10, | |
| "options": {} | |
| }, | |
| "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant", | |
| "typeVersion": 1.3, | |
| "position": [ | |
| 208, | |
| -48 | |
| ], | |
| "id": "4d5ef1d4-0e9a-4053-8eb0-d9c7c1d10d32", | |
| "name": "Qdrant Vector Store", | |
| "credentials": { | |
| "qdrantApi": { | |
| "id": "RH3RJkdv3kquotSh", | |
| "name": "QdrantApi account" | |
| } | |
| } | |
| }, | |
| { | |
| "parameters": { | |
| "sessionKey": "={{ $('RAG Chatbot').item.json.sessionId }}", | |
| "contextWindowLength": 20 | |
| }, | |
| "id": "9547f496-a3fd-4b70-8241-2db0858c05bb", | |
| "name": "Window Buffer Memory", | |
| "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", | |
| "typeVersion": 1, | |
| "position": [ | |
| 656, | |
| -304 | |
| ] | |
| }, | |
| { | |
| "parameters": {}, | |
| "id": "718d4562-8928-45d7-9046-6f660536401f", | |
| "name": "Chat Messages Retriever", | |
| "type": "@n8n/n8n-nodes-langchain.memoryChatRetriever", | |
| "typeVersion": 1, | |
| "position": [ | |
| 576, | |
| -528 | |
| ] | |
| }, | |
| { | |
| "parameters": { | |
| "operation": "concatenateItems", | |
| "aggregate": "aggregateAllItemData", | |
| "destinationFieldName": "messages", | |
| "options": {} | |
| }, | |
| "id": "54f76ca8-1532-4059-b98d-002fdf5e89bb", | |
| "name": "Item Lists", | |
| "type": "n8n-nodes-base.itemLists", | |
| "typeVersion": 3.1, | |
| "position": [ | |
| 928, | |
| -432 | |
| ] | |
| }, | |
| { | |
| "parameters": { | |
| "sendTo": "[email protected]", | |
| "subject": "A new conversation with AI!", | |
| "message": "={{ $json.html }}", | |
| "options": {} | |
| }, | |
| "id": "47332742-7fcc-48c6-9204-4aeb6a9abe16", | |
| "name": "Gmail", | |
| "type": "n8n-nodes-base.gmail", | |
| "typeVersion": 2.1, | |
| "position": [ | |
| 1824, | |
| -432 | |
| ], | |
| "webhookId": "f552fb0f-a4b3-486a-a5a8-ec1b20226f1c", | |
| "credentials": { | |
| "gmailOAuth2": { | |
| "id": "c1BT0zzsFDy8u8MX", | |
| "name": "Gmail account" | |
| } | |
| } | |
| }, | |
| { | |
| "parameters": { | |
| "options": {} | |
| }, | |
| "type": "n8n-nodes-base.respondToWebhook", | |
| "typeVersion": 1.4, | |
| "position": [ | |
| 928, | |
| -128 | |
| ], | |
| "id": "6080598a-75fb-4932-a832-fd95e1fb321e", | |
| "name": "Respond to Webhook" | |
| }, | |
| { | |
| "parameters": { | |
| "mode": "markdownToHtml", | |
| "markdown": "={{ $json.md }}", | |
| "options": { | |
| "simplifiedAutoLink": true, | |
| "completeHTMLDocument": false | |
| } | |
| }, | |
| "type": "n8n-nodes-base.markdown", | |
| "typeVersion": 1, | |
| "position": [ | |
| 1376, | |
| -432 | |
| ], | |
| "id": "8e36da65-ae49-4292-8986-a5c09f296339", | |
| "name": "Markdown" | |
| }, | |
| { | |
| "parameters": { | |
| "html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n</head>\n<body>\n <div class=\"container\">\n <h1>Conversation with AI:</h1>\n <p>{{ $json.data }}\n </p>\n </div>\n</body>\n</html>\n\n<style>\n.container {\n background-color: #ffffff;\n text-align: center;\n padding: 16px;\n border-radius: 8px;\n}\n\nh2 {\n color: #4caf50;\n font-size: 24px;\n font-weight: bold;\n padding: 8px;\n}\n\n h2.ai{\n color: #e91e63;\n }\n</style>" | |
| }, | |
| "id": "79caeab5-c4f4-4458-9b08-1d4d873081ea", | |
| "name": "HTML", | |
| "type": "n8n-nodes-base.html", | |
| "typeVersion": 1, | |
| "position": [ | |
| 1600, | |
| -432 | |
| ] | |
| }, | |
| { | |
| "parameters": { | |
| "mode": "runOnceForEachItem", | |
| "jsCode": "return {\"json\": { md: $json.messages.map(m => `\n<h2 style=\"color: #4caf50;\">[Human]:</h2>\\n${m.human}\\n\n<h2 style=\"color: #e91e63;\" class=ai>[AI]</h2>:\\n${m.ai}`).join('\\n\\n')\n}}" | |
| }, | |
| "type": "n8n-nodes-base.code", | |
| "typeVersion": 2, | |
| "position": [ | |
| 1152, | |
| -432 | |
| ], | |
| "id": "ceb0ba8f-b624-477a-a0c7-aca52f629060", | |
| "name": "Code in JavaScript" | |
| }, | |
| { | |
| "parameters": { | |
| "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.output = item.json.output.replace(/[ \\t]+```/g, \"```\")\n}\n\nreturn $input.all();" | |
| }, | |
| "type": "n8n-nodes-base.code", | |
| "typeVersion": 2, | |
| "position": [ | |
| 640, | |
| -128 | |
| ], | |
| "id": "5255e99c-311d-4e95-a941-f86b13d8fd65", | |
| "name": "Code in JavaScript1" | |
| } | |
| ], | |
| "connections": { | |
| "Simple Memory": { | |
| "ai_memory": [ | |
| [ | |
| { | |
| "node": "n8n Docs AI Agent", | |
| "type": "ai_memory", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Gemini 2.5 Flash": { | |
| "ai_languageModel": [ | |
| [ | |
| { | |
| "node": "n8n Docs AI Agent", | |
| "type": "ai_languageModel", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Gemini Query Embedding": { | |
| "ai_embedding": [ | |
| [ | |
| { | |
| "node": "Qdrant Vector Store", | |
| "type": "ai_embedding", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "n8n Docs AI Agent": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Chat Messages Retriever", | |
| "type": "main", | |
| "index": 0 | |
| }, | |
| { | |
| "node": "Code in JavaScript1", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "RAG Chatbot": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "n8n Docs AI Agent", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Qdrant Vector Store": { | |
| "ai_tool": [ | |
| [ | |
| { | |
| "node": "n8n Docs AI Agent", | |
| "type": "ai_tool", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Window Buffer Memory": { | |
| "ai_memory": [ | |
| [ | |
| { | |
| "node": "Chat Messages Retriever", | |
| "type": "ai_memory", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Chat Messages Retriever": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Item Lists", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Item Lists": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Code in JavaScript", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Markdown": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "HTML", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "HTML": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Gmail", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Code in JavaScript": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Markdown", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Code in JavaScript1": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Respond to Webhook", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| } | |
| }, | |
| "pinData": { | |
| "n8n Docs AI Agent": [ | |
| { | |
| "output": "To calculate a surface or area, you can use a field formula. This allows you to assign a value to a field based on the values of other fields, such as width and height.\n\n### Basic Calculation\n\nYou can calculate the area of a rectangle by creating a \"Dynamic Variable\" field (e.g., named `area`) and applying the following formula:\n\n\n```js\n[area] = [width] * [height]\n```\n\n\n### Using the Calculated Area\n\nOnce you have the `[area]` field, you can use it in other formulas or conditions.\n\n* **In other formulas:** For example, to calculate a price based on the area:\n \n```js\n [area] * 10\n ```\n\n\n* **In conditions:** To apply logic based on the area:\n \n```js\n [area] > 100\n ```\n\n\n### Advanced Examples\n\nYou can also incorporate formula functions for more complex logic directly within your price or weight formulas.\n\n* **Round up to the nearest whole square meter:**\n \n```js\n ROUNDUP([width] * [height] / 10000) * 10\n ```\n\n\n* **Charge for at least 1 square meter:**\n \n```js\n MAX([width] * [height] / 10000, 1) * 10\n ```\n\n\n* **Charge a minimum price:**\n \n```js\n MAX([width] * [height] / 10000 * 10, 50)\n ```" | |
| } | |
| ], | |
| "Item Lists": [ | |
| { | |
| "messages": [ | |
| { | |
| "human": "How to calculate the weight?", | |
| "ai": "The weight of a product is calculated using a weight formula, which impacts the shipping cost. The result from this formula is added to the base product weight configured in PrestaShop.\n\n### Weight Formula\n\nYou can define a formula to calculate the weight. For example, to charge 2kg for each square meter, the formula would be:\n\n\n```js\n[width] * [height] / 10000 * 2\n```\n\n\nAdditionally, you have the option to show the calculated weight on the product page by enabling the **Display weight to customers** setting for the product.\n\n### Weight Calculation Using PHP\n\nFor more complex calculations, you can use a PHP file placed in the `/calculator` folder. This method is similar to PHP price calculation with two main differences:\n\n* The variable that must be assigned is `$weight`.\n* The file must be named `weights.php` to apply to all products, or `weightX.php` to target a specific product with ID `X`." | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| "meta": { | |
| "templateCredsSetupCompleted": true, | |
| "instanceId": "b925dde278e559e0d490e7389b69917163007b0eac664f344b0338b1a374b734" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment