๐ŸŽซ Categorize and label incoming Gmail emails automatically with GPT-4o mini

โšก 5,128 views ยท ๐ŸŽซ Ticket Management & Triage

Description

Sort New Gmail messages by category with AI

๐Ÿ‘ฅ Whoโ€™s it for

This workflow is perfect for individuals or teams who receive a high volume of emails ๐Ÿ“ฅ and want to automatically organize them into Gmail labels ๐Ÿท๏ธ using AI. No coding required!

For sorting existing emails messages in your gmail inbox, please use this free workflow: Categorize and Label Existing Gmail Emails Automatically with GPT-4o mini.

๐Ÿค– What it does

It automatically processes new Gmail emails, skips those that already have labels, sends the content to an AI Agent powered by GPT-4o mini ๐Ÿง , and applies a relevant label based on the content. All labels must exist in Gmail beforehand.

โš™๏ธ How it works

  1. ๐Ÿ“ฌ Gmail Trigger โ€“ Activates on new email received.
  2. ๐Ÿšซ Filter โ€“ Skips emails that already have a label.
  3. ๐Ÿง  AI Agent (GPT-4o mini) โ€“ Analyzes the message and decides which label fits best.
  4. ๐Ÿงพ Structured Output Parser โ€“ Formats the AI output into a clean JSON.
  5. ๐Ÿ”€ Switch Node โ€“ Routes each email to the correct label path based on the AI result.
  6. ๐Ÿท๏ธ Gmail Nodes โ€“ Assign the Gmail label to the original email.

๐Ÿ“‹ Requirements

๐Ÿ› ๏ธ How to set up

  1. Open the workflow and adjust the trigger interval (e.g., every minute, hours or Custom using Cron โฑ๏ธ)
  2. Check that the Filter skips emails with existing labels
  3. Define your categories in the AI Agent prompt and make sure they match the Gmail labels
  4. Configure the Switch Node conditions for each category
  5. Ensure each Gmail Label Node applies the correct label
  6. Save and activate the workflow โœ…

๐ŸŽจ How to customize the workflow

๐Ÿ”— Nodes Used

Gmail, Gmail Trigger, Filter, AI Agent, OpenAI Chat Model, Structured Output Parser

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup