Templates / Classify Gmail support emails with AI and store tickets in PostgreSQL

Classify Gmail support emails with AI and store tickets in PostgreSQL

Ready for 3.0

by Jyothish S L ✓ · 34 views · created 2026-05-07 · Ticket Management, AI Summarization

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, Ollama Model and Postgres.

How it runs

Trigger: On Gmail events.

  1. Get many messages (Gmail): get many
  2. Text Classifier: classifies text into categories with AI, with model: Ollama Model
  3. Code: runs custom JavaScript code
  4. Code: runs custom JavaScript code
  5. Code: runs custom JavaScript code
  6. Code: runs custom JavaScript code
  7. Code: runs custom JavaScript code
  8. Code: runs custom JavaScript code
  9. Select rows from a table (Postgres): select
  10. Insert rows in a table (Postgres): uses Postgres

…plus 3 more steps. See the full node list below.

Services it uses

GmailOllama ModelPostgres

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.

Nodes used (7)

From the author

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…

Excerpt from Jyothish S L'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.