Templates / Design and apply Gmail label systems with OpenAI and human approval

Design and apply Gmail label systems with OpenAI and human approval

Ready for 3.0

by Mustapha · 34 views · created 2026-08-11 · Document Extraction, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (6)

GmailOpenAI

What it does

Quick overview This workflow samples recent Gmail inbox emails, uses OpenAI to propose a tailored Gmail label system, and requires human approval before creating labels and classifying messages, then applies the chosen label to each email and marks it with an AIReviewed label to avoid reprocessing. How it works 1. Starts from an n8n Form where you choose a sample size and Gmail search window. 2. Fetches a sample of Gmail inbox messages matching the search window and compacts sender, subject, snippet, and existing labels for analysis. 3. Sends the inbox sample to OpenAI to generate a proposed set of Gmail labels with purposes and routing rules. 4. Displays the proposal in a review form where you approve or reject (and optionally edit) the list of label names to create. 5. If approved, creates the selected Gmail labels (ensuring a “Needs Review” label exists) and also creates an “AIReviewed” label for deduplication. 6. Retrieves inbox emails that are not yet marked AIReviewed, asks OpenAI to classify each email using only the approved labels, applies the selected label in Gmail, and then adds AIReviewed. 7. Shows a completion message with the number of emails labeled. Setup 1. Add a Gmail OAuth2 credential with permission to read messages and manage labels, and select it in all Gmail steps. 2. Add an OpenAI credential and select it in both OpenAI steps (label suggestion and per-email classification). 3. Enable n8n Forms, open the “Start setup form” URL, and use it to submit the sample size and search window. 4. (Optional) Adjust the Gmail search query and OpenAI prompts if you want different label naming conventions, fewer/more labels, or a different inbox scope.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.