Automate Outlook Email Categorization with AI Agent & n8n
detail.loadingPreview
Automatically sort your Outlook inbox using n8n and an AI agent. Save time by directing emails to the right folders, keeping your inbox actionable.
🚀Ready to Deploy This Workflow?
About This Workflow
How it Works
This n8n workflow revolutionizes inbox management by leveraging an AI agent to automatically categorize incoming Microsoft Outlook emails.
- Microsoft Outlook Trigger: The workflow begins by monitoring your Outlook inbox for new emails every minute.
- HTML to Markdown Conversion: The
Markdownnode transforms the raw HTML body of the email into a more manageable Markdown format. - Email Body Sanitization: A
Codenode (Sanitize Email Body) cleans the Markdown content, removing extraneous HTML tags, link attributes, and table formatting. It then normalizes whitespace and truncates the body to 4000 characters to ensure efficient AI processing. - AI Agent - Determine Category: The core of the automation. The
AI Agent - Determine Categorynode uses your email's subject, sender, and sanitized body to intelligently decide the best folder for it. It consults available Outlook folders and saved contacts usingGet FoldersandGet Contactstools. - Move Message: Based on the AI agent's decision, the
Move Messagenode relocates the email to the determined Outlook folder.
This workflow is designed to keep your inbox clean by moving non-essential emails, ensuring only actionable communication remains.
Key Features
- AI-powered email categorization
- Automated Outlook inbox sorting
- Integrates with OpenAI/OpenRouter for advanced AI capabilities
- Sanitizes email content for reliable AI analysis
- Respects sender details and avoids moving emails from known contacts
How To Use
- Configure Microsoft Outlook Trigger: Set up your Outlook credentials and specify the inbox folder to monitor. Ensure the trigger polls frequently (e.g.,
everyMinute). - Configure Markdown Node: This node should automatically convert the HTML
body.contentfrom the Outlook trigger. - Configure Sanitize Email Body Node: This
Codenode is pre-configured to clean and shorten the email body. No changes are usually needed here. - Configure AI Agent - Determine Category Node:
- Text: This is where the AI prompt resides. It instructs the AI on how to categorize emails based on sender, subject, and body, using provided folder IDs.
- Tools: Ensure the
Move Message,Get Folders, andGet Contactsnodes are connected and configured as AI tools. The AI needs these to interact with Outlook. - LLM: Connect your
OpenRouter Chat Model(or equivalent LLM node) to theai_languageModelinput.
- Configure OpenRouter Chat Model: Set up your OpenRouter credentials and select a powerful model (e.g.,
openai/gpt-4.1). - Configure Get Folders Node: Set
resourcetofolderandoperationtogetAll. This node retrieves all available folders for the AI to reference. - Configure Get Contacts Node (Optional but Recommended): Set
resourcetocontactandoperationtogetAll. This helps the AI identify and avoid moving emails from known contacts. - Configure Move Message Node: This node will be dynamically controlled by the AI. Configure its
folderIdandmessageIdto be determined by the AI agent's output. Ensure theoperationis set tomove.
Apps Used
Workflow JSON
{
"id": "8e3fa998-d578-4828-af92-05b5b9fc57dc",
"name": "Automate Outlook Email Categorization with AI Agent & n8n",
"nodes": 0,
"category": "Productivity",
"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: 8e3fa998-d578...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Integrations
- Gmail + Schedule Trigger(270 workflows)
- Gmail + Google Sheets(245 workflows)
- Gmail + Split Out(132 workflows)
- Gmail + Gmail Trigger(119 workflows)
- Form Trigger + Gmail(107 workflows)
- Gmail + Google Drive(93 workflows)
- Airtable + Schedule Trigger(86 workflows)
- n8n + Schedule Trigger(72 workflows)
- Gmail Trigger + Google Sheets(71 workflows)
- Gmail + Telegram(63 workflows)
Related Workflows
Discover more workflows you might like
Automate Daily Email Summaries with AI & Gmail - Daily Digest
Save hours daily! Automatically fetch, summarize, and send key email insights using n8n, Gmail, and OpenAI. Get your AI-powered daily digest.
Auto-Categorize Outlook Emails with AI & Move to Folders
Save hours weekly by automatically categorizing and moving Outlook emails using AI. Integrates with Microsoft Outlook & Ollama for smart email management.
Auto-Summarize Google Docs to Google Sheets with AI
Automate Google Docs summarization. AI condenses docs into Google Sheets, saving time & boosting productivity. Integrates Google Drive & OpenAI.
Daily Meeting Summarization with Gemini AI
Automatically summarize daily meetings using Gemini AI and Google Calendar data, sending concise summaries to Slack.
AI-Powered Text Transformations via Apple Shortcuts
Automate text editing, translation, and grammar correction using Apple Shortcuts and OpenAI.
Automate Zoom Meeting Summaries & Task Creation with AI
Auto-generate Zoom meeting minutes, extract action items, and create tasks in ClickUp, all powered by AI. Save hours weekly!