{ "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": "=
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 } ] ] } } }