Since Gmail inboxes can quickly become cluttered, this workflow provides an automated AI-based email classification system. It listens for new emails, categorizes them using an AI classifier, applies Gmail labels, and sends you a Telegram notification with a quick summary.
If you often miss urgent client messages or struggle with sorting work vs. promotions, this workflow ensures you never overlook important emails.
Use case: Especially useful for professionals who receive a high volume of mixed emails (clients, work, promotions). The workflow automatically labels and notifies you of new emails based on their category.
Trigger Input
from
, subject
, body
) is passed downstream.Example JSON input:
{
"from": "[email protected]",
"subject": "Urgent project deadline",
"text": "Please review the attached contract ASAP"
}
Classify Email (AI)
The Classification Agent (powered by OpenAI via LangChain) receives the email data.
It sorts the email into one of four categories:
The classifier uses a system prompt to ensure output is returned in JSON format for downstream processing.
Apply Gmail Labels
Based on classification, the workflow applies the corresponding Gmail label:
Each label must already exist in Gmail for the operation to work.
Generate Notification
The AI Agent (notification assistant) takes the classified email and rewrites it into a short, casual notification.
Example notification:
[High Priority] New email from [email protected]
Subject: Urgent project deadline
"Please review the attached contract ASAP"
Send to Telegram
High Priority
, Work Related
, Promotions
.chatId
into the node.Work
, Promotions
, etc.)You can extend it by: