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 reads the last day of your inbox over IMAP, mutes promotions and asks a model in Ollama on your own machine which threads need action. Urgent ones go to Telegram, or to ntfy if Telegram fails.
Daily urgent email alert 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 start or daily schedule
It starts when you click Test workflow, or by itself every day at 23:59 in the workflow’s timezone, and it reads:
A short report with a text table of the urgent threads in Telegram, or in ntfy when Telegram fails, and nothing at all on a quiet day
What you need before you start.
Mailbox
Is read by a Python script that logs in over SSL and returns the last day of mail without marking it read.
NeedsThe IMAP host, a user and an app password
Local model
Picks the urgent threads and writes the summary from the thread text, on your own machine.
NeedsOllama running locally with a chat model pulled
Chat
Receives the report as HTML, with the table in a code block.
NeedsA bot token and the chat id
Fallback alert
Receives the plain text report with a high priority when Telegram fails.
NeedsA topic name, no account
Checked by Mindket on 13 Nov 2026
This n8n workflow checks your inbox once a day and alerts you only when something needs action. A Python script reads the last day of mail over IMAP and groups it into threads. A list of patterns mutes promotions, job alerts and newsletters. A model running in Ollama on your own machine picks the urgent threads and writes a one-line summary. The workflow sends a short report with a table of the urgent threads to Telegram, and to an ntfy topic if Telegram fails. Fourteen nodes run the flow, and on a quiet day nothing is sent.
People who run n8n on their own machine and want an inbox check that keeps mail text off cloud AI services. It suits a busy mailbox where only a few threads matter. Skip it on n8n Cloud, where the Execute Command node is not available.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Business | Founders | Get one alert for the threads that need an answer today | A founder sees two urgent threads late in the evening and replies before bed. |
| Finance | Bookkeepers | Catch payment and invoice mail | A bookkeeper sees a failed payment notice listed with its sender. |
| Security | Small IT teams | Spot sign-in and verification alerts early | An admin sees a security alert at the top of the report. |
| Privacy | Privacy-minded users | Triage mail without sending its text to a cloud model | A user keeps every mail body on their own machine. |
You need solid n8n for this one: a server of your own with the Execute Command node turned on, a script to edit and two ways to send an alert. The file gives no setup time.
Only a self-hosted n8n that can run Python 3, reach your IMAP server and reach Ollama will run it.
127.0.0.1 must reach OllamaDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Six values and one credential cover every step.
| Need | Detail |
|---|---|
| n8n | A server of your own with the Execute Command node turned on, Python 3 and a POSIX shell |
| IMAP mailbox | The host, the user and an app password |
| Ollama | Running on the same machine at http://127.0.0.1:11434, with a chat model pulled |
| Telegram | A bot token and your chat id |
| ntfy | A topic name that nobody can guess |
workflow.json.Fetch Gmail via IMAP. At the top of the command, replace <YOUR_EMAIL_ADDRESS>, <YOUR_APP_PASSWORD> and <YOUR_IMAP_HOST> with your own values. Keep the quotes.Call Ollama Summary API and replace <YOUR_OLLAMA_MODEL> with the name of a model you have pulled. ollama list shows them.Send Telegram Summary. Replace <YOUR_TELEGRAM_CHAT_ID> in that node with your chat id.Send ntfy Summary, replace <YOUR_NTFY_TOPIC> in the address with your topic, and subscribe to the topic in the ntfy app.Manual Trigger starts the run, and a message arrives only when the model finds an urgent thread.Publish the workflow and leave it. Each day at 23:59 it checks the last day of mail. If any thread is urgent, the report arrives in Telegram. Read the table, then open your mail program for the threads that matter. The workflow does not mark mail as read or change the mailbox.
| To change | Where |
|---|---|
| The window | The cutoff and the search date in the script in Fetch Gmail via IMAP |
| What is muted, urgent or for info | The pattern lists in Build Summary Prompt |
| The prompt and the answer limits | Prepare Structured Prompt |
| The model and its settings | The request body in Call Ollama Summary API |
| The look of the message | Normalize Summary Message |
| The time | Schedule Trigger |
Among forty mails of the day are a newsletter, a job alert, a failed payment notice and a note from a colleague who wants a reply by tomorrow.
Send Telegram Summary sends a report with a one-line summary and a table of two rows, the payment notice and the colleague’s request, each with its sender and a short reason. The newsletter and the job alert count as muted.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one has a script box that reads the mail, several code boxes that tidy it, a box that asks Ollama and two boxes that send the alert. Click Test workflow once and open each box’s output to follow a mail from the inbox to the report.
For experts. Most of the logic lives in Code nodes and in the Python script, and the model call is a plain HTTP request.
| Node | What it does | What to know |
|---|---|---|
Fetch Gmail via IMAP | Execute Command that runs a Python 3 script from a here-document | Fetches with BODY.PEEK[], so mail stays unread. The login values sit at the top of the script |
Build Summary Prompt | A Code node that mutes, flags and builds the context | The mute patterns have no word borders, so word parts match anywhere in the text |
Call Ollama Summary API | HTTP Request, version 4.4, POST to /api/chat | Sends think: false, format: 'json' and keep_alive: '15m', waits 90 seconds and continues on error |
Parse Ollama Summary | A Code node that finds the JSON in the reply | Falls back to the pattern lists when the reply is not valid JSON |
Send Telegram Summary | Telegram send message in HTML mode | On error it continues with an error field, which the next IF reads |
Fix Action Table Layout | A Code node that returns its input | Passes the item on unchanged. The ntfy step reads its fields by this node’s name, so keep it or change that step too |
The workflow runs a command on your server, keeps the mail password in plain sight and mutes broadly.
NODES_EXCLUDE. In Docker the command runs inside the n8n containerAn n8n workflow that reads the last day of your inbox over IMAP with a Python script and mutes the usual promotions and job alerts. It
asks a model running in Ollama on your own machine which threads need action. When there are any, it sends a short report with a
table of the urgent threads to Telegram, and to an ntfy topic if Telegram fails. On a quiet day it sends nothing.
workflow.json: the workflow as n8n exports it, fourteen nodes that all run and no sticky notes. It holds no credential.README.md: these notes.YOUR_EMAIL@example.com, YOUR_APP_PASSWORD, YOUR_IMAP_HOST, YOUR_NTFY_TOPIC, YOUR_TELEGRAM_CHAT_ID andYOUR_OLLAMA_MODEL are now placeholders in angle brackets, such as <YOUR_APP_PASSWORD>.Example Accounts <no-reply@example.com>.NODES_EXCLUDE.http://127.0.0.1:11434, with a chat model pulled.workflow.json.Fetch Gmail via IMAP. At the top of the command, replace <YOUR_EMAIL_ADDRESS>, <YOUR_APP_PASSWORD> and<YOUR_IMAP_HOST> with your own values. Keep the quotes.Call Ollama Summary API and replace <YOUR_OLLAMA_MODEL> with the name of a model you have pulled. ollama list shows them.Send Telegram Summary. Replace <YOUR_TELEGRAM_CHAT_ID> inSend ntfy Summary, replace <YOUR_NTFY_TOPIC> in the address with your topic, and subscribe to the topic in the ntfy app.Manual Trigger starts the run. It sends a message only when the model finds an urgent thread.Manual Trigger or Schedule Trigger starts the run. The schedule fires every day at 23:59.Fetch Gmail via IMAP runs a Python script. It logs in over SSL on port 993, opens the inbox and searches for mail sinceBODY.PEEK[], so nothing is marked as read, and keeps the ones from the last 24 hours.Parse JSON Output turns that output into an item. An empty output becomes an item with a note.Build Summary Prompt mutes threads that match a list of patterns for promotions, job alerts, newsletters and similar. ItPrepare Structured Prompt writes the system and user prompts. They ask for one JSON object with a summary, up to 5 urgentCall Ollama Summary API posts the prompts to /api/chat on your Ollama with temperature 0, a 32768-token context and atParse Ollama Summary reads the JSON from the reply and trims each field. When the reply is not valid JSON, it uses the fallback result.Has Urgent Items? lets the run go on only when at least one urgent item is left.Normalize Summary Message writes the report: a summary, a text table of the urgent threads, up to 3 lines for info and apre block.Fix Action Table Layout passes the item on unchanged.Send Telegram Summary sends the HTML version. When it fails, Telegram Delivery Failed? sends the run to Send ntfy Summary,mail.Fetch Gmail via IMAP.Build Summary Prompt.Prepare Structured Prompt.Call Ollama Summary API.Normalize Summary Message. The table columns are 26, 18 and 30 characters wide.Schedule Trigger.think to false and asks for JSON output. Ollama's documentation describes think for thinking models.NOTICE.md 608 B README.md 7 KB workflow.json 42 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…