Auto Categorize Outlook Emails with AI
detail.loadingPreview
Automates the categorization of incoming Outlook emails using AI, moving them to appropriate folders and applying categories.
About This Workflow
This workflow automatically processes incoming emails in Outlook. It filters out flagged or already categorized emails, sanitizes their content, and then uses an AI model (Ollama Chat Model) to categorize them based on predefined rules and content analysis. Finally, it updates email categories and moves them to relevant folders.
Key Features
- Email Filtering: Processes only unread, unflagged emails.
- Content Sanitization: Removes HTML tags and extraneous information from email bodies.
- AI-Powered Categorization: Utilizes an LLM to determine the most suitable category (Action, Junk, Receipt, SaaS, Community, Business, Other) and an optional subcategory.
- Dynamic Category Application: Applies generated categories to Outlook emails.
- Automated Folder Management: Moves categorized emails to designated Outlook folders.
- Error Handling: Includes a mechanism to catch and log errors during processing.
How To Use
- Trigger: The workflow starts when the 'Test workflow' button is clicked (manual trigger). In a real scenario, this would likely be an Outlook trigger.
- Email Retrieval: The
Microsoft Outlook23node fetches unread, unflagged emails from a specified folder. - Email Sanitization: The
Markdown1andvarEmal1nodes clean up the email body, removing HTML and preparing it for AI processing. - Category Assignment Setup: The
varID & Category1node defines potential categories. This node might need customization based on your specific needs. - AI Categorization: The
AI Agent1node, connected to an Ollama Chat Model, analyzes the email content and assigns acategoryandsubCategorybased on the prompt and system message. - JSON Conversion: The
varJSON1node ensures the AI's output is parsed as JSON, with error handling. - Category Application & Moving: A series of
Microsoft Outlooknodes (100db1cb,524f6be3, etc.) are used to apply the determined categories and move the emails to specific folders based on the AI's categorization. - Read Status Check: The
If1node checks if the email has been read, and if so, moves it to the 'Actioned' folder.
Important Notes:
- Folder IDs: Ensure the
folderIdvalues in the Microsoft Outlook nodes are correctly configured for your Outlook account. - Category Names: The categories defined in
varID & Category1and the system message inAI Agent1should be consistent. - AI Model: The
Ollama Chat Model1is configured to use the 'qwen2.5:14b' model. Adjust this if you use a different model. - Filters: The
Microsoft Outlook23node uses a custom filter:flag/flagStatus eq 'notFlagged' and not categories/any(). You can modify this to adjust which emails are processed.
Apps Used
Workflow JSON
{
"id": "6f704e58-9636-4a88-8e4d-49a0c5f85199",
"name": "Auto Categorize Outlook Emails with AI",
"nodes": 22,
"category": "Email Management",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 6f704e58-9636...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Related Workflows
Discover more workflows you might like
Gmail Cleanup and Batch Processing
Automates the retrieval of Gmail message IDs, splits them into batches, and deletes them.