Skip to main content

Automate email responses with GPT-4o-mini and human review in Gmail

Workflow preview

Workflow preview
100%
Automate email responses with GPT-4o-mini and human review in Gmail 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 n8n template demonstrates a “Human in the Loop” workflow where AI automatically drafts replies to inbound emails, which are then reviewed and approved by a human before being sent. This powerf...

Best for

  • Lead Nurturing automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.if, n8n-nodes-base.gmailtrigger, n8n-nodes-base.noop, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.outputparserstructured

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate email responses with GPT-4o-mini and human review in Gmail
Workflow name
Automate email responses with GPT-4o-mini and human review in Gmail

This n8n template demonstrates a “Human-in-the-Loop” workflow where AI automatically drafts replies to inbound emails, which are then reviewed and approved by a human before being sent. This powerful pattern ensures both the efficiency of AI and the quality assurance of human oversight.

Use cases are many: Streamline sales inquiry responses, manage first-level customer support, handle initial recruitment communications, or any business process that requires personalized yet consistent email replies.

Good to know

  • At the time of writing, the cost per execution depends on your OpenAI API usage. This workflow uses a cost-effective model like gpt-4o-mini. See OpenAI Pricing for updated info.
  • The AI’s knowledge base and persona are fully customizable within the Basic LLM Chain node’s prompt.

How it works

  1. The Gmail Trigger node starts the workflow whenever a new email arrives in the specified inbox.
  2. The Classify Potential Leads node uses AI to determine if the incoming email is a potential lead. If not, the workflow stops.
  3. The Basic LLM Chain, powered by an OpenAI Chat Model, generates a draft reply based on a detailed system prompt and your internal knowledge base.
  4. A Structured Output Parser is crucially used to force the AI’s output into a reliable JSON format ({"subject": "...", "body": "..."}), preventing errors in subsequent steps.
  5. The Send for Review Gmail node sends the AI-generated draft to a human reviewer and pauses the workflow, waiting for a reply.
  6. The IF node checks the reviewer’s reply for approval keywords (e.g., “approve”, “承認”).
  7. If approved, the ✅ Send to Customer Gmail node sends the final email to the original customer.
  8. If not approved, the reviewer’s feedback is treated as a revision request, and the workflow loops back to the Basic LLM Chain to generate a new draft incorporating the feedback.

How to use

  • Gmail Trigger node: Configure with your own Gmail account credentials.
  • Send for Review node: Replace the placeholder email [email protected] with the actual reviewer's email address.
  • IF node: You can customize the approval keywords to match your team’s vocabulary.
  • OpenAI Nodes: Ensure your OpenAI credentials are set up. You can select a different model if needed, but the prompt is optimized for models like GPT-4o mini.

Requirements

  • An OpenAI account for the LLM.
  • A Gmail account for receiving customer emails and for the review process.

Customising this workflow

  • By modifying the prompt and knowledge base in the Basic LLM Chain, you can adapt this agent for various departments, such as technical support, HR, or public relations.
  • The approval channel is not limited to Gmail. You can easily replace the review nodes with Slack or Microsoft Teams nodes to fit your internal communication tools.

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 - Send for Review

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

Block 2 - ✅ Send to Customer

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

Block 3 - IF Approved?

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

Block 4 - Gmail Trigger1

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 5 - No Operation, do nothing1

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

Block 6 - OpenAI Chat Model (for Classifier)

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

Block 7 - Classify Potential Leads

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

Block 8 - Basic LLM Chain

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

Block 9 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 10 - OpenAI Chat Model (for LLM Chain)

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

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note2

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

Block 14 - Sticky Note3

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

3. Summary Table

Workflow Automate email responses with GPT-4o-mini and human review in Gmail
Complexity intermediate
Nodes 14
Categories Lead Nurturing, AI Chatbot
Author Yusuke Yamamoto
Published 13 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9557/9557.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 Automate email responses with GPT-4o-mini and human review in Gmail do?

This n8n template demonstrates a “Human in the Loop” workflow where AI automatically drafts replies to inbound emails, which are then reviewed and approved by a human before being sent. This powerf...

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 Lead Nurturing, AI Chatbot use case.