Triage and label Gmail inbox emails with OpenRouter Gemini 3.5
Ready for 3.0What this workflow does
This workflow has 9 nodes and runs on Gmail events. Along the way it connects Gmail. It also calls openrouter.ai over HTTP.
How it runs
Trigger: On Gmail events.
- Normalize Email Data (Code): runs custom JavaScript code
- Build Classification Request (Code): runs custom JavaScript code
- Classify with OpenRouter (HTTP Request): calls openrouter.ai (POST)
- Verify Classification Output (Code): runs custom JavaScript code
- Fetch Gmail Labels (Gmail): get many (label)
- Determine Category Label (Code): runs custom JavaScript code
- Label Email by Category (Gmail): add labels (message)
- Mark as read (Gmail): remove labels (message)
Services it uses
Other Gmail + OpenRouter templates (135)
HTTP calls to: openrouter.ai
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (4)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow polls your Gmail inbox for unread emails, sends the sender/subject/body to OpenRouter (Gemini) for structured triage, then applies a matching Gmail label and marks the message as read. How it works 1. Polls Gmail every minute for…