Categorize and label existing Gmail emails automatically with GPT-4o mini
Categorize and Label Existing Gmail Emails Automatically with GPT-4o mini ๐ฅ Who's it for This workflow is perfect for individuals or teams who want to sort and label existing emails in their Gmail inbox ๐๏ธ using AI. Ideal for cleaning up unlabeled emails in bulk โ no coding required! For sorting incoming emails messages in your gmail inbox, please use this free workflow: [Categorize and Label Incoming Gmail Emails Automatically with GPT-4o mini](
At a glance
Categorize and label existing Gmail emails automatically with GPT-4o mini is a ready-made n8n workflow you import as a workflow JSON file โ no build required. It connects Gmail, OpenAI. It's free to download. Follow the 5-step import below to go live in minutes.
- Platform
- n8n
- Connects
- Gmail, OpenAI
- Modules
- 14
- Price
- Free
- Version
- v1.0

About this workflow
Categorize and Label Existing Gmail Emails Automatically with GPT-4o mini ๐ฅ Who's it for This workflow is perfect for individuals or teams who want to sort and label existing emails in their Gmail inbox ๐๏ธ using AI. Ideal for cleaning up unlabeled emails in bulk โ no coding required! For sorting incoming emails messages in your gmail inbox, please use this free workflow: Categorize and Label Incoming Gmail Emails Automatically with GPT-4o mini ๐ค What it does It manually processes a selected number of existing Gmail emails, skips those that already have labels, sends the content to an AI Agent powered by GPT-4o mini ๐ง , and applies a relevant Gmail label based on the email content. All labels must already exist in Gmail. โ๏ธ How it works โถ๏ธ Manual Trigger โ The workflow starts manually when you click "Execute Workflow". ๐ฅ Gmail Get Many Messages โ Pulls a batch of existing inbox emails (default: 50). ๐ซ Filter โ Skips emails that already have one or more labels. ๐ง AI Agent (GPT-4o mini) โ Analyzes the content and assigns a category. ๐งพ Structured Output Parser โ Converts the AI output into structured JSON. ๐ Switch Node โ Routes each email to the right label based on the AI result. ๐ท๏ธ Gmail Nodes โ Apply the correct Gmail label to the email. ๐ Requirements Gmail account connected to n8n Gmail labels must be manually created in your inbox beforehand Labels must exactly match the category names defined in the AI prompt OpenAI credentials with GPT-4o mini access n8n's AI Agent & Structured Output Parser nodes ๐ ๏ธ How to set up In your Gmail account, create all the labels you want to use for categorizing emails Open the workflow and adjust the email fetch limit in the Gmail node (e.g., 50, 100) Confirm that the Filter skips emails that already have labels Define your categories in the AI Agent prompt โ these must match the Gmail labels exactly In the Switch Node, create a condition for each label/category Ensure each Gmail Label Node applies the correct existing label Save the workflow and run it manually whenever you want to organize your inbox โ ๐จ How to customize the workflow Add or remove categories in the AI prompt & Switch Node Adjust the batch size of emails to process more or fewer per run Fine-tune the AI prompt to suit your inbox type (e.g., work, personal, client support)
How to import this n8n workflow
- 1
Download the workflow JSON file after purchase.
- 2
Open n8n โ click the menu โ Import from File.
- 3
Select the downloaded JSON and import.
- 4
Set up credentials for each node that requires them.
- 5
Click Execute Workflow to test, then activate.
Setup guide
Setup guide included
Purchase to unlock the full step-by-step guide
Related N8n workflows
Send data to Google Sheets after processing HTML with ChatGPT
AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase
Create calendar events from custom webhooks using ChatGPT
Evaluate hybrid search for legal question-answering using Qdrant & BM25/mxbai
Send Gmail messages with custom aliases and attachments via API
๐ง Flowatch ๐๏ธ analyze and diagnose n8n workflow errors via OpenAI and email
Evaluation metric example: Check if tool was called
Find competitor keyword gaps and log opportunities to Notion with DataForSEO
Reviews
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
- JSON blueprint โ instant download
- Setup guide PDF included
- 5 downloads ยท valid 30 days
- Works with n8n
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.
- Configure live on Google Meet / Zoom
- Free follow-up if workflow has defects
- Platform expert assigned to you