Label and triage support emails in Gmail with DeepSeek or OpenAI

Go to Workflow
0 views
Built by eason eason
Created on July 24, 2026

Description

Quick overview
This workflow monitors a Gmail inbox, filters out auto-replies and mailing-list noise, classifies each incoming email with DeepSeek (or OpenAI-compatible chat completions), and applies a corresponding Gmail label (order status, product question, refund/complaint, or other) without sending any replies.

How it works
Triggers every 5 minutes when new messages arrive in Gmail.
Checks message headers, sender, and subject to skip auto-replies, mailing lists, and noreply/system senders.
Sends the email subject and body to the DeepSeek chat completions API to classify the intent into one of four categories.
Parses the model’s JSON response and maps the intent to a Gmail label ID.
Adds the mapped label to the original Gmail message to triage the inbox.

Setup
Connect a Gmail OAuth2 credential and ensure the trigger has access to the mailbox you want to monitor.
Create an HTTP Header Auth credential for your AI provider (for example, Authorization: Bearer ) and attach it to the classification request.
Create four Gmail labels (for example, AI/Order, AI/Product, AI/Refund, AI/Other) and update the workflow’s intent-to-label mapping with your label IDs or select them after import.
Optional: If using OpenAI instead of DeepSeek, update the API base URL and model name in the classification request to match your provider.

Nodes Used (3)

Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
HTTP Request
n8n-nodes-base.httpRequest