Skip to main content

AI-powered email automation for business: Summarize & respond with RAG

Workflow preview

Workflow preview
100%
AI-powered email automation for business: Summarize & respond with RAG preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow is ideal for businesses looking to automate their email responses, especially for handling inquiries about company information. It leverages AI to ensure accurate and professional com...

Best for

  • Ticket Management automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.emailreadimap, n8n-nodes-base.markdown, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.emailsend, @n8n/n8n-nodes-langchain.vectorstoreqdrant, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.chainsummarization

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.

Original n8n.io source

1.1 Workflow description

Title
AI-powered email automation for business: Summarize & respond with RAG
Workflow name
AI-powered email automation for business: Summarize & respond with RAG

This workflow is ideal for businesses looking to automate their email responses, especially for handling inquiries about company information. It leverages AI to ensure accurate and professional communication.

How It Works

  1. Email Trigger:

    • The workflow starts with the Email Trigger (IMAP) node, which monitors an email inbox for new messages. When a new email arrives, it triggers the workflow.
  2. Email Preprocessing:

    • The Markdown node converts the email's HTML content into plain text for easier processing by the AI models.
  3. Email Summarization:

    • The Email Summarization Chain node uses an AI model (DeepSeek R1) to generate a concise summary of the email. The summary is limited to 100 words and is written in Italian.
  4. Email Classification:

    • The Email Classifier node categorizes the email into predefined categories (e.g., "Company info request"). If the email does not fit any category, it is classified as "other".
  5. Email Response Generation:

    • The Write email node uses an AI model (OpenAI) to draft a professional response to the email. The response is based on the email content and is limited to 100 words.
    • The Review email node uses another AI model (DeepSeek) to review and format the drafted response. It ensures the response is professional and formatted in HTML (e.g., using <br>, <b>, <i>, <p> tags where necessary).
  6. Email Sending:

    • The Send Email node sends the reviewed and formatted response back to the original sender.
  7. Vector Database Integration:

    • The Qdrant Vector Store node retrieves relevant information from a vector database (Qdrant) to assist in generating accurate responses. This is particularly useful for emails classified as "Company info request".
    • The Embeddings OpenAI node generates embeddings for the email content, which are used to query the vector database.
  8. Document Vectorization:

    • The workflow includes steps to create and refresh a Qdrant collection (Create collection and Refresh collection nodes).
    • Documents from Google Drive are downloaded (Get folder and Download Files nodes), processed into embeddings (Embeddings OpenAI1 node), and stored in the Qdrant vector store (Qdrant Vector Store1 node).

Set Up Steps

  1. Configure Email Trigger:

    • Set up the Email Trigger (IMAP) node with the appropriate IMAP credentials to monitor the email inbox.
  2. Set Up AI Models:

    • Configure the DeepSeek R1, OpenAI, and DeepSeek nodes with the appropriate API credentials for text summarization, response generation, and review.
  3. Set Up Email Classification:

    • Define the categories in the Email Classifier node (e.g., "Company info request", "Other").
    • Ensure the OpenAI 4-o-mini node is configured to assist in classification.
  4. Set Up Vector Database:

    • Configure the Qdrant Vector Store and Qdrant Vector Store1 nodes with the appropriate Qdrant API credentials and collection details.
    • Set up the Embeddings OpenAI and Embeddings OpenAI1 nodes to generate embeddings for the email content and documents.
  5. Set Up Document Processing:

    • Configure the Get folder and Download Files nodes to access and download documents from Google Drive.
    • Use the Token Splitter and Default Data Loader nodes to process and split the documents into manageable chunks for vectorization.
  6. Set Up Email Sending:

    • Configure the Send Email node with the appropriate SMTP credentials to send responses.
  7. Test the Workflow:

    • Trigger the workflow manually using the When clicking ‘Test workflow’ node to ensure all steps execute correctly.
    • Verify that emails are summarized, classified, and responded to accurately.
  8. Activate the Workflow:

    • Once tested, activate the workflow to automate the process of handling incoming emails.

Key Features

  • Automated Email Handling: Automatically processes incoming emails, summarizes them, and generates professional responses.
  • AI-Powered Classification: Uses AI to classify emails into relevant categories for targeted responses.
  • Vector Database Integration: Retrieves relevant information from a vector database to enhance response accuracy.
  • Document Vectorization: Processes and stores documents from Google Drive in a vector database for quick retrieval.
  • Professional Email Formatting: Ensures responses are professionally formatted and concise.

Need help customizing?

Contact me for consulting and support or add me on Linkedin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Email Trigger (IMAP)

Type / Role
n8n-nodes-base.emailReadImap - emailReadImap
Config choices
Version 2

Block 2 - Markdown

Type / Role
n8n-nodes-base.markdown - markdown
Config choices
Version 1

Block 3 - DeepSeek R1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - Send Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 5 - Qdrant Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1

Block 6 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 7 - Email Classifier

Type / Role
@n8n/n8n-nodes-langchain.textClassifier - textClassifier
Config choices
Version 1

Block 8 - Email Summarization Chain

Type / Role
@n8n/n8n-nodes-langchain.chainSummarization - chainSummarization
Config choices
Version 2

Block 9 - Write email

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 10 - Review email

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 11 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 12 - Create collection

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Refresh collection

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Get folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 15 - Download Files

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 16 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 17 - Token Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterTokenSplitter - textSplitterTokenSplitter
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Qdrant Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1

Block 20 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 23 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 24 - DeepSeek

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI-powered email automation for business: Summarize & respond with RAG
Complexity advanced
Nodes 26
Categories Ticket Management, AI RAG
Author Davide
Published 05 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2852/2852.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-powered email automation for business: Summarize & respond with RAG do?

This workflow is ideal for businesses looking to automate their email responses, especially for handling inquiries about company information. It leverages AI to ensure accurate and professional com...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI RAG use case.