# Triage and label Gmail emails with OpenAI: n8n workflow

> Started by an arriving email, and works across Gmail. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/triage-and-label-gmail-emails-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Triage and label Gmail emails with OpenAI

Started by an arriving email, and works across Gmail. It hands the judgement calls to OpenAI. 28 steps, 4 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ftriage-and-label-gmail-emails-with-openai)

**28 steps** Large: read it before trusting it with anything live

**4** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 2 Logic 11 Service 14

The steps in the order they run, from what starts it.

- 1 **Watch unread Gmail emails** Gmail trigger *Starts it*
- 2 **OpenAI model - email classification** Lm Chat Open Ai *Model*
- 3 **Normalize email fields** Code *Logic*
- 4 **Classify email with OpenAI** Agent *Model*
- 5 **Validate AI result & guardrails** Code *Logic*
- 6 **Route by email category** Switch *Logic*
- 7 **Apply category: Urgent** Gmail *Service*
- 8 **Apply category: Client** Gmail *Service*
- 9 **Apply category: Prospect** Gmail *Service*
- 10 **Apply category: Finance** Gmail *Service*
- 11 **Apply category: Admin** Gmail *Service*
- 12 **Apply category: Newsletter** Gmail *Service*
- 13 **Apply category: Spam** Gmail *Service*
- 14 **Apply category: Other** Gmail *Service*
- 15 **Merge category branches** Merge *Logic*
- 16 **Route by priority** Switch *Logic*
- 17 **Apply priority: High** Gmail *Service*
- 18 **Apply priority: Medium** Gmail *Service*
- 19 **Apply priority: Low** Gmail *Service*
- 20 **Merge priority branches** Merge *Logic*
- 21 **Confidence check: review needed?** If *Logic*
- 22 **Apply label: AI review** Gmail *Service*
- 23 **Reply needed?** If *Logic*
- 24 **Merge completion paths** Merge *Logic*
- 25 **Create Gmail reply draft** Gmail *Service*
- 26 **Continue without draft** Set *Logic*
- 27 **Apply label: AI triaged** Gmail *Service*
- 28 **Output triage summary** Set *Logic*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 28, with 4 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 28 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 28 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ftriage-and-label-gmail-emails-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**AI voice & text note-taking with LINE Messaging** 27 steps · calls a model · Gmail, Supabase vectors](https://millionrounds.com/workflow/ai-voice-and-text-note-taking-with-line-messaging)
- [**Email-to-task automation with Outlook and Microsoft To Do** 26 steps · calls a model · Gmail, Google Tasks](https://millionrounds.com/workflow/email-to-task-automation-with-outlook-and-microsoft-to-do)
- [**Flow from Reddit to Gmail with OpenAI** 30 steps · calls a model · Gmail, Reddit](https://millionrounds.com/workflow/flow-from-reddit-to-gmail-with-openai)
- [**Sort and manage your Gmail inbox with Vertex AI** 30 steps · calls a model · Gmail, Google Tasks](https://millionrounds.com/workflow/sort-and-manage-your-gmail-inbox-with-vertex-ai)
- [**AI inbox assistant with OpenAI and Gmail** 25 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/ai-inbox-assistant-with-openai-and-gmail)
- [**Automate Job applications with Gemini and OpenAI** 25 steps · calls a model · Gmail](https://millionrounds.com/workflow/automate-job-applications-with-gemini-and-openai)
