Mindket

Daily urgent email alert with a local Ollama model

Newversion 1 · updated

Overview

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.

At a glance

Runs in
  • Your own n8n server: the Execute Command node must be on, and the command runs on that machine
  • n8n in Docker: the command runs inside the container, so Python 3 must be there and 127.0.0.1 must reach Ollama
  • Another mail host: the script uses plain IMAP calls, so any IMAP server can be read
  • Another channel: swap the Telegram or ntfy node for any notification node

Platform

Connects 4 apps

How it works

Trigger

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:

  • The inbox of an IMAP mailbox, for the last 24 hours

Actions

  1. A Python script on the n8n machine logs in over IMAP and reads the last day of mail without marking it read
  2. The messages are cut down, grouped into threads and passed on as one JSON object
  3. A list of patterns mutes promotions, job alerts and newsletters and flags likely urgent threads
  4. A model in Ollama on your machine returns a summary, up to five urgent items and up to three items for info as JSON
  5. When the reply is not valid JSON, the pattern lists give a fallback result
  6. Only when something is urgent, the report goes to Telegram, and to an ntfy topic if Telegram fails

Result

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

Integrations

What you need before you start.

Email (IMAP)

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

Ollama

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

Telegram

Chat

Receives the report as HTML, with the table in a code block.

NeedsA bot token and the chat id

ntfy

Fallback alert

Receives the plain text report with a high priority when Telegram fails.

NeedsA topic name, no account

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
14 steps, starting by hand or on a schedule
AI
No step calls an AI model
Sign-ins
Signs in to: Telegram
API keys
No API key is left in the file
Step types
Mindket’s checker reads 6 of its 7 step types. It does not read: Execute Command

Read from the workflow’s file, not from a run.

About

What it is

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.

Who it suits

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.

Who uses it, and how
IndustryWho uses itHow they use itExample
BusinessFoundersGet one alert for the threads that need an answer todayA founder sees two urgent threads late in the evening and replies before bed.
FinanceBookkeepersCatch payment and invoice mailA bookkeeper sees a failed payment notice listed with its sender.
SecuritySmall IT teamsSpot sign-in and verification alerts earlyAn admin sees a security alert at the top of the report.
PrivacyPrivacy-minded usersTriage mail without sending its text to a cloud modelA 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.

Where to use it

Only a self-hosted n8n that can run Python 3, reach your IMAP server and reach Ollama will run it.

  • Your own n8n server: the Execute Command node must be on, and the command runs on that machine
  • n8n in Docker: the command runs inside the container, so Python 3 must be there and 127.0.0.1 must reach Ollama
  • Another mail host: the script uses plain IMAP calls, so any IMAP server can be read
  • Another channel: swap the Telegram or ntfy node for any notification node

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Six values and one credential cover every step.

What you need first
NeedDetail
n8nA server of your own with the Execute Command node turned on, Python 3 and a POSIX shell
IMAP mailboxThe host, the user and an app password
OllamaRunning on the same machine at http://127.0.0.1:11434, with a chat model pulled
TelegramA bot token and your chat id
ntfyA topic name that nobody can guess
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Open 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.
  3. Open Call Ollama Summary API and replace <YOUR_OLLAMA_MODEL> with the name of a model you have pulled. ollama list shows them.
  4. Add a Telegram credential with your bot’s token and select it in Send Telegram Summary. Replace <YOUR_TELEGRAM_CHAT_ID> in that node with your chat id.
  5. In Send ntfy Summary, replace <YOUR_NTFY_TOPIC> in the address with your topic, and subscribe to the topic in the ntfy app.
  6. Click Test workflow. Manual Trigger starts the run, and a message arrives only when the model finds an urgent thread.
  7. Check the workflow’s timezone in its settings, since the schedule runs at 23:59 in it. Then save and press Publish at the top of the canvas (or Shift+P).

How to use it

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.

What to change for a different result
To changeWhere
The windowThe cutoff and the search date in the script in Fetch Gmail via IMAP
What is muted, urgent or for infoThe pattern lists in Build Summary Prompt
The prompt and the answer limitsPrepare Structured Prompt
The model and its settingsThe request body in Call Ollama Summary API
The look of the messageNormalize Summary Message
The timeSchedule Trigger

Example

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.

For newcomers and experts

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.

Where to look closer
NodeWhat it doesWhat to know
Fetch Gmail via IMAPExecute Command that runs a Python 3 script from a here-documentFetches with BODY.PEEK[], so mail stays unread. The login values sit at the top of the script
Build Summary PromptA Code node that mutes, flags and builds the contextThe mute patterns have no word borders, so word parts match anywhere in the text
Call Ollama Summary APIHTTP Request, version 4.4, POST to /api/chatSends think: false, format: 'json' and keep_alive: '15m', waits 90 seconds and continues on error
Parse Ollama SummaryA Code node that finds the JSON in the replyFalls back to the pattern lists when the reply is not valid JSON
Send Telegram SummaryTelegram send message in HTML modeOn error it continues with an error field, which the next IF reads
Fix Action Table LayoutA Code node that returns its inputPasses the item on unchanged. The ntfy step reads its fields by this node’s name, so keep it or change that step too

Good to know

The workflow runs a command on your server, keeps the mail password in plain sight and mutes broadly.

  • Not run: Mindket made no call to an IMAP server, Ollama, Telegram or ntfy. It checked the Python script’s syntax and ran the Code steps with a sample thread and a sample model reply
  • Execute Command: n8n’s documentation says the node is not available on n8n Cloud, and n8n 2.0 turns it off by default, so remove it from NODES_EXCLUDE. In Docker the command runs inside the n8n container
  • Password: it sits in the command text, so anyone who can open the workflow can read it. Use an app password and keep the workflow to yourself. For Gmail, Google’s help says an app password needs 2-Step Verification
  • ntfy: it has no sign-up, and its documentation says the topic works like a password. The fallback text lists the subjects and senders of your urgent mail, so pick a topic nobody can guess
  • Mute patterns: they match word parts anywhere in the subject, the sender and the body, so a real mail that contains deal, offer or sale is muted before the model sees it
  • Quiet days: with no urgent thread nothing is sent, not even a note
  • Model call: the request asks for a 32768-token context, more than Ollama’s default of 4k on a machine with under 24 GiB of VRAM, and it caps the answer at 260 tokens. A cut-off answer sends the workflow to its own lists
  • Timezone: the schedule uses the workflow’s timezone when one is set, and otherwise the n8n instance’s
  • Your data: the mail bodies go only to your own Ollama. The urgent subjects and senders go to Telegram, and to ntfy.sh if Telegram fails
  • Safety: a message can carry text meant to steer the model, so a mail can be listed as urgent or left out
  • Credentials: the JSON holds none

README and files

README

Daily urgent email alert with a local Ollama model

An 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.

What is inside

  • 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.

What we changed from the original copy

  • The made-up values YOUR_EMAIL@example.com, YOUR_APP_PASSWORD, YOUR_IMAP_HOST, YOUR_NTFY_TOPIC, YOUR_TELEGRAM_CHAT_ID and
    YOUR_OLLAMA_MODEL are now placeholders in angle brackets, such as <YOUR_APP_PASSWORD>.
  • The example mail in the prompt came from a real service address. It is now Example Accounts <no-reply@example.com>.
  • The credential link on the Telegram node was removed. Select your own.
  • Nothing else. The script, the pattern lists, the prompts, the model settings and the layout of the message are as they were.

Before you start

  • A self-hosted n8n with the Execute Command node turned on. n8n Cloud does not have it, and n8n 2.0 switches it off by default, so
    remove it from NODES_EXCLUDE.
  • Python 3 and a POSIX shell on the machine that runs n8n. In Docker, the command runs inside the n8n container.
  • An IMAP mailbox with its host, user and an app password. For Gmail, Google's help says an app password needs 2-Step Verification.
  • Ollama on the same machine, listening on http://127.0.0.1:11434, with a chat model pulled.
  • A Telegram bot token and your chat id.
  • A hard-to-guess ntfy topic name, for the fallback.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Open 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.
  3. Open Call Ollama Summary API and replace <YOUR_OLLAMA_MODEL> with the name of a model you have pulled. ollama list shows them.
  4. Add a Telegram credential with your bot's token and select it in Send Telegram Summary. Replace <YOUR_TELEGRAM_CHAT_ID> in
    that node with your chat id.
  5. In Send ntfy Summary, replace <YOUR_NTFY_TOPIC> in the address with your topic, and subscribe to the topic in the ntfy app.
  6. Click Test workflow. Manual Trigger starts the run. It sends a message only when the model finds an urgent thread.
  7. Check the workflow's timezone in its settings, since the schedule runs at 23:59 in it. Then save and press Publish at the top of
    the canvas (or Shift+P).

How a run goes

  1. Manual Trigger or Schedule Trigger starts the run. The schedule fires every day at 23:59.
  2. Fetch Gmail via IMAP runs a Python script. It logs in over SSL on port 993, opens the inbox and searches for mail since
    yesterday's date. It fetches each message with BODY.PEEK[], so nothing is marked as read, and keeps the ones from the last 24 hours.
  3. The same script cuts each body to 2000 characters, groups the messages into threads and keeps up to 6 messages and 6000
    characters of text per thread. It prints one JSON object.
  4. Parse JSON Output turns that output into an item. An empty output becomes an item with a note.
  5. Build Summary Prompt mutes threads that match a list of patterns for promotions, job alerts, newsletters and similar. It
    marks urgent ones by another list. It prepares a fallback result of up to 5 urgent threads and 3 for info, and a context of
    up to 12 threads and 24000 characters.
  6. Prepare Structured Prompt writes the system and user prompts. They ask for one JSON object with a summary, up to 5 urgent
    items and up to 3 items for info.
  7. Call Ollama Summary API posts the prompts to /api/chat on your Ollama with temperature 0, a 32768-token context and at
    most 260 tokens of answer. It waits up to 90 seconds, and an error does not stop the run.
  8. Parse Ollama Summary reads the JSON from the reply and trims each field. When the reply is not valid JSON, it uses the fallback result.
  9. Has Urgent Items? lets the run go on only when at least one urgent item is left.
  10. Normalize Summary Message writes the report: a summary, a text table of the urgent threads, up to 3 lines for info and a
    count of muted threads. It also makes an HTML version with the table in a pre block.
  11. Fix Action Table Layout passes the item on unchanged.
  12. Send Telegram Summary sends the HTML version. When it fails, Telegram Delivery Failed? sends the run to Send ntfy Summary,
    which posts the plain text with a title, a high priority and the tag mail.

Change the look

  • The window: the cutoff and the search date in the script inside Fetch Gmail via IMAP.
  • What counts as 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 table columns are 26, 18 and 30 characters wide.
  • The time: Schedule Trigger.

Good to know

  • Not run: Mindket made no call to an IMAP server, Ollama, Telegram or ntfy. It checked the Python script's syntax and ran the
    Code steps on its own machine with a sample thread and a sample model reply.
  • The mail password sits in the command text. Anyone who can open the workflow can read it, so use an app password and keep the
    workflow to yourself.
  • ntfy has no sign-up. Its documentation says the topic works like a password. The fallback text lists the subjects and
    senders of your urgent mail, so pick a topic nobody can guess.
  • The mute patterns match word parts anywhere in the subject, the sender and the body, with no word borders. A real mail that
    contains "deal", "offer" or "sale" is muted before the model sees it. Edit the lists if that hurts.
  • On a day with no urgent thread nothing is sent, not even a note that the day was quiet.
  • The request sets think to false and asks for JSON output. Ollama's documentation describes think for thinking models.
  • A 32768-token context needs more memory than Ollama's default, which its documentation puts at 4k on a machine with under 24 GiB
    of VRAM. The 260-token limit can cut a long answer short, and the workflow then falls back to its own lists.
  • The message bodies go only to your own Ollama. The urgent subjects and senders go to Telegram, and to ntfy.sh if Telegram fails.
  • A message can carry text meant to steer the model, so a mail can be listed as urgent or left out. Treat the report as a prompt to
    look, not a full check.
Files
NOTICE.md  608 B
README.md  7 KB
workflow.json  42 KB

3 files, 50 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

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…

New

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…

New

ACE-Step 1.5 XL SFT

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…

New

Similar in Productivity

See all in Productivity

Guizang PPT Skill

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…

New29.8k

Frontend Slides

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…

New32.3k

IPTV

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…

New144k