πŸ€– Self Improving Email AI Support with Human-in-the-Loop
    100%
    Automation
    0(0 reviews)
    258 downloads

    πŸ€– Self Improving Email AI Support with Human-in-the-Loop

    NM

    Curated by n8n Markets team

    Last updated: March 8, 2026

    ## How it works This workflow creates a sophisticated, self-improving customer support system that automatically handles incoming emails. It's designed to answer common questions using an AI-powered knowledge base and, crucially, to learn from human experts when new or complex questions arise, continuously expanding its capabilities. Think of it like having an AI assistant with a smart memory and a human mentor. Here's the step-by-step process: 1. New Email Received: The workflow is triggered whenever a new email arrives in your designated support inbox (via Gmail). 2. Classify Request: An AI model (`Google Gemini 2.5 Flash Lite`) first classifies the incoming email to ensure it's a genuine support request, filtering out irrelevant messages. 3. Retrieve Knowledge Base: The workflow fetches all existing Question and Answer pairs from your dedicated Google Sheet knowledge base. 4. AI Answer Attempt: A powerful AI model (`Google Gemini 2.5 Pro`) analyzes the customer's email against the entire knowledge base. It attempts to find a highly relevant answer and drafts a complete HTML email response if successful. 5. Decision Point: An `IF` node checks if the AI found a confident answer. * If Answer Found: The AI-generated HTML response is immediately sent back to the customer via Gmail. * If No Answer Found (Human-in-the-Loop): * Escalate to Human: The customer's summarized question and original email are forwarded to a human expert (you or your team) via Gmail, requesting their assistance. * Human Reply & AI Learning: The workflow waits for the human expert's reply. Once received, another AI model (`Google Gemini 2.5 Flash`) processes both the original customer question and the expert's reply to distill them into a new, generic, and reusable Question/Answer pair. * Update Knowledge Base: This newly created Q&A pair is then automatically added as a new row to your Google Sheet knowledge base, ensuring the system can answer similar questions automatically in the future. ## Set up steps Setup time: ~10-15 minutes This workflow requires connecting your Gmail and Google Sheets accounts, and obtaining a Google AI API key. Follow these steps carefully: 1. Connect Your Gmail Account: * Select the `On New Email Received` node. * Click the Credential dropdown and select `+ Create New Credential` to connect your Gmail account. Grant the necessary permissions. * Repeat this for the `Send AI Answer` and `Ask Human for Help` nodes, selecting the credential you just created. 2. Connect Your Google Sheets Account: * Select the `Get Knowledge Base` node. * Click the Credential dropdown and select `+ Create New Credential` to connect your Google account. Grant the necessary permissions. * Repeat this for the `Add to Knowledge Base` node, selecting the credential you just created. 3. Set up Your Google Sheet Knowledge Base: * Create a new Google Sheet in your Google Drive. * Rename the first sheet (tab) to `QA Database`. * In the first row of `QA Database`, add two column headers: `Question` (in cell A1) and `Answer` (in cell B1). * Go back to the `Get Knowledge Base` node in n8n. In the Document ID field, select your newly created Google Sheet. Do the same for the `Add to Knowledge Base` node. 4. Get Your Google AI API Key (for Gemini Models): * Visit Google AI Studio at [aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey). * Click "Create API key in new project" and copy the key. * In the workflow, go to the `Google Gemini 2.5 Pro` node, click the Credential dropdown, and select `+ Create New Credential`. * Paste your key into the API Key field and Save. * Repeat this for the `Google Gemini 2.5 Flash Lite` and `Google Gemini 2.5 Flash` nodes, selecting the credential you just created. 5. Configure Human Expert Email: * Select the `Ask Human for Help` node. * In the Send To field, replace the placeholder email address with the actual email address of your human expert (e.g., your own email or a team support email). 6. Activate the Workflow: * Once all credentials and configurations are set, activate the workflow using the toggle switch at the top right of your n8n canvas. Start Learning! Send a test email to the Gmail account connected to the `On New Email Received` node. Observe how the AI responds, or how it escalates to your expert email and then learns from the reply. Check your Google Sheet to see new Q&A pairs being added!

    What's Included

    • Complete n8n workflow template with 0 nodes. Ready to import and customize.

    Requirements

    n8n instance (self-hosted or cloud). credentials.

    How to Use

    1. Download the workflow JSON 2. Import into your n8n instance 3. Configure credentials for 4. Activate and enjoy automation

    Apps in this n8n workflow

    How to import this template into n8n

    1. Download the workflow JSON file from this page.
    2. In n8n, open Workflows, create a new workflow and choose Import from File.
    3. Open each node that shows a warning and connect your own credentials.
    4. Run the workflow once manually to check the output before you activate it.
    Included in Pro
    • Importable n8n workflow JSON file
    • Download with Builder Pro or Agency Unlimited
    • Built for n8n v1.0++
    • Setup time: 5-15 min

    Included in Builder Pro β€” $19/mo, 4,177 premium workflows

    Before you activate

    Templates are reviewed before they are listed. Test with your own credentials and data before running it in production.

    Updated Mar 2026
    v1.0
    SSL
    Secure
    GDPR

    100% Secure Checkout

    Refund requests within 7 days of a new subscription

    Reviews

    0

    No reviews yet

    See all 0 reviews ↓
    β€”

    0 reviews

    5β˜…
    0
    4β˜…
    0
    3β˜…
    0
    2β˜…
    0
    1β˜…
    0

    No reviews yet.

    Questions & Answers

    0

    Log in to ask a question.

    No questions yet. Be the first to ask!

    People Also Bought