Skip to main content

Smart Gmail Labeling Automation with Text Classifier and GPT-5

Workflow preview

Workflow preview
100%
Smart Gmail Labeling Automation with Text Classifier and GPT-5 preview
Open on n8n.io

Important notice

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

1. Workflow Overview

What this workflow does This workflow automatically organizes your Gmail inbox by fetching recent emails, analyzing their content with AI, and applying the appropriate Gmail labels based on the res...

Best for

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

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.splitinbatches, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.gmail, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.textclassifier

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Smart Gmail Labeling Automation with Text Classifier and GPT-5
Workflow name
Smart Gmail Labeling Automation with Text Classifier and GPT-5

What this workflow does

This workflow automatically organizes your Gmail inbox by fetching recent emails, analyzing their content with AI, and applying the appropriate Gmail labels based on the results.

Step by step:

  1. Schedule Trigger runs the workflow automatically at your chosen interval
  2. Gmail Fetch retrieves the latest emails from your inbox
  3. Loop Over Items processes each email individually
  4. AI Text Classifier analyzes email subject and body content to determine the right category
  5. Add Labels applies the matching Gmail label according to the AI classification
  6. Loop Back continues until all emails are processed and organized

How to set up

  1. Connect your Gmail account to the Gmail nodes for fetching emails and adding labels
  2. Add your OpenAI API key to the OpenAI Chat Model node for AI-powered classification
  3. Configure the schedule trigger to run at your preferred interval (default: every 5 minutes)
  4. Customize email categories in the Label Classifier node based on your organizational needs
  5. Set up Gmail labels that match your classification categories in your Gmail account
  6. Adjust the time range for fetching emails (default: last 5 minutes) and email limit (default: 10)
  7. Test the workflow with a few sample emails to ensure proper classification and labeling
  8. Monitor the workflow execution to verify emails are being processed and labeled correctly

How to customize this workflow to your needs

  • Adjust classification categories: modify the Label Classifier node to include categories like "Work", "Bills", "Social", "Newsletters", or any custom categories you need
  • Change time intervals: customize the schedule trigger to run hourly, daily, or at specific times based on your email volume
  • Add more label actions: create additional Gmail label nodes for more granular categorization (urgent, follow-up, archive, etc.)

Need help customizing?

Contact me for consulting and support:
📧 [email protected]

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 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 3 - OpenAI Chat Model

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

Block 4 - Add Label (High Priority)

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

Block 5 - Add Label (Personal)

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

Block 6 - Add Label (Promotions)

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

Block 7 - Sticky Note

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

Block 8 - Sticky Note1

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

Block 9 - Sticky Note2

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

Block 10 - Sticky Note4

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

Block 11 - Sticky Note5

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

Block 12 - Label Classifier

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

Block 13 - Sticky Note6

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

Block 14 - Gmail - Get Emails

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

Block 15 - Sticky Note7

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

3. Summary Table

Workflow Smart Gmail Labeling Automation with Text Classifier and GPT-5
Complexity advanced
Nodes 15
Categories AI Summarization, Multimodal AI
Author Billy Christi
Published 20 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7633/7633.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 Smart Gmail Labeling Automation with Text Classifier and GPT-5 do?

What this workflow does This workflow automatically organizes your Gmail inbox by fetching recent emails, analyzing their content with AI, and applying the appropriate Gmail labels based on the res...

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.