This intelligent agent handles customer email support end-to-end:
✉️ 1. Gmail Trigger
Detects new incoming emails using the Gmail Trigger node.
🧠 2. AI Agent with Fallback
Gemini is used first for fast, low-cost responses.
If Gemini fails or is unsure, GPT (OpenAI) takes over via fallback.
🤖 3. Text Classification & Analysis
The AI classifies the request type (e.g. Billing, Technical, Complaint).
It extracts urgency and key details from the email body.
🪄 4. Auto-Reply to Customer
A personalized, professional email is sent back to the customer based on the classification and extracted info.
📊 5. Google Sheets Logging
Each email is logged in a Google Sheet: email, subject, category, urgency, status, follow-up needs, etc.
🧩 1. Prerequisites
Gmail account with OAuth2 connected in n8n
Google Sheets OAuth2 set up in n8n
OpenAI + Gemini API keys
Your Google Sheet with headers (see below)
📁 2. Prepare Google Sheet
Create a new Google Sheet with at least these headers (in row 1):
customer_name | email address | Service type | phone number | Subject | Request Type | Priority Level | Issue Summary | Status | Response Sent | Follow-up Required | Agent Notes
🔗 Copy the Google Sheet URL and enable link sharing (for the workflow to access it)
🔗 3. Import and Connect the Workflow in n8n
Import the JSON file (Build your first email agent with fall back model)
Connect all required credentials:
Gmail
Google Sheets
Gemini API
OpenAI API
🛠 4. Configure Google Sheets Node
In the node named “Append or update row in sheet in Google Sheets”:
Update the Google Sheet Document ID and sheet name to match your Sheet.
Ensure column mappings match the headers exactly.
🧩 Customization Guide
✍️ Modify System Prompt (Text Classifier)
In the AI Agent node:
The system prompt defines how the AI classifies messages (e.g. by Request Type, Urgency).
You can adjust this section:
🧬 Add More Classifiers
If you want to tag emails by industry, region, or language:
Extend the prompt with more extraction rules.
Example:
Also extract:
Hi [Customer Name],
Thank you for reaching out to us...
Customize with your own brand voice or sign-off (e.g. from David @ DaexAI).
🧠 Bonus Ideas
📥 Add Form-Based Intake
Use n8n’s webhook or Typeform trigger to collect structured support requests and route through the same AI agent.
🔁 Add Status Update Flows
Create workflows that follow up after X days if Status ≠ Resolved.