Templates / 🤖 Self Improving Email AI Support with Human-in-the-Loop

🤖 Self Improving Email AI Support with Human-in-the-Loop

Ready for 3.0

by Lucas Peyrin ✓ · 3,550 views · created 2025-09-20 · Support Chatbot, AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 16 nodes and runs on Gmail events. Along the way it connects Gmail, Google Sheets and Google Gemini Chat Model.

How it runs

Trigger: On Gmail events.

  1. Is it a Support Request? (Text Classifier): classifies text into categories with AI, with model: Gemini Flash Lite Latest
  2. Get Knowledge Base (Google Sheets): uses Google Sheets
  3. Combine into Knowledge Context (Aggregate): combines items into one
  4. Find Answer with AI (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini Flash Latest
  5. Parsed AI Response (Edit Fields (Set)): sets or maps fields
  6. Support Answer Found (If): checks a condition and branches into true / false
  7. Send AI Answer (Gmail): uses Gmail
  8. Ask Human for Help (Gmail): send and wait for a reply
  9. AI: Create Reusable Q&A (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini Flash Latest (1); output parser: Structured Output Parser
  10. Add to Knowledge Base (Google Sheets): append

Services it uses

GmailGoogle SheetsGoogle Gemini Chat Model

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (On New Email Received).

Nodes used (11)

From the author

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…

Excerpt from Lucas Peyrin's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.