Templates / Filter and label Gmail emails using keyword-based rules and Google Sheets logging

Filter and label Gmail emails using keyword-based rules and Google Sheets logging

Ready for 3.0

by Cole Hallgarth · 588 views · created 2026-03-05 · Ticket Management, 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.

What this workflow does

This workflow has 21 nodes and runs on Gmail events. Along the way it connects Gmail and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Get a message (Gmail): get
  2. Extract Email Data (Edit Fields (Set)): sets 5 fields: email_content, sender_email, sender_name…
  3. Analyze Email Content (Code): runs custom JavaScript code
  4. Check If Cold Outreach (If): checks a condition and branches into true / false
  5. Label as Outreach (Gmail): add labels
  6. Check if Needs_review (If): checks a condition and branches into true / false
  7. Remove from Inbox (Gmail): remove labels
  8. Label as Needs Review (Gmail): add labels
  9. Check if Marketing (If): checks a condition and branches into true / false
  10. Mark as Read (Gmail): mark as read

…plus 10 more steps. See the full node list below.

Services it uses

GmailGoogle Sheets

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).

Nodes used (6)

From the author

This workflow automatically filters and organizes incoming Gmail emails using keyword-based classification. The goal is to reduce inbox noise and automatically organize repetitive types of emails so that imprtant messages remain visible while unsolicited or…

Excerpt from Cole Hallgarth's description on n8n.io.

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.