AI-Powered Human-in-the-Loop Email Response System - n8n Workflow

Use this powerful n8n workflow to automate incoming email responses using AI summarization and drafting, ensuring quality control via a human approval step (Human-in-the-Loop).

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Business owners or support teams receiving high volumes of emails who need fast, consistent replies.
Users deploying advanced AI integrations (LangChain, OpenAI) within their operational flow.
n8n experts looking for robust examples of 'Human in the Loop' processes.
Professionals who require speed from automation but demand ultimate quality control.

Overview

Maintaining high-quality customer service while speeding up response times is a constant challenge. This sophisticated n8n workflow leverages the power of Large Language Models (LLMs) to automatically summarize incoming emails and draft professional, concise replies. However, unlike fully automated systems, this n8n templates solution incorporates a critical human-in-the-loop validation step.

This ensures that every response sent out is reviewed and approved by a human before delivery, guaranteeing brand consistency and accuracy. This specific n8n workflow uses the Email Trigger n8n node (IMAP) to initiate the process, demonstrating a powerful way to manage email volume without sacrificing oversight. It is an excellent demonstration of an advanced, reliable n8n node implementation.

How it Works

This automation sequence starts with a trigger and moves through AI processing, validation, and final execution:


  1. Trigger and Ingest: The n8n workflow starts using the Email Trigger (IMAP) n8n node, which actively monitors a specified mailbox for new incoming emails.

  2. Preprocessing: The incoming email (HTML content) is passed to a Markdown n8n node to convert the formatting, ensuring the text is clean and easily digestible for the subsequent AI models.

  3. Summarization: The Email Summarization Chain (a LangChain n8n node) processes the converted text, creating a concise summary (max 100 words). This step uses the DeepSeek Chat Model via an n8n connection.

  4. Draft Generation: The Write email Agent n8n node uses the summarized content (or the original context) and a prompt defining its role as an 'expert email answerer' to draft a professional reply, also constrained to 100 words. This agent connects to the gpt-4o-mini model.

  5. Set Variable: The Set Email text n8n node captures the AI-generated draft response, preparing it for the approval step.

  6. Human in the Loop Approval: The crucial Approve Email n8n node uses the sendAndWait feature. It sends an email containing both the original message and the AI draft to a reviewer ([email protected]). The n8n workflow pauses here, waiting for the human to approve or reject the response via a unique webhook URL.

  7. Conditional Send: The Approved? If n8n node checks the human feedback. If the $json.data.approved flag is true, the Send Email n8n node executes, sending the professionally crafted reply back to the original sender. If rejected, the n8n workflow stops, allowing manual intervention.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance via the 'Import from JSON' function.

  2. IMAP/SMTP Credentials: You need to configure credentials for the email operations.

Set up IMAP credentials for the Email Trigger (IMAP) n8n trigger (where incoming emails are received).
Set up SMTP credentials for the Approve Email and Send Email n8n nodes (for sending outbound emails).

  1. AI Credentials: This n8n template uses two different AI services/models for distinct tasks (DeepSeek for summarization, OpenAI for drafting).

Configure your OpenAI API Key for the OpenAI credential.
Configure the API Key for the DeepSeek model (if applicable) for the OpenAI Chat Model credential connected to the summarization step.

  1. Review Approver Email: Update the toEmail field in the Approve Email n8n node to your personal or team email address that handles approvals.

  2. Activate: Enable the n8n workflow to start monitoring your inbox.

Node Details

Email Trigger (IMAP): The initial n8n trigger. It monitors a mailbox defined by IMAP credentials, starting the n8n workflow upon receiving a new email.
Markdown: Converts the email's HTML body into standardized Markdown format, improving the quality of input for the subsequent LLM n8n nodes.
Email Summarization Chain (LangChain): Function: Summarizes the lengthy email content into a maximum of 100 words. Key Configuration: Uses deepseek-chat model connection; custom prompt set to 'Write a concise summary of the following in max 100 words.'
Write email (LangChain Agent): Function: Generates the reply draft based on the summarized email. Key Configuration: Uses gpt-4o-mini model; System Message defines it as 'an expert at answering emails' and enforces a 100-word limit and a professional, business tone. This is a core part of the n8n templates intelligence.
Approve Email (Email Send): Function: Acts as the 'Human in the Loop' gate. It sends the original email and the AI draft to a reviewer, pausing the n8n workflow using the operation: sendAndWait feature until a decision is made.
Approved? (If): Function: A flow control n8n node that checks the boolean output (approved) from the human reviewer. If true, the generated response is sent.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*