Organize Gmail with GPT-4 & Send Urgent Notifications via Telegram and WhatsApp
This workflow automatically transforms your messy inbox into a neatly organized space while ensuring you never miss a critical message. It connects to your Gmail account and triggers for every new email. Using a powerful AI agent, the workflow first analyzes the email's content, sender, and metadata to classify it and apply the appropriate Gmail label (e.g., "Finance," "Marketing," "Dev Tools"). In parallel, a second AI agent determines if the email is urgent (like a security alert, OTP, or payment reminder) and generates a concise summary. If an email is marked as urgent, the workflow instantly sends a notification with the summary to your Telegram and WhatsApp, allowing you to take immediate action. This workflow is perfect for anyone looking to automate their email management, reduce inbox clutter, and stay on top of important, time-sensitive communications.
Step-by-Step Explanation This workflow is designed to intelligently categorize incoming emails and notify you of urgent messages. Here is a breakdown of how it operates: Trigger: New Email Received Node: Gmail Trigger Action: The workflow initiates whenever a new email arrives in your connected Gmail inbox. Fetch Full Email Content Node: Get a message Action: It takes the ID of the new email from the trigger and fetches the complete message body, subject, sender, and headers. AI-Powered Categorization Node: AI Agent2 Action: This AI agent analyzes the full email content. Based on a detailed prompt that includes classification rules (e.g., if the sender is GitHub, classify as "Dev Tools"), it determines the most appropriate category and outputs the corresponding Label ID. Label Management and Application Node: Loop Over Items -> Create Label if Doesn't exist -> Get Existing Labels -> Filter -> Add label to thread Action: This sequence ensures the email gets the correct label. It first attempts to create the Gmail label suggested by the AI. The node is set to continue even if the label already exists. It then fetches a list of all your current Gmail labels. A Filter node finds the exact ID of the label that matches the AI's suggestion. Finally, it applies this label to the email thread, neatly organizing it in your inbox. Urgency Analysis and Summarization Node: AI Agent Action: Concurrently, a second AI agent analyzes the email to determine its urgency (classifying it as "urgent" or "normal") and generates a two-sentence summary. Parse AI Output Node: Code Action: A simple code node cleans up the JSON output from the urgency analysis to ensure it's correctly formatted for the next step. Conditional Notification Logic Node: If Action: This node checks the output from the previous step. It proceeds only if the email's urgency is marked as "urgent." Send Instant Alerts Nodes: Send a text message (Telegram) & Send message (WhatsApp) Action: If an email is deemed urgent, the workflow immediately sends an alert containing the email summary to your specified Telegram chat and WhatsApp number.
Related Templates
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
ā” AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Instagram Full Profile Scraper with Apify and Google Sheets
šø Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Compare Lists and Identify Common Items & Differences Using Custom Keys
This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and ...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments