This n8n workflow automates the process of managing emails in Gmail by fetching emails from the past two weeks, analyzing their content with AI, categorizing them as unwanted marketing or spam, and then deleting or labeling these emails accordingly. The process begins with a manual trigger for testing purposes and uses a loop to paginate through emails in batches. Each email undergoes AI analysis where language models assess whether the email is unwanted or spam, and a structured output parser extracts the confidence scores and reasons.
Based on the AI’s classification, the workflow includes conditional logic to decide whether to delete the email or skip it. Notifications are sent via Telegram at each step to inform about email deletion, skipping, or errors, ensuring real-time updates about the workflow’s actions. Additionally, labels are added to emails that are not deleted, allowing further organization within Gmail.
This workflow is ideal for inboxes requiring regular clean-up of marketing emails or spam, especially for users or organizations aiming to keep their email environment tidy and focused on important messages. By integrating AI classification with automated email management, this setup reduces manual effort and enhances email workflow efficiency.
Reviews
There are no reviews yet.