Personal · home server
n8n Harness Reporter: self-hosted workflows kept as code, tested in a throwaway container
My self-hosted n8n, kept as code: seven workflows that turn the agent harness's events into a desk report and a one-tap phone card, each tested in a throwaway container before a deploy that checks itself and knows how to roll back.
Designer and operator · Oct – Nov 2026
- workflows kept as code
- 7
- checks in 147 s, fresh clone
- 85
- unit tests on the node library
- 219
- per Code node
- 3 lines
The Problem
After a night of harness runs, knowing where things stood meant opening a Claude session and asking for a state of the union, then reading reports written as if I had watched every session. I wanted a desk report that explains itself to a product owner and remembers what it has already told me, and a phone card that turns "needs Michael" into a question I can answer with one tap. And I wanted n8n where it earns its place: at the edges, where a system meets me or an outside service, not inside systems that already have their own tested code.
From the harness
n8n · home server
Around it
The Method
Diagnose
Each of my systems already links its own parts with owned code, tests and safety rules: the music server's queue is a database table, the harness's is a folder of files. What none of them had was a good edge: a place where a system meets me or an outside service, with credentials in one hand, a history per execution and an error path. That is what n8n is for, and the harness reporter was the right first job: its alerts were plain text, its reports assumed I had watched every session, and giving direction on an open question meant a terminal.
Decide
Workflows are code: exported JSON under version control with fixed ids, the source of truth for what runs. Logic lives in a Node library the Code nodes require, so it is unit-tested and never edited on the canvas. Settings reach a workflow as environment variables and secrets as named credentials. And the contract with the harness fails safe: n8n answers 200 only once the event is on disk, and anything else makes the harness send its own notification, so a dead n8n degrades to the old alert, never to silence.
Build
Seven workflows: event intake, the desk report and its page, a memory sub-workflow over three JSONL files, the phone card and its answer webhook, and an error handler that is every other workflow's error workflow. The card writes a request file into the one harness folder n8n may write, and a path unit on the host turns it into a harness command, so the option I tap on my phone reaches the run. A harness run built it, 34 features in one day, with me answering two blocking questions and making the credentials.
Verify
The suite starts a throwaway n8n container on the pinned image, imports dummy credentials and the workflows, publishes each by id, and drives every webhook against a fake Claude and a fake notification server, then removes the container even on Ctrl-C. A canvas lint checks the JSON too: named nodes, sticky notes, nothing that reads as a host, a topic or a token. The deploy script runs a dry run under a lock, refuses a dirty or unpushed tree and the backup window, and after deploying checks every workflow's publish state and compares the library byte for byte before it records the commit.
Simplify
The first version embedded 1,464 lines of library into each Code node, and the verify failed it against the rule "no Code node over 150 lines". Now the library is a read-only module the container mounts and every Code node is the same 3 lines. The card is two stateless webhooks rather than a Wait node holding an execution open for days, and memory is three JSONL files rather than a data table, because a text file I can read and correct by hand is the right size for one reader.
Key Decisions
- D-N7
Answer on receipt, or not at all
Chose an intake that stores the event, answers 200 before any model call, and answers 422 or 503 to anything it will not handle, over answering once the report or the card is built because the harness waits 5 s at most and reads a 2xx as "n8n now owns telling Michael", so the only honest 200 is one that nothing after it can lose.
Cost: A failure after the 200 has to reach me another way: the error workflow reads the stored event and sends the plain alert the harness would have.
- D-N6
Logic in a library, 3 lines on the canvas
Chose plain functions in a Node library that every Code node requires as a read-only module, over code typed into the Code nodes because code on a canvas has no unit tests and no diff; a library has both, and a check fails the suite when a node and the library drift.
Cost: Whoever can write the library runs code in n8n's task runner after the next restart, outside n8n's own history; the mount is read-only and the loader takes only the library's own file names.
- D-N2
Settings in the environment, secrets by name
Chose non-secret settings as environment variables read in one Config node per workflow, and secrets as n8n credentials referenced by name, over secrets in environment variables too because a value in an environment variable shows up in execution data while a credential is redacted, and n8n re-links an imported workflow to a credential by type and name, so the rig can import dummies under the real names.
- D-N5
The card is two stateless webhooks
Chose one webhook that renders the card from a stored file and one that takes the answer and writes the request, over a Wait node that pauses the execution until a form is submitted because a question I may answer days later should not hold an execution open for days, and a plain POST is easy to drive from the test rig.
Cost: The answer needs the card's own token in the form, since the event id travels in a public notification.
- D-N28
A failed workflow still tells me
Chose an error workflow that every other workflow names, which reads the failed execution's stored event and sends the plain alert the harness would have sent, over letting a failed card or report fail quietly because the 200 made n8n responsible for the message, so a failure after it is downgraded to the old alert, never dropped.
Cost: n8n hands the error workflow no data from the failed execution, so the card and the report first write a small record naming their event.
- D-N3
Memory is three text files
Chose three append-only JSONL files for concepts explained, questions asked and reports sent, merged by rule with the later line winning, over n8n's data tables because one reader and a few lines a day do not need a table, and a text file is something I can read and correct by hand.
Cost: No lock between writers: two reports at once could each miss the other's lines, which the merge rules tolerate rather than prevent.
What Broke
What broke The first live deploy failed its own post-check: the check loaded each library file alone, and the card file needs the report file. The instance was fine; the check was wrong.
The rule A failed post-check is a rollback first and a fix second. The run restored the previous compose file and database snapshot, fixed the check, then deployed again.
What broke The first build embedded the whole 1,464-line library into every Code node to satisfy "no Code node over 150 lines" in spirit, and the verify failed it on the letter.
The rule A rule a verifier can count is the rule. Nodes now require the library as a module, so each one is 3 lines, and the suite fails on any node over 150.
What broke A failed card or report re-sent the stored event's whole body, a parked question that can name paths and settings, to the public notification topic.
The rule On a public topic a message carries a title and a link, never the question. The error fallback sends the failure line as its whole body unless the topic is marked private.
What broke The run's first feature needed a permission only I could grant, and the driver treated the block as one chain: nothing independent ran for five days while the question waited for me.
The rule Ask the one question that unblocks, in a form I can answer from my phone. That is what the card is for.
What broke In n8n 2.42.5 an imported workflow comes in unpublished and the documented bulk activate does nothing, so nothing answered until each one was published by id.
The rule Publish each workflow by id after the import, and let the JSON's own active flag be the publish list.
Outcome
The reporter went live on Oct 27, 2026, built in one day after a five-day block, 34 features in a harness run of its own. Seven workflows run on my home server: the intake stores each harness event and answers inside the harness's 5 s timeout, the desk report and the phone card follow, a shared memory keeps what each report has already explained, and an error workflow turns any failed execution into the plain notification the harness would have sent. From a fresh clone the suite passed 85 checks in 147 s; the library alone has 219 unit tests, and every Code node is 3 lines. The deploy script's own post-check failed the first live deploy, and the run rolled back to the previous snapshot before fixing the check. The first real event crossed on Nov 17: one desk report for about 8 cents.
In the Code
// Every problem with the body as an event the intake takes (empty = take it).
function eventProblems(body) {
if (typeOf(body) !== 'object') return [`body is not a JSON object (${typeOf(body)})`];
const have = Object.keys(body);
const missing = EVENT_KEYS.filter((k) => !have.includes(k));
const extra = have.filter((k) => !EVENT_KEYS.includes(k));
if (missing.length || extra.length) return [`keys: missing [${missing}] extra [${extra}]`];
const p = [];
if (body.v !== 1) p.push(`v is ${JSON.stringify(body.v)}: only v1 is taken`);
if (typeof body.id !== 'string' || !ID_GUARD.test(body.id)) p.push(`id ${JSON.stringify(body.id)} does not match ${ID_GUARD.source}`);
if (!ROUTED_KINDS.includes(body.kind)) p.push(`kind ${JSON.stringify(body.kind)} is not one n8n handles (${ROUTED_KINDS.join(', ')})`);
if (!(typeof body.at === 'string' && ISO_AT.test(body.at) && !Number.isNaN(Date.parse(body.at)))) p.push(`at ${JSON.stringify(body.at)} is not ISO 8601 with Z or an offset`);
for (const k of ['title', 'body']) if (typeof body[k] !== 'string') p.push(`${k} is ${typeOf(body[k])}, not a string`);
if (!['high', ''].includes(body.priority)) p.push(`priority ${JSON.stringify(body.priority)} is not "high" or ""`);
for (const k of ['project', 'run', 'feature', 'click', 'actions', 'context'])
if (!['string', 'null'].includes(typeOf(body[k]))) p.push(`${k} is ${typeOf(body[k])}, not a string or null`);
if (body.kind === 'debrief' && typeof body.context !== 'string') p.push('a debrief needs a context path');
// A lone surrogate can't be sent as UTF-8 (encodeURIComponent throws on it): refuse it here, not with a 500 later.
for (const k of EVENT_KEYS) if (typeof body[k] === 'string' && !wellFormed(body[k])) p.push(`${k} has a lone surrogate`);
return p;
}A Closer Look

How it was builtI designed the reporter and its contract with the harness, approved the design, answered the run's questions and made the credentials. A harness run of Claude Code agents wrote the workflows, the library, the rig and the deploy script under that direction, including both live deploys.