DeLoNET n8n Architecture
How to build n8n workflows that are worth building on: atomic nodes with typed
contracts, lifecycle events on the bloodbank bus, safety invariants you can see
on the canvas, and reusable units that earn their place. n8n is meant to be a
visual hub for the internals — not a place to hide a shell script inside one node.
Operating Principles
- One node, one reversible responsibility. A single node that transcribes
AND archives to S3 AND writes to the vault is a god-node. Split it. The tell:
an
executeCommand wrapping a script that quietly does three jobs, giving the
canvas zero visibility into any of them.
- The bus is the completion signal. Pipeline lifecycle events publish to
bloodbank (
bloodbank.evt.<domain>.<entity>.<action>). Never wire ntfy /
Slack / email directly for a pipeline event — the bloodbank-event-toaster
already fans bloodbank.evt.> out to ntfy.delo.sh/bloodbank, so emitting
correctly gives you the notification plus every other consumer for free.
A direct ntfy node bypasses the bus and throws all of that away.
- Schema-first events. Only emit events already defined under
bloodbank/schemas/. If the one you need is missing, author the schema first
(→ bloodbank-integration), then emit. Never invent an ad-hoc payload.
- Safety invariants are topology, not buried logic. "Back up before X",
"never delete the source", "stash on failure" become visible error-branch /
merge structure on the canvas so the guarantee is auditable — not 40 lines
inside a bash function nobody opens.
- Reusable + parameterized beats bespoke. Every atomic action that recurs
across pipelines earns a reusable unit. Promote it up the escalation ladder
as reuse grows.
- Ingress authenticates before it transforms. An external webhook's exact
bytes are provenance. Preserve the raw body, select the narrow credential by
stable sender identity, verify HMAC, then normalize and publish. Never put a
Set/Code transform or workspace guess ahead of signature verification.
Quick Navigation
The Escalation Ladder
Pick the lowest rung that still gives a clean, typed boundary. Promote when a unit
reaches 2+ pipelines or needs credentials / schema validation / a real UI.
How reusable is this atomic action?
├─ One-off glue, this workflow only → inline Code / Set / Execute Command
├─ Reused across 2+ workflows, no creds → subworkflow (Execute Sub-workflow),
│ with an explicit typed input contract
└─ Reused broadly, OR needs credentials /
schema validation / a first-class node UI → custom node: n8n-nodes-<thing> micro-package
Never inline a multi-step responsibility just because executeCommand is fast to
write — that is exactly how god-nodes are born. Splitting first, promoting later,
is cheaper than untangling a monolith under fire.
Cross-Cutting Rules
- Custom nodes are per-node micro-packages, and self-contained. One node = one
npm package
n8n-nodes-<thing>, cloned from the n8n-nodes-hermes scaffold,
installed into ~/.n8n/nodes. Its logic runs in-process in execute() — never
shelling to a host script; build it inside the repo that owns its contract,
generated on deploy. An Execute Command calling a host CLI is the transitional
rung only. → node-catalog.
- n8n has no Dapr sidecar. It runs as a PM2 host process on
:5678; NATS is on
the host at 127.0.0.1:4222. Emit NATS-direct (via the bb-emit CLI) to
bloodbank.evt.<…> — the bloodbank HTTP ingress is v2/RabbitMQ and bypasses
the v3 toaster, and Dapr /publish is unavailable. → bloodbank-emit.
- Plane is the authenticated ingress exception. Both Plane workspace
webhooks enter the same HTTPS workflow, which verifies the raw-body HMAC and
publishes through the custom Bloodbank node. This is not Bloodbank HTTP
/event, a second n8n instance, or the retired port-8477 bridge. →
plane-webhook-ingress.
- Never archive into a subdir of a watched folder.
localFileTrigger will
re-fire forever. Archive off-filesystem (S3) or to a sibling outside the watch
root. → gotchas.
- MCP access is gated. Set
settings.availableInMCP: true or the n8n MCP
tools refuse the workflow. Tags and >255-char descriptions are not settable via
MCP — use direct API PUT /api/v1/workflows/{id} with the
{name, nodes, connections, settings} envelope. → gotchas.
- The source recording is irreplaceable; the transcript is derivable. Back up
the source FIRST, verify it landed, and never delete it. This invariant survives
every refactor. → transcribe-rebuild.
Out of Scope
- Whether a job should be n8n at all (vs a bloodbank consumer, a cron, an
agent hook) →
delonet-workflow-router.
- The event envelope / schema / subject contract itself (CloudEvents fields,
naming convention, versioning) →
bloodbank-integration.
- Infra paths, container/service names, credentials,
s3.delo.sh /
drive.delo.sh endpoints → delonet-conventions.
- n8n node/workflow code syntax (SDK parameter names, expression language) →
the
n8n-* MCP skills (n8n-workflow-patterns, n8n-node-configuration,
n8n-validation-expert, …).
1---2name: delonet-n8n-architecture3description: Architecture principles and the custom-node catalog for building n8n workflows on DeLoNET/33GOD. Use when creating, reviewing, or refactoring ANY n8n workflow for the pipeline — including the canonical signed Plane webhook ingress — deciding node boundaries (atomic single-responsibility nodes vs a god-node executeCommand/localFileTrigger shell script), emitting pipeline lifecycle events to Bloodbank instead of ad-hoc ntfy, choosing community vs custom nodes, packaging custom nodes as n8n-nodes-* micro-packages, rebuilding the inbox/transcribe pipeline, or applying n8n instance conventions (PM2 :5678, raw-body HMAC, per-webhook secret selection, availableInMCP, archive-outside-watch-root, direct API PUT for tags/description). Do NOT use for whether-to-use-n8n-vs-bloodbank routing (delonet-workflow-router), the event schema/envelope contract itself (bloodbank-integration), or infra paths/containers/creds (delonet-conventions).4metadata:5 source: https://skillmd.com/skills/delorenj/delonet-n8n-architecture6---78# DeLoNET n8n Architecture910How to build n8n workflows that are worth building on: atomic nodes with typed11contracts, lifecycle events on the bloodbank bus, safety invariants you can see12on the canvas, and reusable units that earn their place. n8n is meant to be a13visual hub for the internals — not a place to hide a shell script inside one node.1415## Operating Principles16171. **One node, one reversible responsibility.** A single node that transcribes18 AND archives to S3 AND writes to the vault is a god-node. Split it. The tell:19 an `executeCommand` wrapping a script that quietly does three jobs, giving the20 canvas zero visibility into any of them.212. **The bus is the completion signal.** Pipeline lifecycle events publish to22 bloodbank (`bloodbank.evt.<domain>.<entity>.<action>`). Never wire ntfy /23 Slack / email directly for a pipeline event — the `bloodbank-event-toaster`24 already fans `bloodbank.evt.>` out to `ntfy.delo.sh/bloodbank`, so emitting25 correctly gives you the notification **plus every other consumer** for free.26 A direct ntfy node bypasses the bus and throws all of that away.273. **Schema-first events.** Only emit events already defined under28 `bloodbank/schemas/`. If the one you need is missing, author the schema first29 (→ `bloodbank-integration`), then emit. Never invent an ad-hoc payload.304. **Safety invariants are topology, not buried logic.** "Back up before X",31 "never delete the source", "stash on failure" become visible error-branch /32 merge structure on the canvas so the guarantee is auditable — not 40 lines33 inside a bash function nobody opens.345. **Reusable + parameterized beats bespoke.** Every atomic action that recurs35 across pipelines earns a reusable unit. Promote it up the escalation ladder36 as reuse grows.376. **Ingress authenticates before it transforms.** An external webhook's exact38 bytes are provenance. Preserve the raw body, select the narrow credential by39 stable sender identity, verify HMAC, then normalize and publish. Never put a40 Set/Code transform or workspace guess ahead of signature verification.4142## Quick Navigation4344| Task | Read |45|---|---|46| Justify/apply the principles + the escalation ladder in depth | [references/principles.md](./references/principles.md) |47| Build, choose, or package a custom/community node | [references/node-catalog.md](./references/node-catalog.md) |48| Emit a bloodbank event from inside an n8n workflow | [references/bloodbank-emit.md](./references/bloodbank-emit.md) |49| Operate or debug the signed Plane → n8n → Bloodbank ingress | [references/plane-webhook-ingress.md](./references/plane-webhook-ingress.md) |50| n8n instance facts + hard-won failure modes | [references/gotchas.md](./references/gotchas.md) |51| Rebuild the transcribe/inbox pipeline (reference implementation) | [references/transcribe-rebuild.md](./references/transcribe-rebuild.md) |5253## The Escalation Ladder5455Pick the lowest rung that still gives a clean, typed boundary. Promote when a unit56reaches 2+ pipelines or needs credentials / schema validation / a real UI.5758```59How reusable is this atomic action?60├─ One-off glue, this workflow only → inline Code / Set / Execute Command61├─ Reused across 2+ workflows, no creds → subworkflow (Execute Sub-workflow),62│ with an explicit typed input contract63└─ Reused broadly, OR needs credentials /64 schema validation / a first-class node UI → custom node: n8n-nodes-<thing> micro-package65```6667Never inline a multi-step responsibility just because `executeCommand` is fast to68write — that is exactly how god-nodes are born. Splitting first, promoting later,69is cheaper than untangling a monolith under fire.7071## Cross-Cutting Rules7273- **Custom nodes are per-node micro-packages, and self-contained.** One node = one74 npm package `n8n-nodes-<thing>`, cloned from the `n8n-nodes-hermes` scaffold,75 installed into `~/.n8n/nodes`. Its logic runs **in-process in `execute()`** — never76 shelling to a host script; build it **inside the repo that owns its contract**,77 generated on deploy. An `Execute Command` calling a host CLI is the transitional78 rung only. → node-catalog.79- **n8n has no Dapr sidecar.** It runs as a PM2 host process on `:5678`; NATS is on80 the host at `127.0.0.1:4222`. Emit **NATS-direct** (via the `bb-emit` CLI) to81 `bloodbank.evt.<…>` — the bloodbank **HTTP ingress is v2/RabbitMQ and bypasses82 the v3 toaster**, and Dapr `/publish` is unavailable. → bloodbank-emit.83- **Plane is the authenticated ingress exception.** Both Plane workspace84 webhooks enter the same HTTPS workflow, which verifies the raw-body HMAC and85 publishes through the custom Bloodbank node. This is not Bloodbank HTTP86 `/event`, a second n8n instance, or the retired port-8477 bridge. →87 plane-webhook-ingress.88- **Never archive into a subdir of a watched folder.** `localFileTrigger` will89 re-fire forever. Archive off-filesystem (S3) or to a sibling outside the watch90 root. → gotchas.91- **MCP access is gated.** Set `settings.availableInMCP: true` or the n8n MCP92 tools refuse the workflow. Tags and >255-char descriptions are not settable via93 MCP — use direct API `PUT /api/v1/workflows/{id}` with the94 `{name, nodes, connections, settings}` envelope. → gotchas.95- **The source recording is irreplaceable; the transcript is derivable.** Back up96 the source FIRST, verify it landed, and never delete it. This invariant survives97 every refactor. → transcribe-rebuild.9899## Out of Scope100101- **Whether a job should be n8n at all** (vs a bloodbank consumer, a cron, an102 agent hook) → `delonet-workflow-router`.103- **The event envelope / schema / subject contract itself** (CloudEvents fields,104 naming convention, versioning) → `bloodbank-integration`.105- **Infra paths, container/service names, credentials, `s3.delo.sh` /106 `drive.delo.sh` endpoints** → `delonet-conventions`.107- **n8n node/workflow code syntax** (SDK parameter names, expression language) →108 the `n8n-*` MCP skills (`n8n-workflow-patterns`, `n8n-node-configuration`,109 `n8n-validation-expert`, …).