GenAiHub

Last checked 14 November 2026 — responded normally.

Classify and label new Gmail messages with OpenAI GPT-4o-mini

Quick overview

Live
Open / InstallLast updated November 14, 2026

Description

Quick overview This workflow triggers on new Gmail messages, sends key email details to OpenAI for classification, parses the JSON result, and applies a matching Gmail label to each email based on the predicted category. How it works Triggers every minute when a new email arrives in Gmail. Sets the OpenAI model, a classification prompt, and a mapping of categories to Gmail label IDs. Calls the OpenAI Chat Completions API with the email subject, sender, and a truncated body to classify the message. Parses the JSON response to extract category, urgency, and a short summary, defaulting to “noise” if parsing fails. Adds the corresponding Gmail label to the original email message based on the returned category. Setup Connect your Gmail account credentials for both the Gmail trigger and the Gmail label action. Add an OpenAI API key using HTTP Header Auth for the OpenAI Chat Completions request. Create the target labels in Gmail, copy their label IDs, and replace the placeholder values in the category-to-label mapping. Additional info This is the lite version. A fuller build adds a Google Sheets log of every email, AI-drafted replies to new enquiries, and instant alerts when something urgent lands, along with a step by step setup guide. Available at baynhams.gumroad.com/l/inbox-triage. An n8n automation workflow template by Jon Baynham.

Community Metrics

Views
0
Avg Rating
N/A
Ratings
0
Likes
0
Comments
—

Author

Jon Baynham

Platform

web

Pricing model

free

Categories

  • Automation

Tags

  • n8n
  • workflow
  • http-request
  • gmail
  • code

Capabilities

  • 3 nodes

Information

TypeWorkflow
Sourcen8n
AddedSeptember 11, 2026

Comments

?

Others in the same category, ranked by how often they are opened.