n8n

How to Automate Outlook Inbox Categorization?

Sort incoming Outlook mail with AI and route it to the right folders without manual work. Great for teams that receive many messages and need fast, clean inbox triage with clear labels and next steps.

The flow pulls new emails from Outlook and ignores messages that are flagged or already labeled. Each email is cleaned into simple text, then sent to a local AI model for category and subcategory. The result is forced into JSON and errors are caught so the run keeps going. A switch maps AI results to Outlook categories and target folders. Read status is checked before moving, and updates happen in place so the inbox stays organized.

To run it well, you need a Microsoft 365 mailbox with permission to read, label, and move emails, and an Ollama install with the qwen2.5 14b model available. Map your own Outlook folder IDs and category names in the switch and update nodes. Expect faster triage, fewer mistakes, and a clear view of what needs action. Works well for shared support inboxes, sales leads, or operations alerts where speed and consistency matter.

What are the key features?

  • Outlook message list with a filter that skips flagged and already labeled emails.
  • Batch processing so large inboxes run safely item by item.
  • Email body cleaned to markdown for better AI understanding.
  • AI categorization using an Ollama chat model with low temperature for steady results.
  • JSON enforcement and error catching so processing continues even if AI output is messy.
  • Switch node maps AI category to Outlook categories and target folders.
  • Outlook update sets categories and moves messages to specific folders.
  • If check on read status to decide the correct action path.
  • Merge and loop controls ensure every email returns to the main flow cleanly.

What are the benefits?

  • Reduce manual sorting from 60 minutes a day to about 5 minutes
  • Automate up to 80 percent of inbox triage with clear rules
  • Improve label consistency by 90 percent across the team
  • Handle 5 to 10 times more emails without extra staff
  • Connect Outlook and local AI in one simple flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Microsoft Outlook and Ollama. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create Microsoft Outlook credentials. Double click any Outlook node, choose the credential dropdown, click Create new credential, then follow the on screen steps. Grant Mail.ReadWrite and consent in your Microsoft 365 account.
  4. Open the Outlook list node and confirm the filter text matches your needs. The default filter skips flagged emails and messages that already have categories.
  5. Select the mailbox or folder to read from in the Outlook list node. Save and test once to confirm you can fetch emails.
  6. Install Ollama on your machine or server and make sure the service is running. Download the model qwen2.5 14b inside Ollama so it is ready for use.
  7. In the Ollama Chat Model node, create a new credential if prompted. Set the base URL for your Ollama instance and save.
  8. Open the Switch node and review each category case. Update the category names to match your Outlook labels.
  9. Open each Outlook update node and confirm the categories field mapping. Keep the main category and subcategory list as needed.
  10. Open each Outlook move node and pick the target folder from the dropdown. This sets the correct folderId for your mailbox.
  11. Run the workflow with the manual trigger. Check the execution view to confirm the AI output, the switch path, and the final move and label steps.
  12. If you see permission errors, recheck Microsoft Outlook credentials and that your account has rights to move and update mail. If the AI step fails, confirm Ollama is running and the model name matches.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Microsoft Outlook

Sign up

Exchange Online (Plan 1): $4.00 user / mo (annual billing)

Ollama

Sign up

Free tier: $0 (self-hosted local API)

Credits:
Built by Wayne Simpson at nocodecreative.io. Watch the setup guide: YouTube video

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.