Use this powerful n8n workflow to automatically categorize and sort incoming Outlook emails using advanced AI models like DeepSeek. Enhance productivity with this ready-to-use n8n template.
Download this n8n workflow template and start using it instantly.
Managing a high-volume professional inbox can be time-consuming, especially when emails require precise categorization and filing. This sophisticated n8n workflow provides a solution by automating this entire process using an advanced Language Model (LLM).
This n8n automation starts by polling your Outlook inbox for new, uncategorized emails. It then retrieves all your existing Outlook folder names to use as the definitive list of categories. The email content is cleaned and passed to an AI Agent n8n node, which intelligently determines the best fit category and subcategory.
Finally, this powerful n8n template uses the categorization result to automatically update the email's category tag in Outlook and move it to the corresponding folder, ensuring your inbox remains clean and organized without manual intervention. This flow leverages the versatility of the n8n platform to link complex AI logic directly to your daily productivity tools.
The entire process is initiated by the n8n trigger:
Schedule Trigger n8n node runs every minute, initiating the check for new emails.RecievedEmail (Microsoft Outlook n8n node) retrieves up to one unread email that has not been flagged and currently lacks any assigned categories.varEmal1 n8n node, removing HTML, links, and excessive whitespace to ensure high-quality input for the AI.Microsoft Outlook nodes (Get many folders) retrieve all existing Outlook folder names. These names are summarized and cleaned by the Summarize and Code nodes, creating a comma-separated list of potential categories.AI Agent1 n8n node, connected to an OpenRouter Chat Model, receives the cleaned email and the definitive list of categories (your folder names). The AI performs a detailed analysis to classify the email and outputs the result as a structured JSON object containing the determined category and subCategory.AI Agent n8n node.varJSON1 n8n node extracts and validates the AI's JSON output. If parsing fails, the error is logged via Catch Errors1, and the flow continues to the next item.Get many folders1 node retrieves the folders again. The If node checks if the AI-assigned category matches an existing folder display name. If a match is found, the n8n workflow proceeds.Update Category n8n node applies the AI-determined category tags (primary and subCategory) to the Outlook message.Move Folder n8n node moves the email to the specific folder corresponding to the AI's primary category, thus completing the automated filing.To deploy this powerful n8n template, follow these steps:
RecievedEmail n8n node parameters. Ensure the foldersToInclude filter is set correctly for your target inbox folder.Schedule Trigger will begin checking your inbox at the defined interval (default: every 1 minute). Schedule Trigger (n8n trigger): Initiates the n8n workflow on a recurring schedule, set to run every 1 minute to check for new emails.
RecievedEmail (Microsoft Outlook n8n node): The initial step that polls the inbox. It is specifically configured to only fetch emails that are not read, not flagged, and critically, do not have any existing categories (not categories/any()).
varEmal1 (Set n8n node): Performs complex data manipulation using an expression to clean the email body, stripping HTML and extraneous characters, standardizing the text for optimal AI consumption.
Get many folders / Summarize / Code: These nodes work together to dynamically retrieve all available Outlook folder display names and compile them into a single list, which serves as the allowed category list for the AI Agent.
AI Agent1 (n8n node): The core intelligence of this n8n workflow. It uses the OpenRouter Chat Model to analyze the email against the list of available categories (folder names) and returns a structured JSON classification.
varJSON1 (Set n8n node): Crucial for post-processing the AI output. It uses a regex expression to ensure that only the valid JSON structure is extracted from the AI's text response, providing reliability.
If (n8n node): A logic gate that ensures the AI's categorized output matches an actual, existing folder name in Outlook before attempting to move the email.
Update Category (Microsoft Outlook n8n node): Applies the category and subCategory determined by the AI directly to the email metadata in Outlook.
Use this powerful n8n workflow to automatically categorize and label incoming Gmail messages (Action, Receipt, Informational, Spam) using GPT-4o, ensuring optimal inbox management.

Automate Zoho Mail organization using an n8n workflow. Classify incoming emails (Support, Leads, Billing) instantly with GPT-4o-mini and apply the correct label using this robust n8n template.

Use this powerful n8n workflow to automatically generate, format, and publish unique blog posts about your WooCommerce products using the OpenAI n8n node on a set schedule.

Use this powerful n8n workflow to automatically categorize and label incoming Gmail threads using AI, based on custom definitions stored in a Google Sheet. Explore n8n templates for AI email processing.

Use this powerful n8n workflow to automatically classify incoming Gmail messages using AI and apply specific labels (Work, Finance, Ads). Find more n8n templates for inbox management.

Use this powerful n8n workflow to automate invoice processing. Schedule checks on Gmail, archive files to Google Drive/SFTP, extract structured data using AI agents, and log everything to Google Sheets. Optimized n8n templates for finance.








































