Skip to product information

n8n Gmail Trigger: Auto-Label Emails with Groq Chat Completions

n8n Gmail Trigger: Auto-Label Emails with Groq Chat Completions

 (200+Reviews)
Regular price £14.99
Regular price £14.99 Sale price
SAVE Sold out
Instant Digital Download
Unlimited Downloads
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
23 people viewing
High interest right now
9 added today
Fast-moving digital product
n8n Gmail Trigger: Auto-Label Emails with Groq Chat Completions

n8n Gmail Trigger: Auto-Label Emails with Groq Chat Completions

Regular price £14.99
Regular price £14.99 Sale price
SAVE Sold out

Auto-label every new Gmail email with Groq—without manual sorting

This n8n workflow watches your Gmail Inbox, uses Groq Chat Completions to generate a single category label from each new message, and then automatically creates (if needed) and applies the matching Gmail label to the email. No more manual tagging—your Gmail becomes instantly organized.

What this workflow does

  • Monitors Gmail for new messages: Triggers every minute when a new email arrives in your Inbox (default query: in:inbox).
  • Extracts key email details: Pulls the sender, subject, message/thread IDs, and a shortened body preview for classification.
  • Generates an AI label with Groq: Sends those details to the Groq OpenAI-compatible Chat Completions API and requests a single label in Title_Case_With_Underscores format.
  • Normalizes the label for Gmail safety: Cleans and converts the AI output into a Gmail-safe format.
  • Creates or reuses Gmail labels: Fetches existing Gmail labels, checks whether the predicted label already exists, creates it if it doesn’t, and resolves the final label ID.
  • Applies the label to the message: Attaches the resolved label to the original Gmail email.

Use cases

  • Support teams: Automatically label incoming requests (e.g., “Support_Ticket”, “Billing_Inquiry”) for faster routing.
  • SaaS operators: Tag sales, product, and onboarding emails consistently using Groq-generated categories.
  • Personal productivity: Keep newsletters, notifications, and personal messages sorted with minimal effort.

Technical details

  • n8n Gmail Trigger: Polls every minute for new emails matching in:inbox.
  • Nodes/Components: if, code, gmail, http request, gmail trigger.
  • Groq integration: Uses an HTTP request to call the Groq Chat Completions endpoint (set via your API key credential and model/URL configuration).
  • Gmail permissions: Requires OAuth2 access to read messages and manage labels.

Setup highlights

Connect your Gmail OAuth2 account, configure the Groq API key as an HTTP Header Auth credential, and adjust the Gmail trigger query or polling interval if you want a different mailbox scope or labeling scheme.

View full details