Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
An n8n workflow that labels each new Gmail email by topic. An OpenAI model picks any of three labels from your list, and the workflow adds the matching labels in Gmail.
Label new Gmail emails by topic with OpenAI is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
New email in Gmail
It checks Gmail every minute and runs for each new email, with nothing for you to fill in:
The new email carries the labels the AI chose, in your Gmail account
What you need before you start.
Reads each new email and your label list, then adds the chosen labels.
NeedsA Gmail OAuth2 credential and three labels named Partnership, Inquiry and Notification
Language model
Reads the email and picks the labels that fit, on gpt-6-luna.
NeedsAn OpenAI API key
Checked by Mindket on 13 Nov 2026
This n8n workflow puts labels on new Gmail emails by topic. Each time an email arrives, an OpenAI model reads it and picks any of three labels, which are Partnership, Inquiry and Notification. The workflow then adds the matching labels in Gmail. Eleven nodes do the work, beside eight sticky notes.
Small businesses and creators whose inbox mixes partner offers, customer questions and automatic notices. Skip it if you want the AI to reply or to archive mail, since it only adds labels.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Creators | Newsletter writers | Spot sponsorship offers among general mail | A writer sees a sponsorship email labelled Partnership as soon as it arrives. |
| Retail | Shop owners | Separate product questions from the rest | An owner finds a pricing question labelled Inquiry and answers it first. |
| Agencies | Account managers | Keep automatic notices out of the way | A manager sees a delivery notice labelled Notification and leaves it for later. |
| Support | Small support teams | Route mail by topic with Gmail filters | A team builds a Gmail filter on the Inquiry label to forward questions. |
You need a little n8n: import a file, add two credentials and create three labels in Gmail.
Any n8n that can reach Gmail and OpenAI will run it. It works on mail as it arrives, so you do not need to open n8n.
Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Create the three labels in Gmail before you switch the workflow on.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| Gmail | A Gmail OAuth2 credential and three labels named Partnership, Inquiry and Notification |
| OpenAI | An API key, for an OpenAI credential |
workflow.json.Gmail trigger, Get message content, Get all labels and Add labels to message.OpenAI Chat.Gmail trigger, change the polling interval if once a minute is too often.Once it is on, new email is labelled as it arrives. Open Gmail and look for the labels on the new message. One email can get more than one label, and an email that fits none gets no label.
| To change | Where |
|---|---|
| The labels | The names in the prompt of Assign labels for message, the list in JSON Parser and the labels in Gmail |
| What each label means | The prompt of Assign labels for message |
| How often it checks | Poll Times in Gmail trigger |
| Which mail it checks | Filters in Gmail trigger |
| The model | Model in OpenAI Chat |
A shop owner gets an email that asks about bulk prices and mentions a joint promotion. The model reads the text and answers with the labels Inquiry and Partnership.
Gmail returns the list of your labels, the workflow keeps the two ids that match those names, and both labels appear on the email.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one reads an email, asks OpenAI for labels and writes them back. A Gmail label is a tag you can filter on, and one email can carry several.
For experts. The JSON Parser holds a schema that allows only the three label names, and the OpenAI model answers in JSON mode. The Merge corresponding labels node joins your Gmail label list to the chosen names. Unknown names are dropped.
| Node | What it does | What to know |
|---|---|---|
Gmail trigger | Gmail Trigger 1, simple output off, polls every minute | It has no filters, so every new email counts |
Get message content | Gmail 2.1, Get, full message | It gives the chain the plain text of the email |
Assign labels for message | Basic LLM Chain 1.3 with one instruction message | It returns an object with a list of labels |
JSON Parser | Structured Output Parser 1 | The schema allows only Inquiry, Partnership and Notification |
Set label values | Set 3.2, one array field | It keeps the label names as an array |
Merge corresponding labels | Merge 2.1, combine by name | It matches Gmail label names to the chosen names and keeps the Gmail data |
Aggregate label IDs | Aggregate 1 | It gathers the ids into one list |
Add labels to message | Gmail 2.1, Add Labels | It uses the email id from the trigger |
The original named a model that has been retired, and it still needs your own labels.
gpt-4-turbo and gpt-4-1106-preview as shut down on 23 October 2026, with gpt-5.6-sol as the replacement. The original used gpt-4-turbo-preview, so Mindket’s copy uses gpt-6-luna, which is enough for a three-label sort and costs less than gpt-5.6-sol. The model page does not mention temperature, so the original’s temperature of 0 is left outAn n8n workflow that puts labels on new Gmail emails by topic. Each time an email arrives, an OpenAI model reads it and picks any of
three labels. The workflow then adds those labels in Gmail.
workflow.json: the workflow as n8n exports it, eleven working nodes and eight sticky notes. It holds no credential.README.md: these notes.gpt-4-turbo-preview, a model that has been retired. Mindket's copy uses gpt-6-luna in OpenAI Chat andworkflow.json.Gmail trigger, Get message content, Get all labels and Add labels to message.OpenAI Chat.Gmail trigger, change the polling interval if once a minute is too often.Gmail trigger finds a new email, and Get message content reads its text.Assign labels for message asks the OpenAI model which of the three labels fit, and JSON Parser checks the answer.Set label values keeps the chosen names as a list.Get all labels lists your Gmail labels, and Split out assigned labels turns the chosen names into items.Merge corresponding labels matches names to Gmail labels, and Aggregate label IDs gathers their ids.Add labels to message puts those labels on the email.Assign labels for message, the list in JSON Parser and the labels in Gmail.Assign labels for message.Gmail trigger.Gmail trigger.OpenAI Chat.gpt-4-turbo and gpt-4-1106-preview as shut down on 23 Octobergpt-5.6-sol as the replacement. Mindket's copy uses gpt-6-luna, which is enough for a three-label sort. The modelNOTICE.md 637 B README.md 3 KB workflow.json 11 KB
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
zarazhangrui · Skill
Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…
iptv-org · Kit
Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…
uwg · Kit
Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…