feat: add folder support for workflows (fixes #70)

This commit is contained in:
Praveen Mudalgeri
2025-08-05 09:40:47 +05:30
parent 307d530f9b
commit c4885eee92
2057 changed files with 985290 additions and 974268 deletions

View File

@@ -0,0 +1,70 @@
{
"nodes": [
{
"name": "IMAP Email",
"type": "n8n-nodes-base.emailReadImap",
"position": [
240,
420
],
"parameters": {
"format": "resolved",
"mailbox": "Invoices",
"options": {
"customEmailConfig": "[\"ALL\"]"
}
},
"typeVersion": 1
},
{
"name": "Nextcloud",
"type": "n8n-nodes-base.nextCloud",
"position": [
940,
420
],
"parameters": {
"path": "=Documents/Invoices/{{$json[\"date\"]}}_{{$json[\"from\"]}}_{{$binary.file.fileName}}",
"binaryDataUpload": true,
"binaryPropertyName": "file"
},
"typeVersion": 1
},
{
"name": "Map each attachment",
"type": "n8n-nodes-base.function",
"position": [
620,
420
],
"parameters": {
"functionCode": "const _ = require('lodash')\n\nconst sanitize = str => _.chain(str)\n .replace(/[^A-Za-z0-9&.-]/g, '-') // sanitise via whitelist of characters\n .replace(/-(?=-)/g, '') // remove repeated dashes - https://regexr.com/6ag8h\n .trim('-') // trim any leading/trailing dashes\n .truncate({\n length: 60,\n omission: '-' // when the string ends with '-', you'll know it was truncated\n })\n .value()\n\nconst result = _.flatMap(items.map(item => {\n //console.log({item})\n\n // Maps each attachment to a separate item\n return _.values(item.binary).map(file => {\n console.log(\"Saving attachement:\", file.fileName, 'from:', ...item.json.from.value)\n \n // sanitize filename but exclude extension\n const filename_parts = file.fileName.split('.')\n const ext = _.slice(filename_parts, filename_parts.length-1)\n const filename_main = _.join(_.dropRight(filename_parts), '.')\n file.fileName = sanitize(filename_main) + '.' + ext\n \n return {\n json: {\n from: sanitize(item.json.from.value[0].name),\n date: sanitize(new Date(item.json.date).toISOString().split(\"T\")[0]) // get date part \"2020-01-01\"\n }, \n binary: { file }\n }\n })\n}))\n\n//console.log(result)\nreturn result"
},
"typeVersion": 1
}
],
"connections": {
"IMAP Email": {
"main": [
[
{
"node": "Map each attachment",
"type": "main",
"index": 0
}
]
]
},
"Map each attachment": {
"main": [
[
{
"node": "Nextcloud",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,22 @@
{
"nodes": [
{
"name": "IMAP Email",
"type": "n8n-nodes-base.emailReadImap",
"position": [
760,
400
],
"parameters": {
"options": {
"allowUnauthorizedCerts": false
}
},
"credentials": {
"imap": "imap_creds"
},
"typeVersion": 1
}
],
"connections": {}
}

View File

@@ -0,0 +1,851 @@
{
"id": "q8IFGLeOCGSfoWZu",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Email AI Auto-responder. Summerize and send email",
"tags": [],
"nodes": [
{
"id": "59885699-0f6c-4522-acff-9e28b2a07b82",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-440,
-20
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "b268ab9d-b2e3-46e6-b7ae-70aff0b5484d",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
-220,
-20
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "13c2d151-6f59-4e1f-a174-02d4d0bcaefd",
"name": "DeepSeek R1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-20,
160
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "8149e40d-64e6-4fb9-aebc-2a2483961f07",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
500,
340
],
"parameters": {
"html": "={{ $json.text }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "633f0ce9-04ff-4653-8bbc-7457ba0d18bd",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-320,
600
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "20daf5d3-dc9c-4fad-9f2f-98d86bc1660c",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-340,
760
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "67699bca-4096-4259-bbd4-51a879539aca",
"name": "Email Classifier",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
360,
-20
],
"parameters": {
"options": {
"fallback": "other",
"multiClass": false,
"enableAutoFixing": true,
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.\n"
},
"inputText": "=You must classify the following email::\n\n{{ $json.response.text }}",
"categories": {
"categories": [
{
"category": "Company info request",
"description": "Company info request"
}
]
}
},
"typeVersion": 1
},
{
"id": "9f7742e9-87d5-40b9-9129-0777d8a37933",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
0,
-20
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n"
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "e2d404c0-2aad-407d-b75e-5ef0c5105c0e",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-440,
340
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "3786c2de-c5cb-4233-826e-7265f2bccbdb",
"name": "Review email",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
40,
340
],
"parameters": {
"text": "=Review at the following email:\n\n{{ $json.output }}",
"messages": {
"messageValues": [
{
"message": "=If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary.\n\nNon superare le 100 parole."
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.5
},
{
"id": "baf60eba-5e7b-467f-b27e-1388a91622d0",
"name": "When clicking \u2018Test workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-500,
-980
],
"parameters": {},
"typeVersion": 1
},
{
"id": "77e6160f-20a7-4a75-9fef-bc875b953a16",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-200,
-1120
],
"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": "ab7764d1-531c-4281-8b89-015fb3f5e780",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-200,
-860
],
"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": "cd3eaa81-0f94-484b-b0c2-ecf0ca4541dc",
"name": "Get folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
20,
-860
],
"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": "b39ecd2d-4d5b-4885-86a9-2cfe9f6074ef",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
240,
-860
],
"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": "8171b8f2-998d-4d72-ac28-524daae4a2d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
620,
-660
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "ec6737ad-3fbe-4864-9df8-44f82d6f2c5c",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
600,
-500
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "57b6a4f3-e935-4058-bfdf-309d606c0ca9",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-1180
],
"parameters": {
"color": 6,
"width": 880,
"height": 220,
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "21e2326a-138d-46f3-a849-a80aa7917da9",
"name": "Qdrant Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
480,
-860
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "0818fb6a-2adf-4725-90a4-11cdd7d14036",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
500,
-620
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "8949d938-2743-45d6-b2ad-ce4ac139e0a3",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-920
],
"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": "36d384be-3e11-43b1-b8c3-f63df600a6a6",
"name": "Do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
820,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "386c27cb-6e69-4d96-a8ab-8cfd43e6b171",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-520,
580
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "0bd17bef-e205-464e-9b36-dcda75254e06",
"name": "DeepSeek",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
40,
540
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "3e68a65f-af29-432f-8159-4a599e8a0866",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
-320
],
"parameters": {
"width": 1620,
"height": 240,
"content": "# STEP 3 - MAIN FLOW\n\n- Transform the email into Markdown format for optimal reading by the LLM model\n- Email Summarization through DeepSeek R1 (any model can be used)\n- I classify the email in such a way as to continue only with emails regarding general information about the company. In this way I can respond independently through the information obtained from the vector database\n- I create a chain where I entrust the review of the email to a high-performance model designed for this purpose\n- I send the response email\n\n\n"
},
"typeVersion": 1
},
{
"id": "3b6ae6aa-75a8-4038-bbc2-248ab533b3ab",
"name": "OpenAI 4-o-mini",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
360,
160
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {
"Email Trigger (IMAP)": [
{
"json": {
"to": "info@n3witalia.com",
"date": "Wed, 5 Feb 2025 13:38:51 +0100",
"from": "n3w Italia <info@n3w.it>",
"subject": "Richiesta di informazioni aziendali",
"metadata": {
"x-gm-gg": "ASbGncsq6D/oyHjmnpbG4gCUuC0rZNUR8WW4c+LmGMSdGJ1lHkRnKn7b3ngCdndp8NB\tkyDG3unga3kPebzAv1LO7DS6rDMHTWb8F7kZoLijJUGlAy6wqmfX/n4z2DH1uSxp7EsnIP9K9",
"arc-seal": "i=1; s=arc-2022; d=mailchannels.net; t=1738759167; a=rsa-sha256;\tcv=none;\tb=Fdjl0FQlp2JxGTUy9B6U3UVZDgw2xRK0M9ge2H7QXFuX8Jhy2/eDktsWwyDOuAnebq+pZB\tZmt9/ZWM+VqpfvPc9j4+cpX1HnXkRnyV9HMp0KK1Srpkuc7iimLDX1puMEQP08mC8fBI9n\tYW9JAMVmy55D2xtcOgqQPe6HUsAM8vFfk0y7dv7aV/MMc4tW+lyBddf4BHedDPabmHtog9\tlI9qQB8f5o78KJoJHi9jUfoibHrw7ePCi/XNi1KzfLhkkcvaEhOIg82JgyaTOVuLX4TTpy\t713VrUVQKemdE8AJBgxrUyI8AM/XZDRxF92tDNRD5k+rFxVwZnNg1KzovEUFiw==",
"received": "from postfix-inbound-v2-3.inbound.mailchannels.net (inbound-egress-7.mailchannels.net [23.83.220.5])\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)\t(No client certificate requested)\tby pdx1-sub0-mail-mx201.dreamhost.com (Postfix) with ESMTPS id 4Yp0DP2WKvz6n5V\tfor <info@n3witalia.com>; Wed, 5 Feb 2025 04:39:33 -0800 (PST)",
"message-id": "<CACo-EPti-vvs3198N-KKhAMnm70ppkmGJPkUz3Y483wxAv_z3g@mail.gmail.com>",
"x-received": "by 2002:a05:6820:4ccb:b0:5fa:7e37:e42e with SMTP id 006d021491bc7-5fc479d7b7dmr1800193eaf.3.1738759166233; Wed, 05 Feb 2025 04:39:26 -0800 (PST)",
"return-path": "<info@n3w.it>",
"content-type": "multipart/alternative; boundary=\"000000000000742c2a062d646a8f\"",
"delivered-to": "x21967472@pdx1-sub0-mail-mx201.dreamhost.com",
"mime-version": "1.0",
"received-spf": "none (dmarc-service-75b56dd9b6-qz8tf: n3w.it does not provide an SPF record) client-ip=209.85.161.50; envelope-from=info@n3w.it; helo=mail-oo1-f50.google.com;",
"x-message-id": "YDPlyzG1R2Ky6usgMxqEJvf1",
"x-gm-features": "AWEUYZl838uJdYn-9fUMGZvOqArNBONSW_VOkpWSkn1OYyR-HUtJL8UAJf2I33g",
"x-original-to": "info@n3witalia.com",
"dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=n3w-it.20230601.gappssmtp.com; s=20230601; t=1738759166; x=1739363966; darn=n3witalia.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=eH1Dg2CwoWEuiif+VkxoPH8PcgiveMtY7urkbJAXXAEnpmkknbrSX7fLQ/pdfnV2YF RaDEVEFBYeYde7pra1NhNmQXQfamV6dxTZSoNOVj0DtdOuSZVYC4BQMMQiIk7emERgdx keDGBtYe2SifOK9QDK4deKKFPaswC7vATsPmBIAnN0MDahaOlsDPbm6aFSR39aK0qEpx MTylUSCNFx52cTYegrpzMGCRTrCxcHwvpq0gGZo1ol0mlq5WC4sa260qsVEQq566N1wh ICipbEhLdoX0nryrR67fJ+mq05kfg39gv++0p1aZl3/ahTdLTijPJswPs4phiTUj6fUH Z3Fg==",
"x-gm-message-state": "AOJu0YwNwfJ1yYtAsu71S9Oy+BVSQqPDS1EJCni+CLWs7aDwxkFYjxsP\tX0A935B/tHpnOhgJuR8W5FwuKnXSFMZ/xP8TFQz8zBVGw7DYInyaC0lKAxPSbBsLDIFyVj2LYki\tR4sfj6a9YJDaWKE/HYPwbidCOfOV/mZvqJ2ESL5uJgSL0W4FrMJKmondc",
"x-google-smtp-source": "AGHT+IFsZ2bQKEg+M9ddjCSDXjf2Okz49s6pteuNGyJAkFpjMLwhH4mshXYItB/GVj4r8fUIiAiACRT+QDfae1MMj48=",
"arc-message-signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net;\ts=arc-2022; t=1738759167;\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\t to:to:cc:mime-version:mime-version:content-type:content-type:\t dkim-signature; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=;\tb=xytHIe/PVvcfCsSYAhcVE9VlTvmbJcVbkpq0oKRt4H0M1VOfZZlsg5ILysJvwLAzrRO7SZ\tDUrh4bw57jqMpcE+Sk5AAcbgBMc6x1G+Wf/2nqnjy0hRCyqtajuUwtFOS3kDM7TKvFOU+/\tMFChI5mg97hb/0loj8DWQ+J24bu4a6YixGDglupW3JYJoDsPWje2oA+mYyiI5tsnRXFEwe\tpku9KlXkPburbm/ASqKbbi1Y9bEOa2vlRwLL3fFontmC+3kgogunW2fjf4YJlFlSaAj/Xb\tZXQiytNgKOJtkBQMvb0AmYMLgBbYdOBVzUkOUTQCP3Wzbuu0zslvl7cS3HkFIg==",
"authentication-results": "inbound.mailchannels.net; spf=none smtp.mailfrom=info@n3w.it; dkim=temperror header.d=n3w-it.20230601.gappssmtp.com; dmarc=none; arc=none",
"x-google-dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759166; x=1739363966; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=h+GPFjY1knf3xPd+R62zD7JNhs37K+F1qx+6EA3codzYY+yTXSJyTuETXOGVW5r2VK GOcntvGBdeijxte5RLmN6ZwLjvzePLlJLQVOnY8FICowUbwClQbDW1vXvucD+WaGpnBg O95TH/8jKWRBU34EZ9kAY5EqtauKSt675WyhVCmmT864BPbVV335d0t9RgJwV86rM9zy /miMTqpWeDJxDcX4thRlIk19GDc2Wh+5bqFD9kacOAur46RWdwqWaU7T8+5bQmbrKUg5 hqeO8ZDefVV6AyOjSnuLItHcHhlk1PaQ9uOumkRnFQfLUjS08bvLEnJyMA1YrEdo7mCi tD2Q==",
"arc-authentication-results": "i=1;\tinbound-rspamd-8684fd6f95-jsctp;\tnone"
},
"textHtml": "<div dir=\"ltr\">mi chiamo Davide e sto scrivendo per richiedere alcune informazioni riguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni per [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo, richiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato se poteste fornirmi alcuni dettagli utili.<br><br>In particolare, avrei bisogno di sapere:<br><br>Gli orari di apertura del vostro negozio, inclusi eventuali giorni di chiusura o orari ridotti durante i festivi.<br><br>Se offrite servizi di assistenza tecnica per dispositivi elettronici e, in caso affermativo, quali tipologie di dispositivi supportate (es. smartphone, computer, tablet).<br><br>Se disponete di un catalogo prodotti aggiornato o un sito web dove posso consultare l\u00e2\u0080\u0099offerta disponibile.<br><br>Se effettuate consegne a domicilio o se \u00c3\u00a8 possibile prenotare prodotti online per il ritiro in negozio.<br><br>Se offrite sconti o promozioni per studenti, aziende o clienti abituali.<br><br>Se organizzate eventi o workshop legati alla tecnologia, come corsi di formazione o presentazioni di nuovi prodotti.<br><br>Inoltre, sarei interessato a sapere se il vostro negozio aderisce a programmi di riciclo di dispositivi elettronici o se offrite servizi di smaltimento ecologico per apparecchiature obsolete.<br><br>Se possibile, gradirei ricevere anche informazioni sui metodi di pagamento accettati (es. carte di credito, PayPal, finanziamenti) e se \u00c3\u00a8 possibile richiedere un preventivo personalizzato per acquisti di grandi dimensioni.<br><br>Resto a disposizione per eventuali chiarimenti o per fornire ulteriori dettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato alla mia richiesta e attendo con interesse una vostra risposta.<br><br>Cordiali saluti,</div>\r\n",
"textPlain": "mi chiamo Davide e sto scrivendo per richiedere alcune informazioni\r\nriguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni\r\nper [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo,\r\nrichiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato\r\nse poteste fornirmi alcuni dettagli utili.\r\n\r\nIn particolare, avrei bisogno di sapere:\r\n\r\nGli orari di apertura del vostro negozio, inclusi eventuali giorni di\r\nchiusura o orari ridotti durante i festivi.\r\n\r\nSe offrite servizi di assistenza tecnica per dispositivi elettronici e, in\r\ncaso affermativo, quali tipologie di dispositivi supportate (es.\r\nsmartphone, computer, tablet).\r\n\r\nSe disponete di un catalogo prodotti aggiornato o un sito web dove posso\r\nconsultare l\u00e2\u0080\u0099offerta disponibile.\r\n\r\nSe effettuate consegne a domicilio o se \u00c3\u00a8 possibile prenotare prodotti\r\nonline per il ritiro in negozio.\r\n\r\nSe offrite sconti o promozioni per studenti, aziende o clienti abituali.\r\n\r\nSe organizzate eventi o workshop legati alla tecnologia, come corsi di\r\nformazione o presentazioni di nuovi prodotti.\r\n\r\nInoltre, sarei interessato a sapere se il vostro negozio aderisce a\r\nprogrammi di riciclo di dispositivi elettronici o se offrite servizi di\r\nsmaltimento ecologico per apparecchiature obsolete.\r\n\r\nSe possibile, gradirei ricevere anche informazioni sui metodi di pagamento\r\naccettati (es. carte di credito, PayPal, finanziamenti) e se \u00c3\u00a8 possibile\r\nrichiedere un preventivo personalizzato per acquisti di grandi dimensioni.\r\n\r\nResto a disposizione per eventuali chiarimenti o per fornire ulteriori\r\ndettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato\r\nalla mia richiesta e attendo con interesse una vostra risposta.\r\n\r\nCordiali saluti,\r\n"
}
}
],
"Email Summarization Chain": [
{
"json": {
"response": {
"text": "Davide contatta il negozio di tecnologia per richiedere informazioni in merito a: orari di apertura (compresi festivi e chiusure), assistenza tecnica (specificando dispositivi supportati come smartphone, computer, tablet), disponibilit\u00e0 di catalogo aggiornato/sito web, opzioni di consegna a domicilio o ritiro in negozio, sconti per studenti/aziende/clienti abituali, eventi/workshop tematici, programmi di riciclo/smaltimento ecologico, metodi di pagamento accettati (carte, PayPal, finanziamenti) e preventivi personalizzati per acquisti consistenti. Si rende disponibile per ulteriori chiarimenti e ringrazia per la risposta. (99 parole)"
}
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "eee08614-3096-477a-b462-859782a74188",
"connections": {
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"DeepSeek": {
"ai_languageModel": [
[
{
"node": "Review email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek R1": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Review email",
"type": "main",
"index": 0
}
]
]
},
"Review email": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Qdrant Vector Store1",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"OpenAI 4-o-mini": {
"ai_languageModel": [
[
{
"node": "Email Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Email Classifier": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
],
[
{
"node": "Do nothing",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Refresh collection": {
"main": [
[
{
"node": "Get folder",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_document",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Email Classifier",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Test workflow\u2019": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,504 @@
{
"id": "OuHrYOR3uWGmrhWQ",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "AI Email processing autoresponder with approval (Yes/No)",
"tags": [],
"nodes": [
{
"id": "06a098db-160b-45f7-aeac-a73ef868148e",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-180,
-100
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "9589443b-efb7-4e0d-bafc-0be9858a4755",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
40,
-100
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "8de7b2f3-bf75-4f3c-a1ee-eec047a7b82e",
"name": "DeepSeek R1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
240,
80
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "babf37dc-99ca-439a-b094-91c52799b8df",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
1840,
-120
],
"webhookId": "f84fcde7-6aac-485a-9a08-96a35955af49",
"parameters": {
"html": "={{ $('Write email').item.json.output }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "ebeb986d-053a-420d-8482-ee00e75f2f10",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
1180,
200
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "ccc3d026-bfa3-4fda-be0a-ef70bf831aa7",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1180,
380
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "1726aac9-a77d-4f19-8c07-70b032c3abeb",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
260,
-100
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words :\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used."
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "81b889d0-e724-4c1f-9ce3-7593c796aaaf",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
980,
-100
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $('Email Summarization Chain').item.json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words. Only the body of the email, not create the subject.\n\nIt must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "cf38e319-59b3-490e-b841-579afc9fbc02",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
980,
200
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "19842e5f-c372-4dfd-b860-87dc5f00b1af",
"name": "Set Email",
"type": "n8n-nodes-base.set",
"position": [
760,
-100
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "759dc0f9-f582-492c-896c-6426f8410127",
"name": "email",
"type": "string",
"value": "={{ $json.response.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2cf7a9af-c5e8-45dd-bda5-01c562a0defb",
"name": "Approve?",
"type": "n8n-nodes-base.if",
"position": [
1560,
-100
],
"parameters": {
"options": {
"ignoreCase": false
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5c377c1c-43c6-45e7-904e-dbbe6b682686",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.data.approved }}",
"rightValue": "true"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "08cabec6-9840-4214-8315-b877c86794bf",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-680
],
"parameters": {
"color": 3,
"width": 580,
"height": 420,
"content": "# Main Flow\n\n## Preliminary step:\nCreate a vector database on Qdrant and tokenize the documents useful for generating a response\n\n\n## How it works\nThis workflow is designed to automate the process of handling incoming emails, summarizing their content, generating appropriate responses with RAG, and obtaining approval (YES/NO button) before sending replies.\n\nThis workflow is designed to handle general inquiries that come in via corporate email via IMAP and generate responses using RAG. You can quickly integrate Gmail and Outlook via the appropriate trigger nodes"
},
"typeVersion": 1
},
{
"id": "80692c8f-e236-43ac-aad2-91bd90f40065",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-40,
-180
],
"parameters": {
"height": 240,
"content": "Convert email to Markdown format for better understanding of LLM models"
},
"typeVersion": 1
},
{
"id": "e6957fde-bf05-4b67-aa0e-44c575fca04d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
-180
],
"parameters": {
"width": 320,
"height": 240,
"content": "Chain that summarizes the received email"
},
"typeVersion": 1
},
{
"id": "7cfba59f-83ce-4f0b-b54a-b2c11d58fd82",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
940,
-180
],
"parameters": {
"width": 340,
"height": 240,
"content": "Agent that retrieves business information from a vector database and processes the response"
},
"typeVersion": 1
},
{
"id": "28c4bd00-6a47-422f-a50a-935f3724ba01",
"name": "Send Draft",
"type": "n8n-nodes-base.gmail",
"position": [
1340,
-100
],
"webhookId": "d6dd2e7c-90ea-4b65-9c64-523d2541a054",
"parameters": {
"sendTo": "YOUR GMAIL ADDRESS",
"message": "=<h3>MESSAGE</h3>\n{{ $('Email Trigger (IMAP)').item.json.textHtml }}\n\n<h3>AI RESPONSE</h3>\n{{ $json.output }}",
"options": {},
"subject": "=[Approval Required] {{ $('Email Trigger (IMAP)').item.json.subject }}",
"operation": "sendAndWait",
"approvalOptions": {
"values": {
"approvalType": "double"
}
}
},
"credentials": {
"gmailOAuth2": {
"id": "nyuHvSX5HuqfMPlW",
"name": "Gmail account (n3w.it)"
}
},
"typeVersion": 2.1
},
{
"id": "0aae1689-cee7-403a-8640-396db32eceed",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1300,
-300
],
"parameters": {
"color": 4,
"height": 360,
"content": "## IMPORTANT\n\nFor the \"Send Draft\" node, you need to send the draft email to a Gmail address because it is the only one that allows the \"Send and wait for response\" function."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "6f7b864e-1589-418c-960e-b832cf032d1b",
"connections": {
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Approve?": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
],
[
{
"node": "Set Email",
"type": "main",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Set Email": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
]
]
},
"Send Draft": {
"main": [
[
{
"node": "Approve?",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek R1": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Send Draft",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Set Email",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,892 @@
{
"id": "nkPjDxMrrkKbgHaV",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Effortless Email Management with AI",
"tags": [],
"nodes": [
{
"id": "9d77e26f-de2b-4bd4-b0f0-9924a8f459a6",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-2000,
-180
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "cf2d020b-b125-4a20-8694-8ed0f7acf755",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
-1740,
-180
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "41bfceff-0155-4643-be60-ee301e2d69e1",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
400,
-320
],
"webhookId": "a79ae1b4-648c-4cb4-b6cd-04ea3c1d9314",
"parameters": {
"html": "={{ $('Edit Fields').item.json.email }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "2aff581a-8b64-405c-b62f-74bf189fd7b1",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-320,
600
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "6e3f6df0-8924-47d9-855c-51205d19e86d",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-440,
800
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "37ac411b-4a74-44d1-917e-b07d1c9ca221",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
-1480,
-180
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used."
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "91edbac9-847b-4f31-a8dd-09418bd93642",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1040,
-180
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words. Only the body of the email, not create the subject"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "1da0e72a-db97-4216-a1a5-038cebaf7e10",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-180,
280
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "af2d6284-4c8f-4a07-b689-d0f55aaabd26",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
-300,
-180
],
"webhookId": "d6dd2e7c-90ea-4b65-9c64-523d2541a054",
"parameters": {
"sendTo": "info@n3w.it",
"message": "=<h3>MESSAGE</h3>\n{{ $('Email Trigger (IMAP)').item.json.textHtml }}\n\n<h3>AI RESPONSE</h3>\n{{ $json.email }}",
"options": {},
"subject": "=[Approval Required] {{ $('Email Trigger (IMAP)').item.json.subject }}",
"operation": "sendAndWait",
"responseType": "freeText"
},
"credentials": {
"gmailOAuth2": {
"id": "nyuHvSX5HuqfMPlW",
"name": "Gmail account (n3w.it)"
}
},
"typeVersion": 2.1
},
{
"id": "aaccc4a6-ce53-4813-8247-65bd1a9d5639",
"name": "Text Classifier",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
-60,
-180
],
"parameters": {
"options": {
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json."
},
"inputText": "={{ $json.data.text }}",
"categories": {
"categories": [
{
"category": "Approved",
"description": "The email has been reviewed and accepted as-is. The human explicitly or implicity express approva, indicating that no changes ar needed.\n\nExample:\n\"Ok\",\n\"Approvato\",\n\"Invia\""
},
{
"category": "Declined",
"description": "The email has been reviewd, but the human request modifications before it sent link tweaks, removing parts, rewording etc... This could include suggested edits, rewording or major revision."
}
]
}
},
"typeVersion": 1
},
{
"id": "b46de5d9-1a2e-4d28-930b-e18fb1d7876e",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
-580,
-180
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "35d7c303-42f4-4dd1-b41e-6eb087c23c3d",
"name": "email",
"type": "string",
"value": "={{ $json.output }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "36ce51c6-8ee1-4230-84c0-40e259eafb1a",
"name": "When clicking \u2018Test workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1340,
-1300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "21a0c991-65dc-483e-9b98-5cedaba7ae13",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1040,
-1440
],
"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": "9a048d7d-bcdf-40b7-b33a-94b811083eac",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1040,
-1180
],
"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": "db494d2d-5390-4f83-9b87-3409fef31a7d",
"name": "Get folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
-820,
-1180
],
"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": "e30dbe6f-482e-47f9-b5b8-62c1113e6c8b",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
-600,
-1180
],
"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": "492d48d8-4997-4f04-902b-041da3210417",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
-200,
-980
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "0cf45d10-3cbf-4eb6-ab30-11f264b3aa8d",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
-240,
-820
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "7d60f569-c34e-49a8-ba9a-88cf33083136",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-840,
-1500
],
"parameters": {
"color": 6,
"width": 880,
"height": 220,
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "e86b18c4-d7e8-4e81-b520-dbd8125edf38",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1060,
-1240
],
"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": "05f65120-ef31-4c67-ac18-e68a8353909c",
"name": "Qdrant Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-360,
-1180
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "c15fd52f-b142-408e-af06-aeed10a1cf85",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-380,
-980
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "3e47224f-3deb-450b-b825-f16c5f860f28",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2020,
-600
],
"parameters": {
"color": 3,
"width": 580,
"height": 260,
"content": "# STEP 3 - MAIN FLOW\n\n\n## How it works\nThis workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses using a retrieval-augmented generation (RAG) approach, and obtains approval or suggestions before sending replies. \n\nYou can quickly integrate Gmail and Outlook via the appropriate trigger nodes"
},
"typeVersion": 1
},
{
"id": "63097039-58cb-4e0f-9fb6-6bf868275519",
"name": "DeepSeek Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
"position": [
-1560,
40
],
"parameters": {
"options": {}
},
"credentials": {
"deepSeekApi": {
"id": "sxh1rfZxonXV83hS",
"name": "DeepSeek account"
}
},
"typeVersion": 1
},
{
"id": "c86d6eeb-cf08-429f-b5b4-60b317071035",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1500,
-260
],
"parameters": {
"width": 320,
"height": 240,
"content": "Chain that summarizes the received email"
},
"typeVersion": 1
},
{
"id": "4afc8b00-d1e5-473c-a71e-1299c84c546e",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1060,
-260
],
"parameters": {
"width": 340,
"height": 240,
"content": "Agent that retrieves business information from a vector database and processes the response"
},
"typeVersion": 1
},
{
"id": "be1762ff-729b-4b83-9139-16f835b748f2",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1800,
-260
],
"parameters": {
"height": 240,
"content": "Convert email to Markdown format for better understanding of LLM models"
},
"typeVersion": 1
},
{
"id": "f818ede7-895a-4860-91d3-f08cc32ec0e3",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-380,
-380
],
"parameters": {
"color": 4,
"height": 360,
"content": "## IMPORTANT\n\nFor the \"Send Draft\" node, you need to send the draft email to a Gmail address because it is the only one that allows the \"Send and wait for response\" function."
},
"typeVersion": 1
},
{
"id": "929b525a-912b-4f7b-a6e7-dfeb88a446c8",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-100,
-260
],
"parameters": {
"width": 360,
"height": 240,
"content": "Based on the suggestion received, the text classifier can understand whether the feedback received approves the generated email or not."
},
"typeVersion": 1
},
{
"id": "2468e643-013f-4925-ab35-c8ef4ee6eed2",
"name": "Email Reviewer",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
380,
-40
],
"parameters": {
"text": "=Review at the following email:\n{{ $('Edit Fields').item.json.email }}\n\nFeedback from human:\n{{ $json.data.text }}",
"options": {
"systemMessage": "If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary. Be concise and never exceed 100 words. Only the body of the email"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "ecd9d3f8-2e79-4e5f-a73d-48de60441376",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
-120
],
"parameters": {
"width": 340,
"height": 220,
"content": "The Email Reviewer agent, taking inspiration from human feedback, rewrites the email"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "de11da52-1513-4797-8070-b64e84b84158",
"connections": {
"Gmail": {
"main": [
[
{
"node": "Text Classifier",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Email Reviewer",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Text Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Qdrant Vector Store1",
"type": "main",
"index": 0
}
]
]
},
"Email Reviewer": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Text Classifier": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
],
[
{
"node": "Email Reviewer",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Refresh collection": {
"main": [
[
{
"node": "Get folder",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek Chat Model": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_document",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
},
{
"node": "Email Reviewer",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Test workflow\u2019": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,504 @@
{
"id": "OuHrYOR3uWGmrhWQ",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "AI Email processing autoresponder with approval (Yes/No)",
"tags": [],
"nodes": [
{
"id": "06a098db-160b-45f7-aeac-a73ef868148e",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-180,
-100
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "9589443b-efb7-4e0d-bafc-0be9858a4755",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
40,
-100
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "8de7b2f3-bf75-4f3c-a1ee-eec047a7b82e",
"name": "DeepSeek R1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
240,
80
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "babf37dc-99ca-439a-b094-91c52799b8df",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
1840,
-120
],
"webhookId": "f84fcde7-6aac-485a-9a08-96a35955af49",
"parameters": {
"html": "={{ $('Write email').item.json.output }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "ebeb986d-053a-420d-8482-ee00e75f2f10",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
1180,
200
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "ccc3d026-bfa3-4fda-be0a-ef70bf831aa7",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1180,
380
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "1726aac9-a77d-4f19-8c07-70b032c3abeb",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
260,
-100
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words :\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used."
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "81b889d0-e724-4c1f-9ce3-7593c796aaaf",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
980,
-100
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $('Email Summarization Chain').item.json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words. Only the body of the email, not create the subject.\n\nIt must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "cf38e319-59b3-490e-b841-579afc9fbc02",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
980,
200
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "19842e5f-c372-4dfd-b860-87dc5f00b1af",
"name": "Set Email",
"type": "n8n-nodes-base.set",
"position": [
760,
-100
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "759dc0f9-f582-492c-896c-6426f8410127",
"name": "email",
"type": "string",
"value": "={{ $json.response.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2cf7a9af-c5e8-45dd-bda5-01c562a0defb",
"name": "Approve?",
"type": "n8n-nodes-base.if",
"position": [
1560,
-100
],
"parameters": {
"options": {
"ignoreCase": false
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5c377c1c-43c6-45e7-904e-dbbe6b682686",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.data.approved }}",
"rightValue": "true"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "08cabec6-9840-4214-8315-b877c86794bf",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-680
],
"parameters": {
"color": 3,
"width": 580,
"height": 420,
"content": "# Main Flow\n\n## Preliminary step:\nCreate a vector database on Qdrant and tokenize the documents useful for generating a response\n\n\n## How it works\nThis workflow is designed to automate the process of handling incoming emails, summarizing their content, generating appropriate responses with RAG, and obtaining approval (YES/NO button) before sending replies.\n\nThis workflow is designed to handle general inquiries that come in via corporate email via IMAP and generate responses using RAG. You can quickly integrate Gmail and Outlook via the appropriate trigger nodes"
},
"typeVersion": 1
},
{
"id": "80692c8f-e236-43ac-aad2-91bd90f40065",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-40,
-180
],
"parameters": {
"height": 240,
"content": "Convert email to Markdown format for better understanding of LLM models"
},
"typeVersion": 1
},
{
"id": "e6957fde-bf05-4b67-aa0e-44c575fca04d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
-180
],
"parameters": {
"width": 320,
"height": 240,
"content": "Chain that summarizes the received email"
},
"typeVersion": 1
},
{
"id": "7cfba59f-83ce-4f0b-b54a-b2c11d58fd82",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
940,
-180
],
"parameters": {
"width": 340,
"height": 240,
"content": "Agent that retrieves business information from a vector database and processes the response"
},
"typeVersion": 1
},
{
"id": "28c4bd00-6a47-422f-a50a-935f3724ba01",
"name": "Send Draft",
"type": "n8n-nodes-base.gmail",
"position": [
1340,
-100
],
"webhookId": "d6dd2e7c-90ea-4b65-9c64-523d2541a054",
"parameters": {
"sendTo": "YOUR GMAIL ADDRESS",
"message": "=<h3>MESSAGE</h3>\n{{ $('Email Trigger (IMAP)').item.json.textHtml }}\n\n<h3>AI RESPONSE</h3>\n{{ $json.output }}",
"options": {},
"subject": "=[Approval Required] {{ $('Email Trigger (IMAP)').item.json.subject }}",
"operation": "sendAndWait",
"approvalOptions": {
"values": {
"approvalType": "double"
}
}
},
"credentials": {
"gmailOAuth2": {
"id": "nyuHvSX5HuqfMPlW",
"name": "Gmail account (n3w.it)"
}
},
"typeVersion": 2.1
},
{
"id": "0aae1689-cee7-403a-8640-396db32eceed",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1300,
-300
],
"parameters": {
"color": 4,
"height": 360,
"content": "## IMPORTANT\n\nFor the \"Send Draft\" node, you need to send the draft email to a Gmail address because it is the only one that allows the \"Send and wait for response\" function."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "6f7b864e-1589-418c-960e-b832cf032d1b",
"connections": {
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Approve?": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
],
[
{
"node": "Set Email",
"type": "main",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Set Email": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
]
]
},
"Send Draft": {
"main": [
[
{
"node": "Approve?",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek R1": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Send Draft",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Set Email",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,892 @@
{
"id": "nkPjDxMrrkKbgHaV",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Effortless Email Management with AI",
"tags": [],
"nodes": [
{
"id": "9d77e26f-de2b-4bd4-b0f0-9924a8f459a6",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-2000,
-180
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "cf2d020b-b125-4a20-8694-8ed0f7acf755",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
-1740,
-180
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "41bfceff-0155-4643-be60-ee301e2d69e1",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
400,
-320
],
"webhookId": "a79ae1b4-648c-4cb4-b6cd-04ea3c1d9314",
"parameters": {
"html": "={{ $('Edit Fields').item.json.email }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "2aff581a-8b64-405c-b62f-74bf189fd7b1",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-320,
600
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "6e3f6df0-8924-47d9-855c-51205d19e86d",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-440,
800
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "37ac411b-4a74-44d1-917e-b07d1c9ca221",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
-1480,
-180
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used."
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "91edbac9-847b-4f31-a8dd-09418bd93642",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1040,
-180
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words. Only the body of the email, not create the subject"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "1da0e72a-db97-4216-a1a5-038cebaf7e10",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-180,
280
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "af2d6284-4c8f-4a07-b689-d0f55aaabd26",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
-300,
-180
],
"webhookId": "d6dd2e7c-90ea-4b65-9c64-523d2541a054",
"parameters": {
"sendTo": "info@n3w.it",
"message": "=<h3>MESSAGE</h3>\n{{ $('Email Trigger (IMAP)').item.json.textHtml }}\n\n<h3>AI RESPONSE</h3>\n{{ $json.email }}",
"options": {},
"subject": "=[Approval Required] {{ $('Email Trigger (IMAP)').item.json.subject }}",
"operation": "sendAndWait",
"responseType": "freeText"
},
"credentials": {
"gmailOAuth2": {
"id": "nyuHvSX5HuqfMPlW",
"name": "Gmail account (n3w.it)"
}
},
"typeVersion": 2.1
},
{
"id": "aaccc4a6-ce53-4813-8247-65bd1a9d5639",
"name": "Text Classifier",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
-60,
-180
],
"parameters": {
"options": {
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json."
},
"inputText": "={{ $json.data.text }}",
"categories": {
"categories": [
{
"category": "Approved",
"description": "The email has been reviewed and accepted as-is. The human explicitly or implicity express approva, indicating that no changes ar needed.\n\nExample:\n\"Ok\",\n\"Approvato\",\n\"Invia\""
},
{
"category": "Declined",
"description": "The email has been reviewd, but the human request modifications before it sent link tweaks, removing parts, rewording etc... This could include suggested edits, rewording or major revision."
}
]
}
},
"typeVersion": 1
},
{
"id": "b46de5d9-1a2e-4d28-930b-e18fb1d7876e",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
-580,
-180
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "35d7c303-42f4-4dd1-b41e-6eb087c23c3d",
"name": "email",
"type": "string",
"value": "={{ $json.output }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "36ce51c6-8ee1-4230-84c0-40e259eafb1a",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1340,
-1300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "21a0c991-65dc-483e-9b98-5cedaba7ae13",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1040,
-1440
],
"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": "9a048d7d-bcdf-40b7-b33a-94b811083eac",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1040,
-1180
],
"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": "db494d2d-5390-4f83-9b87-3409fef31a7d",
"name": "Get folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
-820,
-1180
],
"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": "e30dbe6f-482e-47f9-b5b8-62c1113e6c8b",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
-600,
-1180
],
"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": "492d48d8-4997-4f04-902b-041da3210417",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
-200,
-980
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "0cf45d10-3cbf-4eb6-ab30-11f264b3aa8d",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
-240,
-820
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "7d60f569-c34e-49a8-ba9a-88cf33083136",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-840,
-1500
],
"parameters": {
"color": 6,
"width": 880,
"height": 220,
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "e86b18c4-d7e8-4e81-b520-dbd8125edf38",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1060,
-1240
],
"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": "05f65120-ef31-4c67-ac18-e68a8353909c",
"name": "Qdrant Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-360,
-1180
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "c15fd52f-b142-408e-af06-aeed10a1cf85",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-380,
-980
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "3e47224f-3deb-450b-b825-f16c5f860f28",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2020,
-600
],
"parameters": {
"color": 3,
"width": 580,
"height": 260,
"content": "# STEP 3 - MAIN FLOW\n\n\n## How it works\nThis workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses using a retrieval-augmented generation (RAG) approach, and obtains approval or suggestions before sending replies. \n\nYou can quickly integrate Gmail and Outlook via the appropriate trigger nodes"
},
"typeVersion": 1
},
{
"id": "63097039-58cb-4e0f-9fb6-6bf868275519",
"name": "DeepSeek Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
"position": [
-1560,
40
],
"parameters": {
"options": {}
},
"credentials": {
"deepSeekApi": {
"id": "sxh1rfZxonXV83hS",
"name": "DeepSeek account"
}
},
"typeVersion": 1
},
{
"id": "c86d6eeb-cf08-429f-b5b4-60b317071035",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1500,
-260
],
"parameters": {
"width": 320,
"height": 240,
"content": "Chain that summarizes the received email"
},
"typeVersion": 1
},
{
"id": "4afc8b00-d1e5-473c-a71e-1299c84c546e",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1060,
-260
],
"parameters": {
"width": 340,
"height": 240,
"content": "Agent that retrieves business information from a vector database and processes the response"
},
"typeVersion": 1
},
{
"id": "be1762ff-729b-4b83-9139-16f835b748f2",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1800,
-260
],
"parameters": {
"height": 240,
"content": "Convert email to Markdown format for better understanding of LLM models"
},
"typeVersion": 1
},
{
"id": "f818ede7-895a-4860-91d3-f08cc32ec0e3",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-380,
-380
],
"parameters": {
"color": 4,
"height": 360,
"content": "## IMPORTANT\n\nFor the \"Send Draft\" node, you need to send the draft email to a Gmail address because it is the only one that allows the \"Send and wait for response\" function."
},
"typeVersion": 1
},
{
"id": "929b525a-912b-4f7b-a6e7-dfeb88a446c8",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-100,
-260
],
"parameters": {
"width": 360,
"height": 240,
"content": "Based on the suggestion received, the text classifier can understand whether the feedback received approves the generated email or not."
},
"typeVersion": 1
},
{
"id": "2468e643-013f-4925-ab35-c8ef4ee6eed2",
"name": "Email Reviewer",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
380,
-40
],
"parameters": {
"text": "=Review at the following email:\n{{ $('Edit Fields').item.json.email }}\n\nFeedback from human:\n{{ $json.data.text }}",
"options": {
"systemMessage": "If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary. Be concise and never exceed 100 words. Only the body of the email"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "ecd9d3f8-2e79-4e5f-a73d-48de60441376",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
-120
],
"parameters": {
"width": 340,
"height": 220,
"content": "The Email Reviewer agent, taking inspiration from human feedback, rewrites the email"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "de11da52-1513-4797-8070-b64e84b84158",
"connections": {
"Gmail": {
"main": [
[
{
"node": "Text Classifier",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Email Reviewer",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Text Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Qdrant Vector Store1",
"type": "main",
"index": 0
}
]
]
},
"Email Reviewer": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Text Classifier": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
],
[
{
"node": "Email Reviewer",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Refresh collection": {
"main": [
[
{
"node": "Get folder",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek Chat Model": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_document",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
},
{
"node": "Email Reviewer",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Write email",
"type": "main",
"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,851 @@
{
"id": "q8IFGLeOCGSfoWZu",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "Email AI Auto-responder. Summerize and send email",
"tags": [],
"nodes": [
{
"id": "59885699-0f6c-4522-acff-9e28b2a07b82",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-440,
-20
],
"parameters": {
"options": {}
},
"credentials": {
"imap": {
"id": "k31W9oGddl9pMDy4",
"name": "IMAP info@n3witalia.com"
}
},
"typeVersion": 2
},
{
"id": "b268ab9d-b2e3-46e6-b7ae-70aff0b5484d",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
-220,
-20
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "13c2d151-6f59-4e1f-a174-02d4d0bcaefd",
"name": "DeepSeek R1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-20,
160
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "8149e40d-64e6-4fb9-aebc-2a2483961f07",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
500,
340
],
"parameters": {
"html": "={{ $json.text }}",
"options": {},
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
},
"credentials": {
"smtp": {
"id": "hRjP3XbDiIQqvi7x",
"name": "SMTP info@n3witalia.com"
}
},
"typeVersion": 2.1
},
{
"id": "633f0ce9-04ff-4653-8bbc-7457ba0d18bd",
"name": "Qdrant Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
-320,
600
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "company_knowladge_base",
"toolDescription": "Extracts information regarding the request made.",
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
},
"includeDocumentMetadata": false
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "20daf5d3-dc9c-4fad-9f2f-98d86bc1660c",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-340,
760
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "67699bca-4096-4259-bbd4-51a879539aca",
"name": "Email Classifier",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
360,
-20
],
"parameters": {
"options": {
"fallback": "other",
"multiClass": false,
"enableAutoFixing": true,
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.\n"
},
"inputText": "=You must classify the following email::\n\n{{ $json.response.text }}",
"categories": {
"categories": [
{
"category": "Company info request",
"description": "Company info request"
}
]
}
},
"typeVersion": 1
},
{
"id": "9f7742e9-87d5-40b9-9129-0777d8a37933",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
0,
-20
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n"
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "e2d404c0-2aad-407d-b75e-5ef0c5105c0e",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-440,
340
],
"parameters": {
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "3786c2de-c5cb-4233-826e-7265f2bccbdb",
"name": "Review email",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
40,
340
],
"parameters": {
"text": "=Review at the following email:\n\n{{ $json.output }}",
"messages": {
"messageValues": [
{
"message": "=If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary.\n\nNon superare le 100 parole."
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.5
},
{
"id": "baf60eba-5e7b-467f-b27e-1388a91622d0",
"name": "When clicking Test workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-500,
-980
],
"parameters": {},
"typeVersion": 1
},
{
"id": "77e6160f-20a7-4a75-9fef-bc875b953a16",
"name": "Create collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-200,
-1120
],
"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": "ab7764d1-531c-4281-8b89-015fb3f5e780",
"name": "Refresh collection",
"type": "n8n-nodes-base.httpRequest",
"position": [
-200,
-860
],
"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": "cd3eaa81-0f94-484b-b0c2-ecf0ca4541dc",
"name": "Get folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
20,
-860
],
"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": "b39ecd2d-4d5b-4885-86a9-2cfe9f6074ef",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
240,
-860
],
"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": "8171b8f2-998d-4d72-ac28-524daae4a2d7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
620,
-660
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1
},
{
"id": "ec6737ad-3fbe-4864-9df8-44f82d6f2c5c",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
600,
-500
],
"parameters": {
"chunkSize": 300,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "57b6a4f3-e935-4058-bfdf-309d606c0ca9",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-1180
],
"parameters": {
"color": 6,
"width": 880,
"height": 220,
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
},
"typeVersion": 1
},
{
"id": "21e2326a-138d-46f3-a849-a80aa7917da9",
"name": "Qdrant Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
480,
-860
],
"parameters": {
"mode": "insert",
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "id",
"value": "=COLLECTION"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account"
}
},
"typeVersion": 1
},
{
"id": "0818fb6a-2adf-4725-90a4-11cdd7d14036",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
500,
-620
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "8949d938-2743-45d6-b2ad-ce4ac139e0a3",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-920
],
"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": "36d384be-3e11-43b1-b8c3-f63df600a6a6",
"name": "Do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
820,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "386c27cb-6e69-4d96-a8ab-8cfd43e6b171",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-520,
580
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "0bd17bef-e205-464e-9b36-dcda75254e06",
"name": "DeepSeek",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
40,
540
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "XJTqRiKFJpFs5MuX",
"name": "OpenRouter account"
}
},
"typeVersion": 1.2
},
{
"id": "3e68a65f-af29-432f-8159-4a599e8a0866",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
-320
],
"parameters": {
"width": 1620,
"height": 240,
"content": "# STEP 3 - MAIN FLOW\n\n- Transform the email into Markdown format for optimal reading by the LLM model\n- Email Summarization through DeepSeek R1 (any model can be used)\n- I classify the email in such a way as to continue only with emails regarding general information about the company. In this way I can respond independently through the information obtained from the vector database\n- I create a chain where I entrust the review of the email to a high-performance model designed for this purpose\n- I send the response email\n\n\n"
},
"typeVersion": 1
},
{
"id": "3b6ae6aa-75a8-4038-bbc2-248ab533b3ab",
"name": "OpenAI 4-o-mini",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
360,
160
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "CDX6QM4gLYanh0P4",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {
"Email Trigger (IMAP)": [
{
"json": {
"to": "info@n3witalia.com",
"date": "Wed, 5 Feb 2025 13:38:51 +0100",
"from": "n3w Italia <info@n3w.it>",
"subject": "Richiesta di informazioni aziendali",
"metadata": {
"x-gm-gg": "ASbGncsq6D/oyHjmnpbG4gCUuC0rZNUR8WW4c+LmGMSdGJ1lHkRnKn7b3ngCdndp8NB\tkyDG3unga3kPebzAv1LO7DS6rDMHTWb8F7kZoLijJUGlAy6wqmfX/n4z2DH1uSxp7EsnIP9K9",
"arc-seal": "i=1; s=arc-2022; d=mailchannels.net; t=1738759167; a=rsa-sha256;\tcv=none;\tb=Fdjl0FQlp2JxGTUy9B6U3UVZDgw2xRK0M9ge2H7QXFuX8Jhy2/eDktsWwyDOuAnebq+pZB\tZmt9/ZWM+VqpfvPc9j4+cpX1HnXkRnyV9HMp0KK1Srpkuc7iimLDX1puMEQP08mC8fBI9n\tYW9JAMVmy55D2xtcOgqQPe6HUsAM8vFfk0y7dv7aV/MMc4tW+lyBddf4BHedDPabmHtog9\tlI9qQB8f5o78KJoJHi9jUfoibHrw7ePCi/XNi1KzfLhkkcvaEhOIg82JgyaTOVuLX4TTpy\t713VrUVQKemdE8AJBgxrUyI8AM/XZDRxF92tDNRD5k+rFxVwZnNg1KzovEUFiw==",
"received": "from postfix-inbound-v2-3.inbound.mailchannels.net (inbound-egress-7.mailchannels.net [23.83.220.5])\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)\t(No client certificate requested)\tby pdx1-sub0-mail-mx201.dreamhost.com (Postfix) with ESMTPS id 4Yp0DP2WKvz6n5V\tfor <info@n3witalia.com>; Wed, 5 Feb 2025 04:39:33 -0800 (PST)",
"message-id": "<CACo-EPti-vvs3198N-KKhAMnm70ppkmGJPkUz3Y483wxAv_z3g@mail.gmail.com>",
"x-received": "by 2002:a05:6820:4ccb:b0:5fa:7e37:e42e with SMTP id 006d021491bc7-5fc479d7b7dmr1800193eaf.3.1738759166233; Wed, 05 Feb 2025 04:39:26 -0800 (PST)",
"return-path": "<info@n3w.it>",
"content-type": "multipart/alternative; boundary=\"000000000000742c2a062d646a8f\"",
"delivered-to": "x21967472@pdx1-sub0-mail-mx201.dreamhost.com",
"mime-version": "1.0",
"received-spf": "none (dmarc-service-75b56dd9b6-qz8tf: n3w.it does not provide an SPF record) client-ip=209.85.161.50; envelope-from=info@n3w.it; helo=mail-oo1-f50.google.com;",
"x-message-id": "YDPlyzG1R2Ky6usgMxqEJvf1",
"x-gm-features": "AWEUYZl838uJdYn-9fUMGZvOqArNBONSW_VOkpWSkn1OYyR-HUtJL8UAJf2I33g",
"x-original-to": "info@n3witalia.com",
"dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=n3w-it.20230601.gappssmtp.com; s=20230601; t=1738759166; x=1739363966; darn=n3witalia.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=eH1Dg2CwoWEuiif+VkxoPH8PcgiveMtY7urkbJAXXAEnpmkknbrSX7fLQ/pdfnV2YF RaDEVEFBYeYde7pra1NhNmQXQfamV6dxTZSoNOVj0DtdOuSZVYC4BQMMQiIk7emERgdx keDGBtYe2SifOK9QDK4deKKFPaswC7vATsPmBIAnN0MDahaOlsDPbm6aFSR39aK0qEpx MTylUSCNFx52cTYegrpzMGCRTrCxcHwvpq0gGZo1ol0mlq5WC4sa260qsVEQq566N1wh ICipbEhLdoX0nryrR67fJ+mq05kfg39gv++0p1aZl3/ahTdLTijPJswPs4phiTUj6fUH Z3Fg==",
"x-gm-message-state": "AOJu0YwNwfJ1yYtAsu71S9Oy+BVSQqPDS1EJCni+CLWs7aDwxkFYjxsP\tX0A935B/tHpnOhgJuR8W5FwuKnXSFMZ/xP8TFQz8zBVGw7DYInyaC0lKAxPSbBsLDIFyVj2LYki\tR4sfj6a9YJDaWKE/HYPwbidCOfOV/mZvqJ2ESL5uJgSL0W4FrMJKmondc",
"x-google-smtp-source": "AGHT+IFsZ2bQKEg+M9ddjCSDXjf2Okz49s6pteuNGyJAkFpjMLwhH4mshXYItB/GVj4r8fUIiAiACRT+QDfae1MMj48=",
"arc-message-signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net;\ts=arc-2022; t=1738759167;\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\t to:to:cc:mime-version:mime-version:content-type:content-type:\t dkim-signature; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=;\tb=xytHIe/PVvcfCsSYAhcVE9VlTvmbJcVbkpq0oKRt4H0M1VOfZZlsg5ILysJvwLAzrRO7SZ\tDUrh4bw57jqMpcE+Sk5AAcbgBMc6x1G+Wf/2nqnjy0hRCyqtajuUwtFOS3kDM7TKvFOU+/\tMFChI5mg97hb/0loj8DWQ+J24bu4a6YixGDglupW3JYJoDsPWje2oA+mYyiI5tsnRXFEwe\tpku9KlXkPburbm/ASqKbbi1Y9bEOa2vlRwLL3fFontmC+3kgogunW2fjf4YJlFlSaAj/Xb\tZXQiytNgKOJtkBQMvb0AmYMLgBbYdOBVzUkOUTQCP3Wzbuu0zslvl7cS3HkFIg==",
"authentication-results": "inbound.mailchannels.net; spf=none smtp.mailfrom=info@n3w.it; dkim=temperror header.d=n3w-it.20230601.gappssmtp.com; dmarc=none; arc=none",
"x-google-dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759166; x=1739363966; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=h+GPFjY1knf3xPd+R62zD7JNhs37K+F1qx+6EA3codzYY+yTXSJyTuETXOGVW5r2VK GOcntvGBdeijxte5RLmN6ZwLjvzePLlJLQVOnY8FICowUbwClQbDW1vXvucD+WaGpnBg O95TH/8jKWRBU34EZ9kAY5EqtauKSt675WyhVCmmT864BPbVV335d0t9RgJwV86rM9zy /miMTqpWeDJxDcX4thRlIk19GDc2Wh+5bqFD9kacOAur46RWdwqWaU7T8+5bQmbrKUg5 hqeO8ZDefVV6AyOjSnuLItHcHhlk1PaQ9uOumkRnFQfLUjS08bvLEnJyMA1YrEdo7mCi tD2Q==",
"arc-authentication-results": "i=1;\tinbound-rspamd-8684fd6f95-jsctp;\tnone"
},
"textHtml": "<div dir=\"ltr\">mi chiamo Davide e sto scrivendo per richiedere alcune informazioni riguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni per [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo, richiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato se poteste fornirmi alcuni dettagli utili.<br><br>In particolare, avrei bisogno di sapere:<br><br>Gli orari di apertura del vostro negozio, inclusi eventuali giorni di chiusura o orari ridotti durante i festivi.<br><br>Se offrite servizi di assistenza tecnica per dispositivi elettronici e, in caso affermativo, quali tipologie di dispositivi supportate (es. smartphone, computer, tablet).<br><br>Se disponete di un catalogo prodotti aggiornato o un sito web dove posso consultare l’offerta disponibile.<br><br>Se effettuate consegne a domicilio o se è possibile prenotare prodotti online per il ritiro in negozio.<br><br>Se offrite sconti o promozioni per studenti, aziende o clienti abituali.<br><br>Se organizzate eventi o workshop legati alla tecnologia, come corsi di formazione o presentazioni di nuovi prodotti.<br><br>Inoltre, sarei interessato a sapere se il vostro negozio aderisce a programmi di riciclo di dispositivi elettronici o se offrite servizi di smaltimento ecologico per apparecchiature obsolete.<br><br>Se possibile, gradirei ricevere anche informazioni sui metodi di pagamento accettati (es. carte di credito, PayPal, finanziamenti) e se è possibile richiedere un preventivo personalizzato per acquisti di grandi dimensioni.<br><br>Resto a disposizione per eventuali chiarimenti o per fornire ulteriori dettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato alla mia richiesta e attendo con interesse una vostra risposta.<br><br>Cordiali saluti,</div>\r\n",
"textPlain": "mi chiamo Davide e sto scrivendo per richiedere alcune informazioni\r\nriguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni\r\nper [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo,\r\nrichiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato\r\nse poteste fornirmi alcuni dettagli utili.\r\n\r\nIn particolare, avrei bisogno di sapere:\r\n\r\nGli orari di apertura del vostro negozio, inclusi eventuali giorni di\r\nchiusura o orari ridotti durante i festivi.\r\n\r\nSe offrite servizi di assistenza tecnica per dispositivi elettronici e, in\r\ncaso affermativo, quali tipologie di dispositivi supportate (es.\r\nsmartphone, computer, tablet).\r\n\r\nSe disponete di un catalogo prodotti aggiornato o un sito web dove posso\r\nconsultare l’offerta disponibile.\r\n\r\nSe effettuate consegne a domicilio o se è possibile prenotare prodotti\r\nonline per il ritiro in negozio.\r\n\r\nSe offrite sconti o promozioni per studenti, aziende o clienti abituali.\r\n\r\nSe organizzate eventi o workshop legati alla tecnologia, come corsi di\r\nformazione o presentazioni di nuovi prodotti.\r\n\r\nInoltre, sarei interessato a sapere se il vostro negozio aderisce a\r\nprogrammi di riciclo di dispositivi elettronici o se offrite servizi di\r\nsmaltimento ecologico per apparecchiature obsolete.\r\n\r\nSe possibile, gradirei ricevere anche informazioni sui metodi di pagamento\r\naccettati (es. carte di credito, PayPal, finanziamenti) e se è possibile\r\nrichiedere un preventivo personalizzato per acquisti di grandi dimensioni.\r\n\r\nResto a disposizione per eventuali chiarimenti o per fornire ulteriori\r\ndettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato\r\nalla mia richiesta e attendo con interesse una vostra risposta.\r\n\r\nCordiali saluti,\r\n"
}
}
],
"Email Summarization Chain": [
{
"json": {
"response": {
"text": "Davide contatta il negozio di tecnologia per richiedere informazioni in merito a: orari di apertura (compresi festivi e chiusure), assistenza tecnica (specificando dispositivi supportati come smartphone, computer, tablet), disponibilità di catalogo aggiornato/sito web, opzioni di consegna a domicilio o ritiro in negozio, sconti per studenti/aziende/clienti abituali, eventi/workshop tematici, programmi di riciclo/smaltimento ecologico, metodi di pagamento accettati (carte, PayPal, finanziamenti) e preventivi personalizzati per acquisti consistenti. Si rende disponibile per ulteriori chiarimenti e ringrazia per la risposta. (99 parole)"
}
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "eee08614-3096-477a-b462-859782a74188",
"connections": {
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"DeepSeek": {
"ai_languageModel": [
[
{
"node": "Review email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Get folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek R1": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Review email",
"type": "main",
"index": 0
}
]
]
},
"Review email": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Qdrant Vector Store1",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"OpenAI 4-o-mini": {
"ai_languageModel": [
[
{
"node": "Email Classifier",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Email Classifier": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
],
[
{
"node": "Do nothing",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Refresh collection": {
"main": [
[
{
"node": "Get folder",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_document",
"index": 0
}
]
]
},
"Qdrant Vector Store": {
"ai_tool": [
[
{
"node": "Write email",
"type": "ai_tool",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Email Classifier",
"type": "main",
"index": 0
}
]
]
},
"When clicking Test workflow": {
"main": [
[
{
"node": "Create collection",
"type": "main",
"index": 0
},
{
"node": "Refresh collection",
"type": "main",
"index": 0
}
]
]
}
}
}