Automatic Gmail Message Categorization with GPT-4 Content Analysis & Labels

Nodes

673985d5-a68a-465a-8e1d-075bfbab0975b731c813-b526-4eb2-be63-9c3245ed6915083a55c9-df56-4154-959f-52737890cad0767a4dc9-a96d-4faf-8994-3ca756304676+2

Created by

HeHenry

Last edited 10 days ago

Who is this for?

This workflow is ideal for Gmail users and teams who receive a high volume of emails and want to streamline inbox management. It suits professionals seeking to organize messages automatically, including sales teams, project managers, support staff, and anyone who benefits from automated email categorization.

What problem is this workflow solving? / Use case

Manually labeling emails is time-consuming and can lead to inconsistent organization. This automated n8n workflow uses Gmail and OpenAI to analyze incoming messages and apply the appropriate labels, such as "Quotation", "Inquiry", "Project progress", and "Notification", based on content—improving productivity and ensuring important messages are prioritized.

What this workflow does

The workflow retrieves new Gmail messages, analyzes their content with OpenAI, and automatically assigns pre-defined Gmail labels that match the email’s intent. This ensures emails are sorted efficiently using AI-powered content analysis and Gmail’s labeling system.

Setup

  • Ensure Gmail labels (e.g., "Quotation", "Inquiry") are created in your Gmail account.
  • Connect your Gmail and OpenAI accounts as credentials in n8n.
  • Import the workflow into your n8n instance and update node configurations to match your Gmail label names.

How to customize this workflow to your needs

  • Edit or add Gmail labels both in your Gmail account and within the workflow logic.
  • Adjust the prompt or parameters sent to OpenAI to better match your categorization style.
  • Expand or refine the list of label categories to fit your team’s or business’s requirements.

New to n8n?

Need help building new n8n workflows? Process automation for you or your company will save you time and money, and it's completely free!