Installation — Reliable Automation Kit v1.0.1

Time: about 30–45 minutes for all six workflows. You can install them one at a time; each section says what it depends on.

Requirements

RequirementWhyNotes
n8n 2.20.8 for the release labRuns the workflowsCloud and other n8n versions require their own acceptance run. Built with Code v2, HTTP Request v4.2, Postgres v2.5 and Schedule v1.2.
n8n Public API enabled + an API keyRAK-02, 05, 06 and the free audit read executions/workflowsSettings → n8n API → Create API key. On n8n Cloud the API is not available on the free trial.
Postgres 12+Durable, race-safe state (incidents, idempotency keys, health history)Can be the database n8n already uses (separate rak schema) or any managed Postgres (Supabase, Neon, RDS…).
An alert destinationAlerts and reportsSlack incoming webhook, Discord webhook, or any HTTPS endpoint that accepts JSON.

Why Postgres and not workflow static data or Data Tables: n8n documents static data as unavailable in test runs and unreliable under high-frequency executions, and neither gives you an atomic "insert if absent" across parallel executions. The Idempotency Gate depends on a primary-key conflict that only a real database enforces.

Step 1 — Create the schema (5 min)

Run sql/schema.sql once against your database:

psql "$DATABASE_URL" -f sql/schema.sql

Or paste it into your provider's SQL editor (Supabase SQL editor, Neon console…). It only creates objects in the rak schema and can be re-run safely.

Recommended: a dedicated database user that only has access to the rak schema:

CREATE ROLE rak_app LOGIN PASSWORD 'choose-a-long-password';
GRANT USAGE ON SCHEMA rak TO rak_app;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA rak TO rak_app;
GRANT USAGE ON ALL SEQUENCES IN SCHEMA rak TO rak_app;
GRANT EXECUTE ON FUNCTION rak.prune(integer) TO rak_app;

Step 2 — Create two credentials in n8n (5 min)

  1. Postgres credential (name it RAK Postgres): host, database, user, password, SSL as your provider requires.
  2. HTTP Header Auth credential (name it n8n API): Name = X-N8N-API-KEY, Value = your n8n API key.

Step 3 — Import the workflows

For each file in workflows/: n8n → Workflows → Import from file (or paste the JSON into an empty canvas). After importing, n8n flags nodes that need a credential; open each one and select the credential from Step 2.

Install in this order. Each workflow has a yellow sticky note with the same instructions.

RAK-01 Error Router (required by RAK-05 and RAK-06)

  1. Open Config: set alertWebhookUrl, alertChannel (slack | discord | generic), and optionally criticalWorkflowIds.
  2. Record Incident → select RAK Postgres.
  3. Save and publish/activate.
  4. For every production workflow: Workflow settings → Error workflow → RAK-01 Error Router. (The free audit lists the workflows that are missing this.)

RAK-02 Silent Failure Watchdog

  1. Config: n8nBaseUrl (e.g. https://n8n.yourdomain.com, no trailing slash) and the watched list: one entry per workflow you expect to run on a rhythm, with maxSilenceMinutes a bit above its normal interval (hourly job → 90; nightly → 1500).
  2. Get Recent Executions → select n8n API. Both Postgres nodes → RAK Postgres.
  3. Activate.

RAK-03 Idempotency Gate + RAK-03b demo

  1. Import RAK-03, select RAK Postgres on Gate Query, then publish it. On n8n 2.20.8, a published parent cannot call an unpublished sub-workflow. Copy its workflow ID from the URL (/workflow/<ID>).
  2. Import RAK-03b and paste that ID into Claim Event and Mark Event Complete.
  3. Activate RAK-03b and run the duplicate test in Testing.
  4. To protect your own workflows, copy the three demo nodes (Extract Event Key, Claim Event, First Delivery Only) in front of your side effect and Mark Event Complete after it. See Config reference → Choosing an idempotency key.

Use the demo only in staging and deactivate it after testing. A production webhook must authenticate the provider and validate its signature before claiming any event.

RAK-04 API Health Monitor

  1. Config → endpoints. Use real health endpoints where possible (for example a provider's /status or /health URL).
  2. Both Postgres nodes → RAK Postgres. Activate.

RAK-05 Daily Ops Report

  1. Config: n8nBaseUrl, alertWebhookUrl (can be a quieter channel), retentionDays.
  2. Get Recent Executions → n8n API; both Postgres nodes → RAK Postgres.
  3. The schedule runs at 08:00 in the workflow's timezone (Workflow settings → Timezone). Activate.

RAK-06 Safe Failed-Execution Recovery (install last)

  1. Config: n8nBaseUrl, alertWebhookUrl. Leave dryRun: true.
  2. Retry Execution → n8n API; all Postgres nodes → RAK Postgres. Activate.
  3. Leave it in dry run for at least a few days and read the hourly "would retry" digests.
  4. Add a workflow ID to retrySafeWorkflowIds only after its side effects are protected by the Idempotency Gate or are naturally idempotent (upserts, PUTs with the same body, idempotency-key headers). Then set dryRun: false.

Do not move RAK-06's three branches vertically. n8n's v1 execution order runs branches top to bottom (record → retry → digest).

Upgrading

Re-import the new JSON. Copy your old Config node contents into the new Config node before deleting the old workflow. Run the new sql/schema.sql; it is additive.

Uninstalling

Deactivate and delete the workflows, remove the Error workflow setting from your workflows, then DROP SCHEMA rak CASCADE;.