A shared inbox that receives English, Spanish, French, German, Urdu and Portuguese does not get sorted by whoever happens to be on shift. Messages wait until someone who reads the language opens them, and real customers sit next to spam.
This agent reads each message, hides sensitive numbers before the model sees them, and sorts it. It was tested on October 26, 2026 on a test inbox of ten messages covering several languages and edge cases, running on a CPU-only laptop with a small local model.
Who it is for
A small team whose shared inbox receives messages in several languages and has to be sorted by hand into sales, support, billing and junk.
How it works, step by step
- Rejects empty messages and exact duplicates before any model sees them.
- Redacts card numbers and email addresses from the text before it goes to the model.
- A small local model returns language, category, urgency and a one-line English summary as JSON.
- Code repairs slightly broken JSON, or falls back to keyword rules in several languages if the model fails.
- Corrects a known confusion (Urdu labelled Arabic) by checking Urdu-only letters.
- Spam needs evidence (link, hype, prize wording); otherwise the message goes to a human.
- A Switch node sorts messages into five forums (sales, support, billing, spam, needs-human); a digest and one file per forum are written. Nothing is deleted or sent.
The model proposes a language, a topic and an urgency level. Code then redacts card numbers before the model call, rejects empty and duplicate messages, corrects labels it can check, and routes messages to five forums through a Switch node and a Merge node. If the model fails, keyword rules take over and label each row "keyword rules", so no message is lost.
How it runs: the execution strategy
It has two triggers: a schedule (daily at 06:00) and a manual trigger for testing. Each run reads the topic backlog and published log, looks up live YouTube autocomplete suggestions, builds the package and upload checklist, and records the topic as used. If autocomplete is down, keywords come from the topic words. It has not been activated on a live channel; the runs described here were run by hand.
The workflow on the n8n canvas
Screenshots taken in n8n right after a run. A green tick means the step finished, and the number on each line is how many items passed through it. Click an image to see it larger.


What went wrong while building it, in order
This list is copied from the build log kept while the workflow was made.
- T1 mixed inbox (10 messages: 8 languages/cases): 8 reached the model, 2 rejected before it (empty body, duplicate id). Card number redacted before the model saw it. Whole run 91 s on CPU, model step 68 s.
- Problem found in T1: the Urdu message came back labelled "Arabic" (the two share a script and the small model does not tell them apart). Fix: a script check on Urdu-only letters corrects the label and the digest says it did.
- Problem found in T1: random letters ("asdkj qwer") were classed as spam with no evidence, which would hide a possibly real customer. Fix: spam needs evidence (link, hype or prize wording); otherwise the message goes to the needs-human forum.
- T2 re-run after both fixes: Urdu corrected, gibberish in needs-human, spam only the real spam message (Portuguese, with link). 83 s.
- T3 wrong model name (typo in Settings): see trace; the model step failed for every message but the workflow still sorted all 8 with plain keyword rules and labelled each row "keyword rules", so no message was lost.
What we learned
- Languages that share a script confuse small models. Urdu came back labelled Arabic. A script check for Urdu-only letters now corrects the label, and the digest says when it did.
- Do not let a model call something spam without evidence. Random letters were classed as spam, which would have hidden a possibly real customer. Spam now needs evidence such as a link or prize wording; otherwise the message goes to the needs-human forum.
- A typo in the model name is a normal human mistake. We tested exactly that: the model step failed for every message, the workflow still sorted all eight with keyword rules, and nothing was dropped.
What the finished run produced

This is the real output file from a clean first run, with every saved file removed beforehand. The whole run took 66 seconds on a CPU-only laptop, including about 15 seconds of n8n start-up.
# Inbox digest Received: 10 | sorted: 8 | rejected before model: 2 ## sales (2) - [Spanish, normal] Inquiry about demo cost for automating customer responses across three stores. (from luis@example.test; via model json) - [Urdu, normal] Request for business automation solution (from sara@example.test; via model json; language corrected Arabic to Urdu (Urdu-only letters found)) ## support (1) - [French, normal] User cannot access account; password rejected since yesterday. (from marie@example.test; via model json) ## billing (3) - [English, normal] Customer reports duplicate charge for invoice 4471, requests refund. (from ana@example.test; via model json) - [German, normal] Request copy of September invoice for accounting. (from hans@example.test; via model json) - [English, normal] Customer reports card declined twice at checkout; needs help completing order. (from tom@example.test; via model json; personal data redacted before model) ## spam (1) - [Portuguese, high] Spam offering quick money via link. (from promo@example.test; via model json) ## needs-human (1) - [English, low] Random characters, likely spam (from noise@example.test; via model json; model said spam but no spam evidence (no link, hype or prize wording) -> human check) ## rejected before the model - m07 blank@example.test: empty body
Node-by-node trace of that run
| Node | Status | ms | Items out |
|---|---|---|---|
| Manual Trigger | success | 1 | [1] |
| Settings (edit me) | success | 4 | [1] |
| Preflight: local model server | success | 112 | [1] |
| Server up? | success | 9 | [1, 0] |
| Input: inbox (replace with Email/IMAP node) | success | 1279 | [10] |
| Clean, dedupe and redact | success | 9 | [10] |
| To classify? | success | 13 | [8, 2] |
| Build prompt | success | 6 | [8] |
| Local model: classify | success | 47463 | [8] |
| Parse model reply (repair + fallback rules) | success | 24 | [8] |
| Switch by forum | success | 89 | [2, 1, 3, 1, 1] |
| Forum: sales | success | 1 | [2] |
| Forum: support | success | 1 | [1] |
| Forum: billing | success | 1 | [3] |
| Forum: spam | success | 0 | [1] |
| Forum: needs-human | success | 1 | [1] |
| Collect all sorted | success | 30 | [8] |
| Build forum files and digest | success | 14 | [7] |
| Is digest? | success | 19 | [1, 6] |
| JSON to file | success | 42 | [6] |
| Write forum JSON | success | 49 | [6] |
| Text to file | success | 14 | [1] |
| Write digest | success | 23 | [1] |
Limits, stated plainly
A ten-message test inbox is a small test. Keyword rules are a safety net, not a replacement for a person reading the needs-human forum. The workflow sorts and summarises; it does not reply to anyone. Everything above was tested on a laptop . We make no claim about results on your data.
What it costs
Software: nothing. n8n Community Edition is free to self-host and the AI model runs locally with a free model runner such as Ollama. You need a laptop (8 GB of memory minimum, 16 GB is comfortable, no graphics card), an internet connection for installing, and about 20 minutes the first time. No cloud AI account, no API key and no subscription.
Want the workflow file?
The workflow file and a plain-English guide exist for every workflow in this series. If you would like this one, or you have a repeated task in your own business you would like checked for fit, tell us about it. We will say honestly whether a workflow like this could take it off your plate, and we will not promise results we cannot show.
How this article was produced
This article was drafted with AI assistance from the build log, test traces and output files of a workflow built and run on the site owner's own laptop, then published by the site owner, who is responsible for it. The workflow was built and tested by an AI assistant under the owner's direction. If you find an error, tell us. Our standards are described in the editorial policy.
What is and is not verified
Verified: the build-log events, the node trace and the output shown come from real runs on October 26 and 27, 2026. Not verified: how the workflow behaves on real business data, with other models, or at larger volume. The node diagram is generated from the workflow file and is not an n8n screenshot.
Sources
Related: Search Console Says 43 Pages Are Not Indexed: What We Tested and What We Found and Moving to a custom Blogger theme: 9 errors we hit.
About the author
I'm Junaid. I'm a sales professional with more than seven years across several industries, and I have no coding background. I use AI to build and test tools like this and I write down exactly what happened, mistakes included. If a process in your business is eating your time, tell me about it and we can look at whether AI could take some of the load.