# AI Gmail Inbox Classifier & Auto-Archive with Hourly Telegram Alerts

> Automatically organize and clean up your Gmail inbox every hour, hands-free. This AI email automation reads each new message, classifies it into one of seven of your own Gmail labels (across the "00 Automated" and "00 Human" label groups), applies the right label, and archives it out of your inbox — so you reach inbox zero without lifting a finger. The moment a message is tagged Important, you get an instant Telegram alert with a direct link to that email, so urgent messages never slip through. Ideal for busy professionals and teams who want smart email sorting, automated inbox triage, and real-time Telegram notifications for the emails that actually matter.

Content type: workflow
Source URL: https://www.agentpmt.com/agent-workflow-skills/ai-gmail-inbox-classifier-auto-archive-with-hourly-telegram-alerts
Markdown URL: https://www.agentpmt.com/api/agent/workflows/ai-gmail-inbox-classifier-auto-archive-with-hourly-telegram-alerts?format=agent-md
Updated: 2026-06-08T19:03:14.988Z
Author: firef1ie

---

Estimated time saved: 45 minutes.

## Tools

- Gmail - All Email Actions
- Telegram Instant Messenger

## Workflow Outline

1. Fetch All Inbox Messages: Fetch all messages currently in the Gmail INBOX. Return the full list including message IDs, sender, subject, snippet, and any existing labels. This list will be iterated over one...
2. For Each Email in Inbox: Repeat this section for each email. Iterate over each email message fetched from the inbox. Process one email per iteration: get full details, classify it, apply the label, ar...
3. Get Full Email Details: Fetch the full details of the current email using email.id as the message ID. Retrieve sender address, subject line, body snippet, and any existing labels. This data is passed to...
4. Classify Email Into Label: Goal: Classify the email into exactly ONE of the seven defined Gmail labels based on sender, subject, and body content. | Inputs: Full email details from the previous step: sender address, subject line, body snippet, an...
5. Apply Gmail Label to Email: Apply the label returned by the classify-email prompt to the current email. Use Gmail modify_message with the message ID (email.id). Look up or create the label ID for the label n...
6. Archive Email (Remove from Inbox): Archive the current email by removing the INBOX label. Use Gmail modify_message with removeLabelIds: ['INBOX'] and the message ID (email.id). This removes it from the inbox withou...
7. Is Label Important?: Choose one of multiple workflow paths based on the current result.
8. Build Gmail Direct Link: Using the current email message ID (email.id) and the subject from the email details, build the direct Gmail deep link: https://mail.google.com/mail/u/0/#all/{messageId} replacing {messageId} with the actual ID. Output...
9. Send Telegram Important Alert: Send a Telegram message to the user alerting them to an important email. Use send_message. Message format: 'You have an important email! Subject: [subject] | Category: [label] | G...
10. Hourly Run Summary: Summarize the completed hourly Gmail inbox processing run. Report: total emails processed, how many were assigned to each of the seven labels, how many Telegram notifications were sent for important emails, and confirm...

## Frequently Asked Questions

### How do I connect this workflow to my local agent like OpenClaw or Claude Code?

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

### How do I trigger this workflow?

You can use it here in the browser by clicking the 'Try It' button.

If you 'star' the workflow it will save to your dashboard for quick access.

To use the workflow in an external agent, make sure you have followed the steps to connect it to the MCP server and then copy / paste this prompt, or just tell it to use the AgentPMT MCP server and use this workflow.

> Call the AgentPMT-Workflow-Skills tool with action 'get\_workflow\_skill' and skill\_id 6a270f928773e153162b7971 ("AI Gmail Inbox Classifier & Auto-Archive with Hourly Telegram Alerts").