Skip to content
agentusehub
Sign in+ Submit
Overnight Gmail Triage with n8n Classification and Draft Replies
OperationsIntermediateAny

Overnight Gmail Triage with n8n Classification and Draft Replies

An n8n flow that watches Gmail, trims quoted history, classifies each message, and drafts a reply so nothing sits overnight.

Jump to setup
Time saved
0h / week
Setup time
Not stated
Running cost
Not stated
Cost range
Under $25/mo

The problem it solves

“Overnight Gmail Triage with n8n Classification and Draft Replies” is an intermediate Operations AI agent workflow from Any. It connects n8n, Gmail and ChatGPT in 5 steps. Setup takes about Not stated and running costs are about Not stated.

Inbound email piles up overnight and gets triaged late. A simple Gmail trigger plus classifier plus draft reply works, but Gmail returns the entire thread, so old quoted replies get treated as new messages and skew classification. The fix is to cut the body below the first quoted-reply marker before classifying, though this approach is fragile and needs a more reliable way to split threads.

How it flows
  1. Gmail trigger
  2. Strip signature and quoted h
  3. Classify message
  4. Draft reply
  5. Review and send

Step-by-step setup

  1. Trigger on new Gmail messages

    Add a Gmail trigger node in n8n set to fire on new inbound mail. Keep the raw thread payload available so you can inspect what the API returns before trimming it.

  2. Trim quoted history and signature

    Before classification, cut the message body below the first quoted-reply marker (the line beginning with On and ending in wrote) and remove the signature block. This prevents old replies in the thread from being read as new content.

  3. Classify the cleaned message

    Send the trimmed body to a classification step that assigns a category and priority. Base the decision only on the cleaned text so quoted history does not distort the result.

  4. Draft a reply

    Generate a draft response for each classified message and save it to the Gmail draft folder. Leave sending to a human review step so nothing goes out unreviewed.

  5. Harden thread splitting

    The quoted-marker cut is fragile across clients and formats. Test against varied senders and consider a more reliable thread-splitting method before relying on this in production.

Example prompts

Build the n8n triage flow
Create an n8n workflow with a Gmail trigger on new inbound messages. For each message, remove the signature block and cut the body below the first quoted-reply marker line that starts with On and ends with wrote. Pass the cleaned body to a classification step that returns a category and priority, then generate a draft reply and save it as a Gmail draft. Do not send automatically. Use [YOUR CATEGORY LIST] for the classification labels and [YOUR TONE GUIDELINES] for the draft style.
Improve thread splitting logic
Review the quoted-history trimming in my n8n Gmail triage flow. The current approach cuts below the first line starting with On and ending with wrote, which is fragile. Propose a more reliable way to isolate only the newest message in a Gmail thread, such as using message IDs or thread metadata, and describe how to implement it in an n8n node. Keep the output as a step-by-step plan with [YOUR N8N VERSION] noted.

Frequently asked questions

What does the “Overnight Gmail Triage with n8n Classification and Draft Replies” workflow do?

An n8n flow that watches Gmail, trims quoted history, classifies each message, and drafts a reply so nothing sits overnight.

Which tools do I need?

You need n8n, Gmail and ChatGPT.

How long does it take to set up?

Plan for about Not stated. It is rated intermediate. The guide walks through 5 steps, starting with “Trigger on new Gmail messages”.

How much does it cost to run?

Expect about Not stated in running costs (Under $25/mo range).

What problem does it solve?

Inbound email piles up overnight and gets triaged late. A simple Gmail trigger plus classifier plus draft reply works, but Gmail returns the entire thread, so old quoted replies get treated as new messages and skew classification. The fix is to cut the body below the first quoted-reply marker before classifying, though this approach is fragile and needs a more reliable way to split threads.

Customer Support · Beginner
  1. Support email
  2. Order-status check
  3. Shopify order lookup

Auto-answer order status emails with live tracking

Spot order-status questions in the support inbox, look up the order in Shopify and reply with live tracking and an honest ETA.

Gmail · Zapier · ChatGPT · Shopify
Sales · Beginner
  1. Form submit
  2. Fetch company site
  3. Claude scores fit

Auto-qualify inbound leads before a rep sees them

Score every demo request against your ICP, update HubSpot and ping the right rep in Slack within a minute of the form submit.

n8n · Claude · HubSpot · Slack
Customer Support · Intermediate
  1. New ticket webhook
  2. Claude classifies
  3. Draft from help docs

Triage support tickets and draft first replies

Every new Zendesk ticket gets a category, priority and sentiment tag plus a draft reply in an internal note before an agent opens it.

Zendesk · n8n · Claude
Add this badge to your site

Built this workflow? Show it is featured on AgentUseHub with a live upvote count that links back here. About badges

Featured on AgentUseHub