anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
An n8n workflow that sorts Outlook email with a local Ollama model. It sets a category on each unsorted email, then moves junk, receipts, SaaS and community mail to folders you pick.
Sort Outlook emails into folders with a local Ollama model is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Manual run
You click Test workflow, and each click handles one email:
An Outlook category on each email you click through, and a move to the folder that fits it
What you need before you start.
Returns the next unsorted Inbox email, sets its category and moves it to a folder.
NeedsA Microsoft Outlook OAuth2 credential and one folder each for junk, receipt, SaaS, community and actioned mail
Local language model
Runs qwen2.5:14b on your own server and picks the category for each email.
NeedsA running Ollama server with qwen2.5:14b pulled
Checked by Mindket on 13 Nov 2026
This n8n workflow sorts your Outlook inbox with an AI model that runs on your own computer. For each email that has no category, a local Ollama model picks one, and Outlook stores it. Junk, receipts, SaaS and community mail then move to folders you choose. Twenty-six nodes do the work, beside nine sticky notes.
Freelancers and small teams who get more email than they can read, and who do not want their mail sent to a cloud AI service. Skip it if you want a hosted model, since this one needs Ollama running on your own machine.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Freelance | Independent developers | Let a local model sort a busy inbox | A developer sees receipts and junk filed away while client mail stays in the inbox. |
| Consulting | Small agencies | Keep client email private while it is sorted | An agency runs the model on its own server, so no email text leaves the office. |
| Software | SaaS founders | Separate account notices from real enquiries | A founder finds a billing notice under SaaS and a customer question under action. |
| Education | Course organisers | Sort forum and event mail | An organiser sees community updates filed in their own folder. |
You need a little n8n and a machine that can run a model of about 9 GB: import a file, install Ollama, add two credentials and pick five folders.
Any n8n that can reach your Ollama server and your Outlook mailbox will run it. The email text goes to your own server and to no outside AI service.
Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Create the Outlook folders first, so you can pick them in the Move nodes.
| Need | Detail |
|---|---|
| n8n | On your own computer or server |
| Ollama | A running Ollama server with the qwen2.5:14b model pulled, about 9 GB |
| Microsoft Outlook | A mailbox and an OAuth2 credential |
| Outlook folders | One folder each for junk, receipts, SaaS, community and actioned mail |
workflow.json.ollama pull qwen2.5:14b.http://localhost:11434 by default, and select it in Ollama Chat Model.Get emails without a category, the Set category nodes and the Move nodes.Get emails without a category, open Filters and replace <YOUR_INBOX_FOLDER_ID> in Folders to Include by choosing your Inbox.Click Test workflow and look at the email that was handled. It gets a category in Outlook, such as Junk or Action, and some emails also change folder. Each click handles one email, so click again for the next one.
| To change | Where |
|---|---|
| How many emails per click | Limit in Get emails without a category |
| The categories | The list in Add id and category list, the System Message in Email category agent and the rules in Route by category |
| Whose assistant it is | System Message in Email category agent, which is written for a freelance developer |
| The folders | The Move nodes |
| The model | Model in Ollama Chat Model |
| Running by itself | Add a Schedule Trigger in front of Get emails without a category |
A freelancer clicks Test workflow. The next unsorted Inbox email is a receipt from an online shop. The model answers with the category receipt and a short reason.
Outlook then shows the category Receipt on the email, and the workflow moves it to the Receipt folder. A client enquiry would get the category Business, and would move to the Actioned folder only once it has been read.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one reads an email, asks the model for a category, then follows the line for that category. Ollama is a program that runs AI models on your own computer.
For experts. The agent has no tools, so it is only a way to send the prompt. Parse agent reply cuts the JSON out of its answer, from the first curly brace to the last. An answer that is not valid JSON takes the error output to Catch parse errors, and the loop moves on.
| Node | What it does | What to know |
|---|---|---|
Get emails without a category | Outlook 2, Get Many, with a filter query | Limit 1, and the filter skips flagged emails and emails that already have a category |
Convert body to text | Markdown 1, turns the HTML body into Markdown | Pick email fields then strips links, images and symbols |
Pick email fields | Set 3.4, keeps the subject, importance, senders and a cleaned body | The cleaning is a chain of replace calls in one expression |
Add id and category list | Set 3.4, adds the email id and the allowed categories | The categories sit in one string that the prompt reuses |
Email category agent | Agent 1.6 with a system message and no tools | The Ollama model runs at temperature 0.2 |
Parse agent reply | Set 3.4, turns the reply into an object | Its error output leads to Catch parse errors |
Route by category | Switch 3.2 with six rules and a fallback | Matching ignores case, and the fallback takes the other category |
Is email read | If 2.2, checks the read flag | Read action and business emails move on to the Actioned folder |
Merge outcomes | Merge 3 with seven inputs | Every branch ends here, then the loop continues |
The original needed a few fixes before it could work for anyone else, and it still needs a local model that can keep up.
<YOUR_INBOX_FOLDER_ID>, so Outlook rejects the request until you pick your own Inboxqwen2.5, read on 12 November 2026, lists the 14b model at 9.0 GB with a 32K context window and a tools tagOllama Chat ModelAn n8n workflow that sorts Outlook email with an AI model on your own computer. For each email that has no category, a local Ollama
model picks one and Outlook stores it. Junk, receipt, SaaS and community mail then move to folders you choose.
workflow.json: the workflow as n8n exports it, twenty-six working nodes and nine sticky notes. It holds no credential.README.md: these notes.Get emails without a category holds <YOUR_INBOX_FOLDER_ID>.Microsoft Outlook12 and varJSON1. They now say what they do, for exampleSet category junk and Parse agent reply, and every expression that named one was updated.qwen2.5:14b model pulled, about 9 GB.workflow.json.ollama pull qwen2.5:14b.http://localhost:11434 by default, and select it inOllama Chat Model.Get emails without a category, theSet category nodes and the Move nodes.Get emails without a category, open Filters and replace <YOUR_INBOX_FOLDER_ID> in Folders to Include by choosingGet emails without a category asks Outlook for one Inbox email that is not flagged and has no category.Convert body to text and Pick email fields reduce it to a subject, importance, senders and a cleaned body.Add id and category list adds the email id and the allowed categories.Email category agent asks the Ollama model for a category, an optional sub category and a short reason.Parse agent reply turns the answer into an object. An answer that is not valid JSON goes to Catch parse errors.Route by category picks the branch. Each Set category node writes the category and sub category in Outlook.Move node. Action and business emails go throughIs email read, and a read one moves to the Actioned folder.Merge outcomes joins the branches and the loop starts again.Get emails without a category.Add id and category list, the System Message in Email category agent and the rules inRoute by category.Email category agent.Ollama Chat Model.qwen2.5, read on 12 November 2026, lists the 14b model at 9.0 GB with a 32K context window andOllama Chat Model.NOTICE.md 615 B README.md 4 KB workflow.json 34 KB
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
zarazhangrui · Skill
Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…
iptv-org · Kit
Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…