Templates / Classify Gmail enquiries with GPT‑4o‑mini and log them to Google Sheets

Classify Gmail enquiries with GPT‑4o‑mini and log them to Google Sheets

Ready for 3.0

by TERA · 4 views · created 2026-08-04 · 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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 6 nodes and runs on Gmail events. Along the way it connects Gmail and Google Sheets. It also calls api.openai.com over HTTP.

How it runs

Trigger: On Gmail events.

  1. Settings (Edit Fields (Set)): sets 2 fields: model, excerpt_length
  2. Filter out machine-generated mail (Code): runs custom JavaScript code
  3. Classify with AI (HTTP Request): calls api.openai.com (POST)
  4. Validate the AI response (Code): runs custom JavaScript code
  5. Log to Google Sheets (Google Sheets): append

Services it uses

GmailGoogle Sheets

HTTP calls to: api.openai.com

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) (Gmail Trigger).

Nodes used (5)

From the author

Quick overview This workflow polls a Gmail inbox, filters out auto-replies and bounce emails, classifies real enquiries with an OpenAI-compatible chat model, validates and sanitizes the AI output, and appends each enquiry as a structured row in Google Sheets.…

Excerpt from TERA'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.