Triage and label inbound emails in Gmail or IMAP with rule-based scoring
Ready for 3.0What this workflow does
This workflow has 30 nodes and runs on Gmail events. Along the way it connects Gmail. It also calls gmail.googleapis.com over HTTP.
How it runs
Trigger: On Gmail events.
- Configure Gmail Triage (Code): runs custom JavaScript code
- Fetch Full Gmail Message (HTTP Request): calls an HTTP API
- Attach Gmail Context (Code): runs custom JavaScript code
- Configure Label Rules (Code): runs custom JavaScript code
- Normalize Gmail Message (Code): runs custom JavaScript code
- Validate Email and Rules (Code): runs custom JavaScript code
- Classify with Weighted Rules (Code): runs custom JavaScript code
- Protect OTP and Critical Alerts (Code): runs custom JavaScript code
- Build Gmail Action Plan (Code): runs custom JavaScript code
- Decide Next Action (Switch): routes items into 2 branches
…plus 19 more steps. See the full node list below.
Services it uses
HTTP calls to: gmail.googleapis.com
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) (Watch Gmail Messages).
Nodes used (5)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - If
n8n-nodes-base.if
From the author
Quick overview This workflow deterministically classifies inbound emails using local JavaScript rules (no AI) and routes them into high-priority, low-priority bulk, or general inbox actions, producing prepared outputs you can connect to Gmail or IMAP…