Classify Gmail support emails with AI and store tickets in PostgreSQL
Ready for 3.0Ready 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.
Nodes used (7)
- Gmail
n8n-nodes-base.gmail - Text Classifier
@n8n/n8n-nodes-langchain.textClassifier - Ollama Model
@n8n/n8n-nodes-langchain.lmOllama - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - No Operation, do nothing
n8n-nodes-base.noOp - Gmail Trigger
n8n-nodes-base.gmailTrigger
What it does
This workflow automatically converts incoming Gmail messages into structured support tickets using AI classification. It assigns categories, generates a unique ticket ID, stores data in PostgreSQL, assigns a support agent based on workload, and sends an automated email reply to the customer. ⚙️ How it works Fetch email from Gmail AI classifies ticket (Payment, Login, Fraud, etc.) Generates unique ticket ID Stores ticket in PostgreSQL Assigns available support agent Logs assignment Sends email confirmation to customer 📦 Requirements 1. n8n (latest version) 2. Gmail OAuth2 credentials 3. PostgreSQL database 4. AI model (Ollama or compatible LLM) 5. Support tables: 6. tickets 7. supportpersons 8. ticketassignmentlogs