Get Started
Screenshot of n8n workflow
FREE TEMPLATE
Automate Gmail Inbox Triage
0
Views
0
Downloads
19
Nodes
Download Template
Free
Preview Template
Utility Rating
8 / 10
Business Function
Operations
Automation Orchestrator
n8n
Integrations
OpenAI
Gmail
Trigger Type
On app event
Approx setup time ≈ 35 min
Need help setting up this template?
Ask in our free Futurise community
About
Community
Courses
Events
Members
Templates

How to Automate Gmail Inbox Triage?

Leon Petrou
FREE TEMPLATE
Automate Gmail Inbox Triage
0
Views
0
Downloads
19
Nodes
Download Template
Free
Preview Template
Utility Rating
8 / 10
Business Function
Operations
Automation Orchestrator
n8n
Integrations
OpenAI
Gmail
Trigger Type
On app event
Approximate setup time ≈ 35 minutes
Need help setting up this template?
Ask in our free Futurise community

Description

Sort new emails in Gmail with AI and add the right labels without manual work. Great for teams that get many messages and need fast routing for partnership requests, inquiries, and routine notifications.

Here is how it runs end to end. A Gmail trigger watches for new messages on a schedule. The message body is pulled and sent to an AI step that chooses labels from a list you define. The AI output is parsed into clean JSON, then mapped to fields. The flow fetches your Gmail label catalog, matches the AI label names to real label IDs, builds one list of IDs, and applies them back to the email. This creates consistent labeling and a clean inbox with reliable rules.

Setup is simple. Create the same labels in Gmail and in the AI prompt and JSON schema so names match exactly. Connect Gmail and OpenAI credentials in n8n Cloud. Adjust the polling interval to fit your volume. Expect faster triage, less context switching, and fewer missed messages from partners or prospects. Teams in sales ops, marketing ops, or shared inbox owners can use it to route work to the right person in minutes.

Copy link

Tools Required

OpenAI
Sign up
Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens
n8n
Sign up
$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.
Gmail
Sign up
No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Video Tutorial

What this workflow does?

  • Gmail trigger checks for new emails at your chosen interval
  • Get message content pulls the email body using the message ID
  • OpenAI Chat selects the best labels from a list you define
  • Structured JSON parsing turns AI output into clean fields
  • Set node maps and normalizes label names for matching
  • Get all labels fetches Gmail label names and IDs
  • Split Out processes each chosen label separately
  • Merge matches AI label names to real Gmail label IDs
  • Aggregate builds a single array of label IDs for the email
  • Add labels to message applies the labels to the Gmail thread

What are the benefits?

  • Reduce manual sorting from 60 minutes to 5 minutes per day
  • Automate up to 90% of repetitive inbox triage
  • Improve label accuracy by using a fixed approved list
  • Handle 10 times more email volume without extra staff
  • Connect Gmail and OpenAI in one reliable flow

How to set this up?

  1. Import the template into n8n: Create a new workflow in n8n, click the three dots menu, select 'Import from File', then choose the downloaded JSON file
  2. You'll need accounts with Gmail and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, open the Gmail trigger node, choose Credential to connect with, click Create new credential, and follow the on screen steps to connect your Google account using OAuth2
  4. Open the OpenAI Chat node, choose Credential to connect with, click Create new credential, then paste your OpenAI API key from your OpenAI account API page
  5. In your Gmail account, create or confirm the labels you plan to use such as Partnership, Inquiry, and Notification. Use exact names
  6. Open the Assign labels for message chain and edit the system prompt to include your label names and clear selection rules
  7. Open the JSON Parser node and update the JSON schema so the label names and structure match the prompt output exactly
  8. In the Gmail trigger, set the polling interval to Every minute or adjust to match your email volume and API limits
  9. Check the Get message content node and confirm the messageId expression is {{ $json.id }} so the right email is fetched
  10. Save and run once. Send a test email that should map to a known label. Confirm the Add labels to message node completes without errors
  11. If labels are not applied, verify the Merge corresponding labels node has matches. Label names are case sensitive
  12. If the JSON Parser errors, refine the prompt so the AI returns valid JSON that follows the schema

Need help or want to customize this?

Similar Templates

n8n
Operations
Automate Gmail Flight Price Alerts
Get daily flight deal alerts sent straight to your inbox. It watches your route and only emails you when the ticket price is at or below your target. Ideal for travel coordinators, office managers, and anyone booking company trips. Each morning a schedule runs, loads your origin and destination, and fetches airline data from Amadeus to show real carrier names. A code step creates future dates to search, by default 7 and 14 days out. The system loops through each date and calls the Amadeus flight offers API, pausing briefly between calls to respect limits. Results are merged and cleaned, key fields like price, time, duration, and carriers are extracted, and only fares under your price move forward to Gmail for a clear, easy to read alert. Set your airports in the FromTo node, tweak the day offsets in Get Dates, and choose your price target in the Under Price filter. Expect to replace manual checks with one scheduled run and act quickly when good fares show up. Most teams save 20 to 30 minutes a day and avoid missing short lived price drops. Great for controlling travel costs without monitoring sites all day.
6 views
view
n8n
Operations
Automate Gmail to Todoist Task Management
Turn important emails into clear Todoist tasks without copy and paste. The flow watches your Gmail inbox, builds a task when a new or starred email appears, and adds a short summary with next steps and a draft reply. It also closes the task when you remove the star from the email, so your list stays clean. On a schedule or when new mail arrives, it reads unread and starred messages from Gmail. New unread items can be marked as read and starred to show they need action. The flow checks open Todoist tasks and matches them to email subjects. If no match exists, it pulls the full message, sends it to OpenAI to create structured fields content, description, actions, and answer, then creates a Todoist task with that detail. A guard step checks the AI output before creating the task. Another path detects emails that lost the star and closes the linked Todoist task. To run it, connect Gmail, your email IMAP inbox, Todoist, and an OpenAI key. Pick the Todoist project where new tasks should go and adjust the optional read and star actions if you prefer different inbox rules. Teams that triage support or sales email will cut manual entry and miss fewer follow ups, often saving an hour a day.
11 views
view
n8n
Operations
Automate Gmail Spam Cleanup Alerts
Keep your Gmail inbox clean without constant manual sorting. The flow reviews older messages, removes marketing and spam, and sends you quick updates in Telegram. It suits busy teams and solo users who get too much promo mail and want less noise. It runs on demand from n8n. Emails are pulled from Gmail in 14 day chunks using a smart date filter, so large inboxes are handled in manageable windows. Google Gemini scores each email with decimal confidence for unwanted, marketing, and spam, and returns a short reason plus the email ID and sender. If the scores signal unwanted content, the message is deleted and a Telegram alert shows the sender and reason. If it looks safe, a keep label is added in Gmail and you receive a skip notice. AI errors are also posted to Telegram, so you always know what happened. You need Gmail access, a Telegram bot, and a Google Gemini API key. Set your Telegram chat ID and tune the confidence thresholds to match your risk level. Expect weekly inbox cleanup time to drop from hours to minutes while staying in control through clear alerts. You can add a schedule later with a Cron trigger to run this clean up daily.
0 views
view
See More Templates

Credits: YouTube video | YouTube channel | Newsletter - these templates were sourced from publicly available materials across the web, including n8n’s official website, YouTube and public GitHub repositories. We have consolidated and categorized them for easy search and filtering, and supplemented them with links to integrations, step-by-step setup instructions, and personalized support in the Futurise community. Content in this library is provided for education, evaluation and internal use. Users are responsible for checking and complying with the license terms with the author of the templates before commercial use or redistribution. If you are the author and would like this template removed from the template library, email us at info@futurise.com and we will remove it promptly.