Gmail to Telegram, urgent emails surfaced fast
Your inbox probably isn’t “out of control” because you get too many emails. It’s out of control because the important ones look exactly like the noise until you open them, scan them, and decide what to do.
This is where Gmail Telegram alerts help most. Marketing managers miss approval requests, agency owners lose track of client threads, and operations leads get burned by “urgent” messages spotted too late. Same headache, different consequences.
This workflow labels every new email automatically and only pings you when it truly matters, with a short summary sent to Telegram (and WhatsApp too). You’ll see what it does, what you need, and how it fits into a real workday.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Gmail to Telegram, urgent emails surfaced fast
flowchart LR
subgraph sg0["Gmail Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Gmail Trigger1", pos: "b", h: 48 }
n1@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parser1", pos: "b", h: 48 }
n2@{ icon: "mdi:message-outline", form: "rounded", label: "Check Sent2", pos: "b", h: 48 }
n3@{ icon: "mdi:message-outline", form: "rounded", label: "Create Label if Doesn't exist1", pos: "b", h: 48 }
n4@{ icon: "mdi:message-outline", form: "rounded", label: "Get Existing Labels1", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items1", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter1", pos: "b", h: 48 }
n7@{ icon: "mdi:message-outline", form: "rounded", label: "Check Sent3", pos: "b", h: 48 }
n8@{ icon: "mdi:message-outline", form: "rounded", label: "Add label to thread1", pos: "b", h: 48 }
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Code1"]
n10@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If1", pos: "b", h: 48 }
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/whatsapp.svg' width='40' height='40' /></div><br/>Send message1"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send a text message1"]
n13@{ icon: "mdi:brain", form: "rounded", label: "OpenRouter Chat Model2", pos: "b", h: 48 }
n14@{ icon: "mdi:cog", form: "rounded", label: "Wait1", pos: "b", h: 48 }
n15@{ icon: "mdi:robot", form: "rounded", label: "AI Agent3", pos: "b", h: 48 }
n16@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n17@{ icon: "mdi:robot", form: "rounded", label: "AI Agent1", pos: "b", h: 48 }
n18@{ icon: "mdi:brain", form: "rounded", label: "Google Gemini Chat Model2", pos: "b", h: 48 }
n19@{ icon: "mdi:brain", form: "rounded", label: "Google Gemini Chat Model3", pos: "b", h: 48 }
n20@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory1", pos: "b", h: 48 }
n21@{ icon: "mdi:brain", form: "rounded", label: "OpenRouter Chat Model3", pos: "b", h: 48 }
n22@{ icon: "mdi:message-outline", form: "rounded", label: "Get a message1", pos: "b", h: 48 }
n10 --> n12
n10 --> n11
n9 --> n10
n9 --> n14
n14 --> n17
n6 --> n8
n17 --> n9
n15 --> n5
n2 -.-> n15
n7 -.-> n15
n22 --> n15
n0 --> n22
n20 -.-> n17
n5 --> n17
n5 --> n3
n16 -.-> n1
n8 --> n5
n4 --> n6
n13 -.-> n15
n21 -.-> n17
n18 -.-> n15
n19 -.-> n17
n1 -.-> n15
n3 --> n4
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n1,n15,n17 ai
class n13,n16,n18,n19,n21 aiModel
class n20 ai
class n6,n10 decision
class n9 code
classDef customIcon fill:none,stroke:none
class n9,n11,n12 customIcon
The Problem: Urgent Emails Get Buried in “Later”
Most inboxes fail in a predictable way. Your brain becomes the filter. You skim subject lines, open “just in case,” star a few, forget why you starred them, then come back later to a pile that feels heavier than it should. Meanwhile, the truly time-sensitive messages (an OTP, a payment reminder, a security alert, a client escalation) arrive mixed in with newsletters, product updates, and internal FYIs. Miss one at the wrong time and you’re not “behind,” you’re scrambling.
It adds up fast. Here’s where it breaks down in real life.
- You end up checking Gmail more often than you want, because you don’t trust that you’ll spot the critical email in time.
- Manual labeling doesn’t stick, especially when you’re moving fast and replying from your phone.
- Rules and filters help a bit, but they’re brittle when senders change, subjects vary, or the “urgent” clue is inside the email body.
- Important messages get handled late because “I’ll come back to it” turns into “I forgot it existed.”
The Solution: Auto-Label Gmail, Then Alert You Only When It’s Urgent
This n8n workflow watches your Gmail inbox for new mail, then pulls the full email details (subject, sender, body, and headers) so decisions aren’t made on a vague snippet. An AI agent classifies the message into a category you actually recognize, like “Finance,” “Marketing,” or “Dev Tools,” based on rules you define. Next, the workflow makes sure that label exists in Gmail (creating it if needed), finds the correct label ID, and applies it to the email thread automatically.
At the same time, a second AI agent judges urgency (“urgent” vs. “normal”) and writes a tight two-sentence summary. If it’s urgent, you get a Telegram message instantly (and a WhatsApp alert as well). If it’s not urgent, nothing interrupts your day, but your inbox still stays organized in the background.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you receive about 40 emails a day. If you spend even 1 minute scanning each one and deciding “where it belongs,” that’s roughly 40 minutes daily, and urgent stuff can still slip through. With this workflow, you do almost nothing: Gmail triggers the run instantly, labeling happens in the background, and only urgent messages interrupt you with a two-sentence Telegram summary. Realistically, you spend maybe 5 minutes a day reacting to what matters, not rummaging for it.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Gmail for incoming email trigger and labeling.
- Telegram to receive urgent summaries instantly.
- WhatsApp for a second urgent-alert channel.
- LLM access (OpenAI / Gemini / OpenRouter) (get an API key from your chosen provider’s dashboard)
Skill level: Intermediate. You’ll connect accounts, add API keys, and tweak prompts for your categories and urgency rules.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A new email hits your inbox. The Gmail Trigger starts the workflow the moment a message arrives, then a “retrieve email detail” step fetches the full content so the automation has real context.
The email is categorized for labeling. An AI agent reads sender, subject, and body, then outputs a category that maps to your Gmail labels (think “Finance” for invoices, “Dev Tools” for GitHub, and so on).
Labels are created and applied automatically. The workflow checks your existing Gmail labels, creates new ones if they don’t exist, matches the correct label ID, and applies it to the email thread so the whole conversation stays organized.
Urgency is judged, then alerts go out. A second AI agent marks the email as urgent or normal and writes a short two-sentence summary. An If condition only sends Telegram and WhatsApp notifications when it’s truly urgent, so you don’t train yourself to ignore the alerts.
You can easily modify the categories and urgency rules to match your business (for example, treat “client cancellation” as urgent, but “weekly newsletter” as normal). See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Gmail Trigger
This workflow starts when a new Gmail message arrives. Configure polling and connect Gmail access for the trigger.
- Add the Gmail Intake Trigger node and set Poll Times to
everyMinute. - If you need filters, open Gmail Intake Trigger and configure Filters as needed (left empty in this workflow).
- Credential Required: Connect your Gmail OAuth2 credentials in Gmail Intake Trigger.
Step 2: Connect Gmail Data Retrieval & Labeling
After the trigger, the workflow fetches the full message and prepares label management.
- In Retrieve Email Detail, set Operation to
getand Message ID to{{ $json.id }}. - In Apply Label to Thread, set Resource to
thread, Operation toaddLabels, Label IDs to{{ $json.id }}, and Thread ID to{{ $('Retrieve Email Detail').item.json.threadId }}. - In Create Label If Missing, set Resource to
label, Operation tocreate, and Name to{{ $json.output.label }}. - In List Current Labels, set Resource to
labeland Return All totrue. - In Match Label Record, configure the condition to compare Left Value
{{ $json.name }}with Right Value{{ $('Iterate Label Items').item.json.output.label }}. - Credential Required: Connect your Gmail OAuth2 credentials to Retrieve Email Detail, Create Label If Missing, List Current Labels, and Apply Label to Thread.
Step 3: Set Up the Email Classification AI
The label classification uses AI agents, tools, and a structured output parser to choose the correct label ID.
- Open Email Label Classifier and keep Text as
Run the task.with Prompt Type set todefineand Has Output Parser enabled. - Ensure Structured Result Parser has Auto Fix enabled and JSON Schema Example set to
{ "label": "Label name", "label ID": "label ID" }. - Confirm OpenRouter Chat Engine A uses Model
deepseek/deepseek-chat-v3-0324:free. - Ensure Gemini Chat Engine A is connected as a language model for Email Label Classifier.
- Credential Required: Connect your OpenRouter credentials in OpenRouter Chat Engine A.
- Credential Required: Connect your Google Gemini credentials in Gemini Chat Engine A.
- OpenAI Chat Engine is connected as the language model for Structured Result Parser — ensure credentials are added to OpenAI Chat Engine.
- For AI tool/sub-nodes Check Sent Items and Check Label Library, add Gmail credentials on the parent Email Label Classifier node, not on the tool nodes themselves.
Step 4: Configure the Urgency Summary and Delay
This branch summarizes urgency, parses JSON output, and delays before re-checking.
- In Urgency Summary Agent, keep the full prompt text and confirm it references email fields such as
{{ $('Retrieve Email Detail').item.json.subject }}and{{ $('Retrieve Email Detail').item.json.text }}. - In Parse JSON Payload, keep the provided JavaScript that removes code fences and parses JSON safely.
- Set Delay Timer to Amount
15to throttle urgency checks. - Confirm the flow: Urgency Summary Agent → Parse JSON Payload and Parse JSON Payload → Urgency Branch and also → Delay Timer.
- Credential Required: Connect your OpenRouter credentials in OpenRouter Chat Engine B and your Google Gemini credentials in Gemini Chat Engine B for Urgency Summary Agent.
- Session Memory Buffer is attached to Urgency Summary Agent; add credentials to the parent agent if required by your deployment.
Step 5: Configure Urgency Routing and Notifications
If an email is urgent, it triggers notifications in parallel.
- In Urgency Branch, set the condition to compare Left Value
{{ $json.urgency }}with Right Valueurgent. - Configure Send Telegram Alert with Chat ID and set Text to
to :{{ $('Gmail Intake Trigger').first().json.To }}{{ $json.summary }}{{ $('Gmail Intake Trigger').item.json.snippet }}. - Configure Dispatch WhatsApp Alert with Phone Number ID, Recipient Phone Number, and set Text Body to
to :{{ $('Gmail Intake Trigger').first().json.To }}{{ $json.summary }}{{ $('Gmail Intake Trigger').item.json.snippet }}. - Urgency Branch outputs to both Send Telegram Alert and Dispatch WhatsApp Alert in parallel.
- Credential Required: Connect your Telegram Bot credentials in Send Telegram Alert.
- Credential Required: Connect your WhatsApp Business credentials in Dispatch WhatsApp Alert.
Step 6: Validate Label Iteration and Branching Logic
Ensure label creation and matching loop correctly around the classification output.
- Check that Email Label Classifier outputs to Iterate Label Items.
- Confirm Iterate Label Items branches to both Urgency Summary Agent and Create Label If Missing.
- Ensure Create Label If Missing → List Current Labels → Match Label Record → Apply Label to Thread → Iterate Label Items to complete the labeling loop.
Step 7: Test and Activate Your Workflow
Run a manual test to verify labeling and urgent alerts before activating in production.
- Click Execute Workflow and send a test email to the monitored Gmail inbox.
- Verify that Retrieve Email Detail pulls the full message and Email Label Classifier outputs a label ID.
- Confirm the thread is labeled by Apply Label to Thread and that the label appears in Gmail.
- Send a clearly urgent email to confirm Urgency Branch triggers both Send Telegram Alert and Dispatch WhatsApp Alert in parallel.
- Once validated, toggle the workflow to Active for continuous processing.
Common Gotchas
- Gmail credentials can expire or need specific permissions. If things break, check the connected Gmail account in n8n’s Credentials area first.
- If you’re using Wait nodes or external processing, timing can be inconsistent. If downstream steps fail with missing fields, increase the Delay Timer so the AI output is ready before parsing.
- AI prompts that are too generic create sloppy labels and noisy urgency flags. Update the Email Label Classifier and Urgency Summary Agent prompts with your real categories, real examples, and a clear definition of “urgent.”
Frequently Asked Questions
About 30 minutes if you already have your accounts and API key ready.
No. You’ll mainly connect Gmail and Telegram, then adjust a couple of prompts and conditions.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in LLM API usage, which is usually just a few dollars a month at typical inbox volumes.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the prompt inside the Email Label Classifier agent to match your real labels (like “Clients,” “Billing,” “Hiring”), then tune the Urgency Summary Agent to define what “urgent” means for you. Common tweaks include treating OTP/security emails as always urgent, ignoring newsletters completely, and flagging certain senders (your bank, payment processor, top clients) as higher priority.
Most of the time it’s expired or revoked Google permissions, so re-authenticate the Gmail credential in n8n. Also check that the Gmail account you connected is the one receiving the emails (sounds obvious, but it happens). If labeling fails specifically, make sure the workflow is allowed to manage labels and modify threads, not just read messages.
A typical small-business inbox volume is fine, and self-hosting can scale as far as your server can handle.
Often, yes, because this workflow has two AI decisions, label management, and branching logic that can get expensive or awkward elsewhere. n8n also lets you self-host, which matters when you want high volume without worrying about task pricing. Zapier or Make can still be a good fit if you only want a simple “urgent email → send message” rule and nothing else. The moment you want category labels created dynamically, it gets messy. Talk to an automation expert if you want help picking the simplest option.
Your inbox gets organized automatically, and the truly urgent stuff finds you. Honestly, that’s the whole point.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.