Configuration reference

All settings live in the Config Code node at the start of each workflow. They are plain JavaScript object literals: keep the commas and quotes.

Shared keys

KeyDefaultMeaning
instanceLabelproductionPrefix on every message, e.g. [client-acme]. Useful when one Slack channel receives several instances.
alertChannelslackslack sends {text}, discord sends {content} (max 1900 chars), generic sends {title, level, text, lines, meta, source, version}.
alertWebhookUrlplaceholderWhere messages go. Workflows refuse to run with the placeholder, so you never think alerts work when they don't.
n8nBaseUrlplaceholderYour instance URL, no trailing slash. The API key is not stored here; it lives in the n8n API Header Auth credential.

To route to Microsoft Teams, Telegram, email or PagerDuty, set alertChannel: 'generic' and point alertWebhookUrl at a small n8n webhook workflow that forwards the payload. Or replace the Send Alert node with the matching n8n node and map {{$json.alertPayload.text}}.

RAK-01 Error Router

KeyDefaultMeaning
suppressWindowMinutes30The same failure (same workflow + node + message with ids/numbers stripped) alerts once per window. Every occurrence is still stored.
criticalWorkflowIds[]Always critical severity (rate limits stay high).
ignoreWorkflowIds[]Stored, never alerted.
ignoreManualRunstrueFailures from editor test runs are stored but not alerted.

Error classes and default handling:

ClassTypical causeRetryableDefault severity
auth401/403, expired OAuth token, invalid keynohigh
rate_limit429, quotayeslow
timeoutrequest timed outyeslow
networkDNS, connection refused/resetyeslow
upstream_5xx5xx from the APIyeslow
validation4xx, bad data, code errorsnomedium
unknownanything elsenomedium

An explicit HTTP status code wins over message text. If Postgres is unreachable, RAK-01 still alerts and says so in the message.

RAK-02 Silent Failure Watchdog

watched: list of { workflowId, name, maxSilenceMinutes, errorWindowMinutes, maxErrorsPerWindow }.

  • stale: no execution started within maxSilenceMinutes, or no executions at all. Catches dead schedules, broken webhooks and expired trigger credentials, the cases the Error workflow never sees.
  • failing: maxErrorsPerWindow or more failed/crashed runs within errorWindowMinutes.
  • recovered: sent once when a workflow returns to ok.
  • realertAfterMinutes (180): an open problem is repeated at most this often.

The watchdog reads the 100 most recent executions per workflow. n8n's execution pruning must keep at least maxSilenceMinutes of history (EXECUTIONS_DATA_MAX_AGE, default 14 days on recent versions).

RAK-03 Idempotency Gate

Input item (from Execute Workflow):

FieldRequiredMeaning
actionno (claim)claim, complete or release.
idempotencyKeyyesThe provider's stable event id. Max 500 chars; hash longer keys.
sourcenoFree label, e.g. stripe.
leaseSecondsno (300)How long a claim blocks other runs. Clamped to 10–86400 s. Set it longer than your slowest successful run.
resultRefnoOn complete: id of what you created (invoice id, row id), for audit.
payloadnoPassed back unchanged so the rest of your flow keeps its data.

Output decision:

DecisionMeaningWhat to do
processFirst claim, or a released/expired claim was reclaimedDo the side effect, then complete.
duplicateThe event was already completedStop.
in_progressAnother run holds a live leaseStop. If that run dies, the lease expires and a provider retry gets process.
completed / releasedAnswer to complete / release—
not_foundcomplete/release for a key that was never claimedCheck your key expression.

Choosing an idempotency key

Use an id the provider assigns to the event, never n8n's execution id (each retry gets a new one):

SourceKey expression
Stripe{{ $json.body.id }} (evt_…)
Shopify{{ $json.headers['x-shopify-webhook-id'] }}
GitHub{{ $json.headers['x-github-delivery'] }}
Typeform / Tally / formsthe response or submission id
Your own APIrequire an Idempotency-Key header
No id availablehash of the fields that define "the same request", e.g. `{{ $json.body.email + '' + $json.body.order_total + '' + $json.body.date }}`

If the downstream API supports idempotency keys itself (Stripe, many payment APIs), also send the same key as an Idempotency-Key header. That's defence in depth.

RAK-04 API Health Monitor

endpoints: list of { name, url, method, expectStatus, maxLatencyMs, bodyContains, headers, timeoutMs }.

  • expectStatus: number or array (default [200]).
  • bodyContains: optional string that must appear in the response body.
  • failureThreshold (2): consecutive failures before DOWN. One blip does not page you.
  • Alerts only on transitions (DOWN, RECOVERED); open incidents are listed on later transitions.
  • Secrets: headers in Config are stored in the workflow JSON. Prefer unauthenticated health/status endpoints. If you must authenticate, use a read-only, low-privilege token.

RAK-05 Daily Ops Report

  • Reads the last 250 executions from the API. If your instance runs more than 250 a day, the report marks the execution count as a floor. Incident, duplicate, recovery and health figures come from Postgres and are complete.
  • retentionDays (30): rows older than this are pruned after the report is sent.

RAK-06 Safe Recovery

KeyDefaultMeaning
dryRuntrueReport only.
retrySafeWorkflowIds[]Allowlist. Nothing outside it is ever retried.
retryableErrorClassesrate_limit, timeout, network, upstream_5xxauth and validation are deliberately excluded: retrying them repeats the failure, or worse.
maxAttemptsPerExecution2Per original failed execution.
backoffMinutes[15, 60]Minimum wait before attempt 1, attempt 2…
minAgeMinutes / maxAgeHours5 / 24Candidate window.
maxRetriesPerRun10Caps the blast radius of a bad hour.

A retry accepted by n8n is recorded as retried and never retried automatically again. If the retry itself fails, RAK-01 alerts on it like any other failure.