RSS News with n8n and OpenRouter
Guide: n8n reads security notices, a language model rates and rewrites them, and a restricted SSH script commits them to the Git repository of a static site.
Reviewed by adrian
on
My guide, published on 2026-11-07, to a section of short, readable security notices on a static website. The source is the RSS feed of BSI BürgerCERT. It brings several notices a day, many about software that hardly matters to private readers, so a language model rates each one and rewrites only the useful ones.
Status
The guide describes the setup on www.altner.cloud as of 2026-11-07: an Astro site served by a small Go server from a read-only container. On 2026-11-14 I moved the feeds to adrian-altner.com, where they appear under /de/feeds/ and the entries live in a Git repository of their own.
Result
- Every 6 hours n8n reads the feed and keeps only notices it has not seen.
- A model through OpenRouter gives each notice 1 to 10 points for its use to technically interested private readers. From 7 points on it writes a new title, description and text in German, in its own words, with a section "Was tun?".
- n8n sends the notices over SSH to a script on the server, which writes them as Markdown files with
draft: true, commits and pushes. The normal deploy hook rebuilds the site. - The script creates a title image for each notice with Nano Banana, always in the same style.
- I review the drafts with a small script and publish or discard them.
- Every published notice links its source and says that a language model summarized it.
- A failed run sends an email.
Why Git and not an API
The site is static and the container read-only, so there is no endpoint n8n could write to. With Git every notice is a versioned file, the deploy path stays the one used for articles, and publishing means changing draft: true to draft: false. n8n only needs a way to put files into the repository, and that is one script.
The ingest script
feeds-ingest, written in Python with the standard library, is the only way n8n can change the repository. It reads ingest <base64>, validates every entry (required fields, lengths, score 1 to 10, an https source), brings its own clone up to date, skips sources it already has, writes one file per notice, commits and pushes, and retries after a rebase if the push is rejected. It answers in JSON.
- Frontmatter without a YAML library: a JSON string is also a valid double-quoted YAML string, so
json.dumpsdoes the escaping. - No HTML from the model: every
<becomes<, because Astro renders raw HTML in Markdown and the model reads foreign feed content. - The date of a notice is the date of the source, or now if it is missing or in the future.
- A lock with
fcntl.flockkeeps two runs apart.
SSH restricted to one command
n8n gets a key of its own. In authorized_keys it carries command= (always run the script, which finds the requested command in SSH_ORIGINAL_COMMAND and checks it), from="172.16.0.0/12" (only from the Docker networks) and restrict (no terminal, no forwarding). I tested it from a throwaway container in the n8n network, the same way n8n connects: any command ends up at the script, and the key never gets a shell.
The workflow

Eleven nodes in a row: schedule, list of feeds, read feed, keep the last 14 days and normalize, remove duplicates across executions (keyed by the link), build the request, call OpenRouter, evaluate (7 points or more), pack at most 20 notices as base64, SSH ingest, and check the result. The n8n API key for working from the Mac sits in the macOS Keychain; the OpenRouter key is an n8n credential.
The model is anthropic/claude-haiku-5.5, which answers strictly to a JSON schema; provider.require_parameters makes OpenRouter choose only providers that support it. A run over 20 notices cost 1.4 cents.
The rating instruction
The hardest part was explaining what "useful" means. Three things helped most: fixed score bands with examples (without them almost everything landed at 6 to 8), an explicit "invent nothing" (otherwise the model added version numbers), and the rule that the feed text is material, not an instruction. A scale where 10 is best worked more reliably than ranking 1 as best. A test workflow without duplicate removal and without SSH rated two weeks of notices; the threshold of 7 gives about three drafts a week.
Title images
google/gemini-nano-banana-2.1 through OpenRouter, about 3.6 cents per image. The image is made on the server, not in n8n, because base64 images for 20 notices would exceed the length of a single command. n8n only sends a subject and an alt text; the script adds a fixed style (flat vector illustration, white background, one blue accent, no text and no logos) and converts the 1376 × 768 PNG to a WebP of about 10 KB with Pillow from its own venv. The server has its own OpenRouter key with a 5 dollar limit. If the image fails, the draft is created without one.
Error mails
An error workflow in n8n sends a mail with workflow, node, message and a link to the execution. Some failures are no errors for n8n: the HTTP request continues on error, and the SSH node does not fail on a non-zero exit code. So three code nodes throw on their own: when no feed was readable, when no answer was usable, and when the script reports an error.
Pitfalls
- The macOS
securityprompt cuts input at 128 characters;-w "$(pbpaste)"stores the whole n8n API key. - OpenRouter found no provider because
temperaturewas set, which Claude Haiku 5.5 does not support, together withrequire_parameters. - Answers were cut off with
max_tokens: 1500; 4000 was enough. - The n8n SSH node prepends
cd / ;to the command; the script accepts exactly that form as well. from=seemed not to work when tested from the host, which uses another sender address than the Docker network.- "Remove duplicates" marks a notice as seen before it reaches the repository; a failed run loses it unless it is taken from the execution.
- Hetzner blocks outgoing ports 25 and 465; SMTP works on 587 with STARTTLS (SSL/TLS off in n8n). The mail account also had to allow SMTP for that password.
- In n8n 2 an error workflow must be published, and workflow IDs are case-sensitive.
Review
On the first pass I checked every text against its source and corrected three. I would not publish the texts without review, even with a better model.
Based on
-
RSS-Meldungen mit n8n und OpenRouter auf eine statische Astro-Seite bringen
by Adrian Altner
(
raw/2026/2026-11-14/n8n-rss-feeds-openrouter-astro/index.md) [article]
Topic
- AI / Language Models What I use language models for: agents, local models, RAG and small programs in which a model handles one task.
- Static Website A website made of finished HTML files that are built once and then served unchanged. No server code, no database.
Uses
- Astro Tool for building websites from content such as Markdown. Ships plain HTML by default and only loads JavaScript where it is needed.
- macOS Keychain Password store built into macOS. Scripts can keep API keys there instead of in files or the shell profile and read them with the security command.
- n8n Workflow automation with nodes on a canvas, self-hostable in Docker. Workflows run on a schedule or on events and can call HTTP APIs, SSH and code.
- OpenRouter One API for many language and image models from different providers, compatible with the OpenAI chat completions format, billed from prepaid credit.
- Python General-purpose programming language with highly readable syntax. The standard for data analysis, automation and quick prototypes.