# 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 eleven of your own Gmail labels (across the "00 Automated", "00 Human", and "00 Bookkeeping" 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-08-10T14:25:43.668Z
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.
2. For Each Email in Inbox: Repeat this section for each email. Iterate over each email in the inbox. For each email: get full details, determine if the sender is an individual human, conditionally check...
3. Get Full Email Details: Fetch the full details of the current email using email.id as the message ID. Extract and note: the sender email address, sender display name, subject, body content, threadId, and...
4. Determine if Sender is Individual Human: Goal: Determine whether the email sender is an individual human (a real person you might have a conversation with) versus an automated/system/company sender. | Inputs: Sender email address, sender display name, and emai...
5. Is Sender an Individual Human?: Choose one of multiple workflow paths based on the current result.
6. Check If User Previously Emailed This Person: Search for messages the USER previously SENT to this sender. Use the search query: to:{sender_email_address} (this only finds outbound messages from the user to this person). Do N...
7. Skip Prior Correspondence (Automated Sender): Goal: Provide a default result indicating no prior correspondence check was performed because the sender is automated. | Inputs: None needed. | Outputs: Return: prior_correspondence_found=false, in_multi_message_thread=...
8. Merge Correspondence Paths: Merge workflow paths and continue.
9. Classify Email Into Label: Goal: Classify the email into exactly ONE of the eleven defined Gmail labels using priority-ordered rules, incorporating sender type and prior correspondence data. | Inputs: Full email details (sender, subject, body, th...
10. Apply Gmail Label to Email: Apply the label returned by the classify-email prompt to the current email.
11. Archive Email (Remove from Inbox): Archive the current email by removing the INBOX label.
12. Is Label Important?: Choose one of multiple workflow paths based on the current result.
13. Build Gmail Direct Link: Build the direct Gmail deep link: https://mail.google.com/mail/u/0/#all/{messageId}. Output JSON with 'gmail_link' and 'subject'.
14. Send Telegram Important Alert: Send a Telegram message alerting the user to an important email.
15. Hourly Run Summary: Summarize the completed hourly Gmail inbox processing run. Report: total emails processed, how many were assigned to each of the eleven labels, how many Telegram notifications were sent, and confirm all emails archived.

## 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").