AI Agents

Classify incoming Gmail messages automatically with AI intelligence

19 nodes 299 166 Automatic trigger
Download

Workflow Description

This automation captures new Gmail messages and classifies them intelligently using OpenAI's language model, enabling smart inbox organization and reducing manual sorting efforts for your team.

How it works

  1. 1.Monitor and trigger on new incoming Gmail messages in real time
  2. 2.Extract message content and prepare it for AI processing
  3. 3.Send messages through an LLM chain to analyze and categorize them
  4. 4.Parse structured classification results from the AI model
  5. 5.Apply categories to emails or export organized data

Use cases

  • Automatically sort emails by priority, topic, or urgency level
  • Separate critical messages from routine notifications and spam
  • Route customer inquiries (complaints, requests, feedback) to appropriate teams

Requirements

  • Active Gmail account with API access enabled
  • OpenAI API key with valid subscription and sufficient credits
  • Pre-defined classification categories tailored to your business needs

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Gmail LLM Chain Output Parser OpenAI

Details

Trigger Automatic trigger
Nodes 19
Apps 4
Views 299
Downloads 166

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (19)

/

Gmail trigger

Gmail

#1

Get message content

Gmail

#2

Set label values

Set

#3

Get all labels

Gmail

#4

Split out assigned labels

Split Out

#5

Merge corresponding labels

Merge

#6

Aggregate label IDs

Aggregate

#7

Add labels to message

Gmail

#8

Assign labels for message

LLM Chain

#9

Sticky Note

Sticky Note

#10

Sticky Note1

Sticky Note

#11

Sticky Note2

Sticky Note

#12

Sticky Note4

Sticky Note

#13

Sticky Note5

Sticky Note

#14

Sticky Note6

Sticky Note

#15

Sticky Note7

Sticky Note

#16

Sticky Note8

Sticky Note

#17

JSON Parser

Output Parser Structured

#18

OpenAI Chat

OpenAI

#19