{"id":"q8IFGLeOCGSfoWZu","meta":{"instanceId":"workflow-381ceeb1","versionId":"1.0.0","createdAt":"2025-09-29T07:07:44.352487","updatedAt":"2025-09-29T07:07:44.352505","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"Email AI Auto-responder. Summerize and send email","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,"notes":"This emailReadImap node performs automated tasks as part of the workflow."},{"id":"b268ab9d-b2e3-46e6-b7ae-70aff0b5484d","name":"Markdown","type":"n8n-nodes-base.markdown","position":[-220,-20],"parameters":{"html":"={{ $json.textHtml }}","options":{}},"typeVersion":1,"notes":"This markdown node performs automated tasks as part of the workflow."},{"id":"13c2d151-6f59-4e1f-a174-02d4d0bcaefd","name":"DeepSeek R1","type":"n8n-nodes-base.noOp","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,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"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,"notes":"This emailSend node performs automated tasks as part of the workflow."},{"id":"633f0ce9-04ff-4653-8bbc-7457ba0d18bd","name":"Qdrant Vector Store","type":"n8n-nodes-base.noOp","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,"notes":"This vectorStoreQdrant node performs automated tasks as part of the workflow."},{"id":"20daf5d3-dc9c-4fad-9f2f-98d86bc1660c","name":"Embeddings OpenAI","type":"n8n-nodes-base.noOp","position":[-340,760],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"CDX6QM4gLYanh0P4","name":"OpenAi account"}},"typeVersion":1,"notes":"This embeddingsOpenAi node performs automated tasks as part of the workflow."},{"id":"67699bca-4096-4259-bbd4-51a879539aca","name":"Email Classifier","type":"n8n-nodes-base.noOp","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,"notes":"This textClassifier node performs automated tasks as part of the workflow."},{"id":"9f7742e9-87d5-40b9-9129-0777d8a37933","name":"Email Summarization Chain","type":"n8n-nodes-base.noOp","position":[0,-20],"parameters":{"options":{"binaryDataKey":"YOUR_CREDENTIAL_HERE","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":1,"notes":"This chainSummarization node performs automated tasks as part of the workflow."},{"id":"e2d404c0-2aad-407d-b75e-5ef0c5105c0e","name":"Write email","type":"n8n-nodes-base.noOp","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,"notes":"This agent node performs automated tasks as part of the workflow."},{"id":"3786c2de-c5cb-4233-826e-7265f2bccbdb","name":"Review email","type":"n8n-nodes-base.noOp","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,"notes":"This chainLlm node performs automated tasks as part of the workflow."},{"id":"baf60eba-5e7b-467f-b27e-1388a91622d0","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-500,-980],"parameters":{},"typeVersion":1,"notes":"This manualTrigger node performs automated tasks as part of the workflow."},{"id":"77e6160f-20a7-4a75-9fef-bc875b953a16","name":"Create collection","type":"n8n-nodes-base.httpRequest","position":[-200,-1120],"parameters":{"url":"{{ $env.WEBHOOK_URL }}","method":"POST","options":{},"jsonBody":"{\n \"filter\": {}\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"{{ $credentials.genericCredentialType }}","genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"qhny6r5ql9wwotpn","name":"Qdrant API (Hetzner)"}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"id":"ab7764d1-531c-4281-8b89-015fb3f5e780","name":"Refresh collection","type":"n8n-nodes-base.httpRequest","position":[-200,-860],"parameters":{"url":"{{ $env.WEBHOOK_URL }}","method":"POST","options":{},"jsonBody":"{\n \"filter\": {}\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"{{ $credentials.genericCredentialType }}","genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"qhny6r5ql9wwotpn","name":"Qdrant API (Hetzner)"}},"typeVersion":4.2,"notes":"This httpRequest node performs automated tasks as part of the workflow."},{"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":"{{ $env.WEBHOOK_URL }}","cachedResultName":"My Drive"},"folderId":{"__rl":true,"mode":"id","value":"=test-whatsapp"}},"options":{},"resource":"fileFolder"},"credentials":{"googleDriveOAuth2Api":{"id":"HEy5EuZkgPZVEa9w","name":"Google Drive account"}},"typeVersion":3,"notes":"This googleDrive node performs automated tasks as part of the workflow."},{"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,"notes":"This googleDrive node performs automated tasks as part of the workflow."},{"id":"8171b8f2-998d-4d72-ac28-524daae4a2d7","name":"Default Data Loader","type":"n8n-nodes-base.noOp","position":[620,-660],"parameters":{"options":{},"dataType":"binary"},"typeVersion":1,"notes":"This documentDefaultDataLoader node performs automated tasks as part of the workflow."},{"id":"ec6737ad-3fbe-4864-9df8-44f82d6f2c5c","name":"Token Splitter","type":"n8n-nodes-base.noOp","position":[600,-500],"parameters":{"chunkSize":300,"chunkOverlap":30},"typeVersion":1,"notes":"This textSplitterTokenSplitter node performs automated tasks as part of the workflow."},{"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,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"21e2326a-138d-46f3-a849-a80aa7917da9","name":"Qdrant Vector Store1","type":"n8n-nodes-base.noOp","position":[480,-860],"parameters":{"mode":"insert","options":{},"qdrantCollection":{"__rl":true,"mode":"id","value":"=COLLECTION"}},"credentials":{"qdrantApi":{"id":"iyQ6MQiVaF3VMBmt","name":"QdrantApi account"}},"typeVersion":1,"notes":"This vectorStoreQdrant node performs automated tasks as part of the workflow."},{"id":"0818fb6a-2adf-4725-90a4-11cdd7d14036","name":"Embeddings OpenAI1","type":"n8n-nodes-base.noOp","position":[500,-620],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"CDX6QM4gLYanh0P4","name":"OpenAi account"}},"typeVersion":1,"notes":"This embeddingsOpenAi node performs automated tasks as part of the workflow."},{"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,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"36d384be-3e11-43b1-b8c3-f63df600a6a6","name":"Do nothing","type":"n8n-nodes-base.noOp","position":[820,0],"parameters":{},"typeVersion":1,"notes":"This noOp node performs automated tasks as part of the workflow."},{"id":"386c27cb-6e69-4d96-a8ab-8cfd43e6b171","name":"OpenAI","type":"n8n-nodes-base.noOp","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,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"0bd17bef-e205-464e-9b36-dcda75254e06","name":"DeepSeek","type":"n8n-nodes-base.noOp","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,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"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,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"3b6ae6aa-75a8-4038-bbc2-248ab533b3ab","name":"OpenAI 4-o-mini","type":"n8n-nodes-base.noOp","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,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."}],"active":false,"settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"versionId":"eee08614-3096-477a-b462-859782a74188","connections":{"Create collection":{"main":[[],[],[],[],[],[],[],[],[]]},"Refresh collection":{"main":[[],[],[],[],[],[],[],[],[]]},"Email Trigger (IMAP)":{"main":[[],[],[],[],[],[],[],[]]},"DeepSeek R1":{"main":[[]]},"Send Email":{"main":[[],[],[],[],[],[],[],[]]},"Embeddings OpenAI":{"main":[[]]},"Get folder":{"main":[[]]},"Download Files":{"main":[[]]},"Embeddings OpenAI1":{"main":[[]]},"OpenAI":{"main":[[]]},"DeepSeek":{"main":[[]]},"OpenAI 4-o-mini":{"main":[[]]}},"description":"Automated workflow: Email AI Auto-responder. Summerize and send email. This workflow integrates 18 different services: textClassifier, stickyNote, markdown, httpRequest, textSplitterTokenSplitter. It contains 40 nodes and follows best practices for error handling and security.","notes":"Excellent quality workflow: Email AI Auto-responder. Summerize and send email. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}