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:
Google Gemini 2.5 Flash Lite) first classifies the incoming email to ensure it's a genuine support request, filtering out irrelevant messages.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.IF node checks if the AI found a confident answer.
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.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:
Connect Your Gmail Account:
On New Email Received node.+ Create New Credential to connect your Gmail account. Grant the necessary permissions.Send AI Answer and Ask Human for Help nodes, selecting the credential you just created.Connect Your Google Sheets Account:
Get Knowledge Base node.+ Create New Credential to connect your Google account. Grant the necessary permissions.Add to Knowledge Base node, selecting the credential you just created.Set up Your Google Sheet Knowledge Base:
QA Database.QA Database, add two column headers: Question (in cell A1) and Answer (in cell B1).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.Get Your Google AI API Key (for Gemini Models):
Google Gemini 2.5 Pro node, click the Credential dropdown, and select + Create New Credential.Google Gemini 2.5 Flash Lite and Google Gemini 2.5 Flash nodes, selecting the credential you just created.Configure Human Expert Email:
Ask Human for Help node.Activate the Workflow:
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!