Skip to main content

Automatically categorize Gmail messages with GPT-4 mini classification

Workflow preview

Workflow preview
100%
Automatically categorize Gmail messages with GPT-4 mini classification preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

️ Smart Email Classifier Workflow Intelligent AI powered email classification system that automatically sorts incoming Gmail messages into Business, Meetings, Cold Emails, and other categories us...

Best for

  • AI Summarization automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.noop, n8n-nodes-base.gmail, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ilyass Kanissi.

Original n8n.io source

1.1 Workflow description

Title
Automatically categorize Gmail messages with GPT-4 mini classification
Workflow name
Automatically categorize Gmail messages with GPT-4 mini classification

🛠️ Smart Email Classifier Workflow

Intelligent AI-powered email classification system that automatically sorts incoming Gmail messages into Business, Meetings, Cold Emails, and other categories using OpenAI.

⚡ Quick Setup

  1. Import this workflow into your n8n instance
  2. Setup your OpenAI credentials at: OpenAI api key
  3. Configure your Gmail credentials and you're ready to go: Google Cloud Console
  4. Activate the workflow to start automatic email classification

🔧 How it Works

  1. Gmail Trigger: Monitors incoming emails in real-time
  2. Text Classifier: AI-powered categorization using OpenAI Chat Model
  3. Smart Routing: Automatically sorts emails into predefined categories
  4. Gmail Integration: Adds appropriate labels and organizes emails automatically
  5. Fallback Handling: "No Operation" path for unclassifiable emails

Every email gets intelligently sorted into:

🏢 Business

  1. Work-related correspondence
  2. Client communications
  3. Project updates

📅 Meetings

  1. Meeting invitations and requests
  2. Calendar-related emails
  3. Scheduling communications

❄️ Cold Emails

  1. Sales outreach and pitches
  2. Unsolicited business proposals
  3. Marketing communications

🔀 Random

  1. Personal emails
  2. Newsletters
  3. Miscellaneous content

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.3

Block 2 - Text Classifier

Type / Role
@n8n/n8n-nodes-langchain.textClassifier - textClassifier
Config choices
Version 1.1

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 4 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 5 - Business

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 6 - Cold Emails

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 7 - Meetings

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automatically categorize Gmail messages with GPT-4 mini classification
Complexity intermediate
Nodes 8
Categories AI Summarization, Multimodal AI
Author Ilyass Kanissi
Published 19 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7599/7599.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automatically categorize Gmail messages with GPT-4 mini classification do?

️ Smart Email Classifier Workflow Intelligent AI powered email classification system that automatically sorts incoming Gmail messages into Business, Meetings, Cold Emails, and other categories us...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI Summarization, Multimodal AI use case.