AutomationFlowsAI & RAG › Gmail Email Labeling with OpenAI

Gmail Email Labeling with OpenAI

Original n8n title: Basic Automatic Gmail Email Labelling with Openai and Gmail API (gmail Trigger)

ByMartijn Kerver @mkc on n8n.io

This workflow automates email categorization in Gmail using the Gmail API and OpenAI's language model. It periodically checks for new emails, reads their content, and categorizes them based on existing Gmail labels. If no matching label is found, the workflow creates a new label…

Event trigger★★★☆☆ complexityAI-powered13 nodesGmail TriggerOpenAI ChatGmail ToolAgentMemory Buffer Window
AI & RAG Trigger: Event Nodes: 13 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #2740 — we link there as the canonical source.

This workflow follows the Agent → Gmail Tool recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json

  

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates email categorization in Gmail using the Gmail API and OpenAI's language model. It periodically checks for new emails, reads their content, and categorizes them based on existing Gmail labels. If no matching label is found, the workflow creates a new label…

Source: https://n8n.io/workflows/2740/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow automatically transforms your messy inbox into a neatly organized space while ensuring you never miss a critical message. It connects to your Gmail account and triggers for every new ema

Gmail Trigger, Output Parser Structured, Gmail Tool +8
AI & RAG

Basic Automatic Gmail Email Labelling With Openai And Gmail Api. Uses gmailTrigger, lmChatOpenAi, gmailTool, agent. Event-driven trigger; 13 nodes.

Gmail Trigger, OpenAI Chat, Gmail Tool +2
AI & RAG

This workflow is perfect for customer support teams, sales departments, or solopreneurs who receive frequent email enquiries and want to automate the initial response process using AI. If you spend to

Gmail Trigger, OpenAI, OpenAI Chat +4
AI & RAG

Automate your personal productivity with this intelligent n8n workflow that integrates Telegram, Google Sheets, and OpenAI (GPT-4o). This system uses multiple AI agents to manage work hours, tasks, fi

Agent, OpenAI Chat, Telegram +9
AI & RAG

This workflow is the core of a three-part email automation system. It monitors your Gmail inbox in real time, classifies every inbound customer email with AI, retrieves contextually relevant data from

OpenAI Chat, Memory Buffer Window, Agent +5