Skip to main content

✉️ Automated email sorting & drafting for customer support - with AI 🤖

Workflow preview

Workflow preview
100%
✉️ Automated email sorting & drafting for customer support - with AI 🤖 preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Automated Email Sorting & FAQ Reply Assistant (n8n + Gemini AI) Overview This n8n workflow automates email triage and FAQ responses using Google Sheets and Gemini AI . It’s designed to: Autom...

Best for

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

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.splitinbatches, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.googlesheetstool, n8n-nodes-base.stickynote, n8n-nodes-base.markdown, n8n-nodes-base.gmail, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
✉️ Automated email sorting & drafting for customer support - with AI 🤖
Workflow name
✉️ Automated email sorting & drafting for customer support - with AI 🤖

🤖 Automated Email Sorting & FAQ Reply Assistant (n8n + Gemini AI)

🔍 Overview

This n8n workflow automates email triage and FAQ responses using Google Sheets and Gemini AI. It’s designed to:

  • Automatically sort incoming emails into categories (e.g., FAQ, Billing, Tech Support).
  • Draft polite, relevant replies for FAQ emails using AI, grounded in your pre-approved content.
  • Maintain a human-in-the-loop process by saving responses as Gmail drafts for manual review.

Perfect for startups or teams seeking to reduce support workload while ensuring consistent, helpful responses.


⚙️ Pre-conditions / Requirements

Before using this workflow, make sure you have:

  • ✅ A Google account with access to:
    • Gmail (with custom labels like FAQ-Waiting, FAQ-Draft)
    • Google Sheets (used as your FAQ source)
  • ✅ A Gemini API key (to generate AI replies)
  • ✅ A dedicated Gmail label to collect emails needing draft replies (e.g., FAQ-Waiting)
  • ✅ A dedicated Gmail label to store drafted replies for manual sending (e.g., FAQ-Draft)
  • ✅ A Google Sheet with two columns:
    • Question — common user inquiries
    • Answer — the matching, approved reply text

🧠 How It Works

  1. Trigger

    • Scheduled workflow run (e.g., every 15 minutes)
  2. Fetch Emails

    • Grabs Gmail messages under a specific label like FAQ-Waiting
  3. Process & Clean

    • Loops through each email
    • Cleans content (removes signatures/HTML)
    • Sends it to Gemini AI
  4. AI Reply Drafting

    • AI matches email intent against your FAQ from Google Sheets
    • Generates a friendly, accurate draft reply, grounded only in your predefined Q&A
  5. Update Gmail

    • Removes FAQ-Waiting label
    • Adds FAQ-Draft label
    • Saves draft reply in Gmail for manual review and sending
  6. Fallback Routing

    • If email doesn’t match FAQ criteria, it follows a FALSE path
    • You can implement further logic here (e.g., route to Billing, escalate to a human agent, log as feedback)

🛠️ Setup Instructions

  1. Connect Gmail + Google Sheets + Gemini AI

    • Set up credentials in n8n for Gmail, Google Sheets, and Gemini AI
  2. Prepare Labels in Gmail

    • Create: FAQ-Waiting (input folder), FAQ-Draft (drafts ready to send)
    • Optionally, create other labels (e.g., Billing, Tech Support)
  3. Build your FAQ Sheet

    • Create a new Google Sheet with:
      • Column A: Question
      • Column B: Answer
    • Add rows with typical user questions and the matching replies
  4. Configure AI Agent

    • In the AI agent node, edit the prompt to fit your tone of voice (friendly, professional, concise, etc.)
    • Ensure the AI is instructed to only use answers from the sheet, and not hallucinate
  5. Adjust Schedule

    • Modify the trigger interval to match your needs (e.g., every X minutes)

🧩 Customization Tips

  • Custom Prompts: Tailor the Gemini AI prompt in the node to change tone, length, or structure of replies
  • Add New Categories: Use the FALSE path in the IF node to handle non-FAQ emails (e.g., route to Billing, escalate to human agent, log feedback)
  • Multiple Sheets: You can expand the system by using different sheets for different topics
  • Tone Matching: Adjust AI output by providing sample reply templates or tone instructions directly in the AI node

✅ Use Cases

  • SaaS startups triaging customer support
  • Solo founders who want consistent replies with minimal effort
  • Teams managing growing inbox volumes while maintaining quality support

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 - Schedule Trigger

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

Block 2 - Loop Over Items

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

Block 3 - Google Gemini Chat Model

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

Block 4 - Google Sheets

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.5

Block 5 - Sticky Note

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

Block 6 - Schedule Trigger1

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

Block 7 - Loop Over Items1

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

Block 8 - Markdown1

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

Block 9 - Google Gemini Chat Model1

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

Block 10 - Sticky Note1

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

Block 11 - Read inbox messages

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

Block 12 - Html to Markdown

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

Block 13 - Read messages from FAQ Waiting folder

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

Block 14 - Remove from inbox

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

Block 15 - Remove from FAQ Waiting

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

Block 16 - Google Gemini Chat Model2

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

Block 17 - Add Label Inbound

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

Block 18 - Q&A e-mail ?

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

Block 19 - Inbound e-mail ?

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

Block 20 - Remove from inbox 2

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

Block 21 - Add Label FAQ Waiting

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

Block 22 - Add Label FAQ Draft

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

Block 23 - Set E-mail Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Draft reply

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

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

3. Summary Table

Workflow ✉️ Automated email sorting & drafting for customer support - with AI 🤖
Complexity advanced
Nodes 31
Categories Ticket Management, AI RAG
Author Louis
Published 21 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4279/4279.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 ✉️ Automated email sorting & drafting for customer support - with AI 🤖 do?

Automated Email Sorting & FAQ Reply Assistant (n8n + Gemini AI) Overview This n8n workflow automates email triage and FAQ responses using Google Sheets and Gemini AI . It’s designed to: Autom...

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.