Filter and label Gmail emails using keyword-based rules and Google Sheets logging
Ready for 3.0Ready 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.
- Get a message (Gmail): get
- Extract Email Data (Edit Fields (Set)): sets 5 fields: email_content, sender_email, sender_name…
- Analyze Email Content (Code): runs custom JavaScript code
- Check If Cold Outreach (If): checks a condition and branches into true / false
- Label as Outreach (Gmail): add labels
- Check if Needs_review (If): checks a condition and branches into true / false
- Remove from Inbox (Gmail): remove labels
- Label as Needs Review (Gmail): add labels
- Check if Marketing (If): checks a condition and branches into true / false
- Mark as Read (Gmail): mark as read
…plus 10 more steps. See the full node list below.
Services it uses
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)
- Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail - If
n8n-nodes-base.if - Gmail Trigger
n8n-nodes-base.gmailTrigger - Google Sheets
n8n-nodes-base.googleSheets
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…