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
| Key | Default | Meaning |
|---|---|---|
instanceLabel | production | Prefix on every message, e.g. [client-acme]. Useful when one Slack channel receives several instances. |
alertChannel | slack | slack sends {text}, discord sends {content} (max 1900 chars), generic sends {title, level, text, lines, meta, source, version}. |
alertWebhookUrl | placeholder | Where messages go. Workflows refuse to run with the placeholder, so you never think alerts work when they don't. |
n8nBaseUrl | placeholder | Your 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
| Key | Default | Meaning |
|---|---|---|
suppressWindowMinutes | 30 | The 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. |
ignoreManualRuns | true | Failures from editor test runs are stored but not alerted. |
Error classes and default handling:
| Class | Typical cause | Retryable | Default severity |
|---|---|---|---|
auth | 401/403, expired OAuth token, invalid key | no | high |
rate_limit | 429, quota | yes | low |
timeout | request timed out | yes | low |
network | DNS, connection refused/reset | yes | low |
upstream_5xx | 5xx from the API | yes | low |
validation | 4xx, bad data, code errors | no | medium |
unknown | anything else | no | medium |
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:
maxErrorsPerWindowor more failed/crashed runs withinerrorWindowMinutes. - 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):
| Field | Required | Meaning |
|---|---|---|
action | no (claim) | claim, complete or release. |
idempotencyKey | yes | The provider's stable event id. Max 500 chars; hash longer keys. |
source | no | Free label, e.g. stripe. |
leaseSeconds | no (300) | How long a claim blocks other runs. Clamped to 10–86400 s. Set it longer than your slowest successful run. |
resultRef | no | On complete: id of what you created (invoice id, row id), for audit. |
payload | no | Passed back unchanged so the rest of your flow keeps its data. |
Output decision:
| Decision | Meaning | What to do |
|---|---|---|
process | First claim, or a released/expired claim was reclaimed | Do the side effect, then complete. |
duplicate | The event was already completed | Stop. |
in_progress | Another run holds a live lease | Stop. If that run dies, the lease expires and a provider retry gets process. |
completed / released | Answer to complete / release | — |
not_found | complete/release for a key that was never claimed | Check 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):
| Source | Key expression | ||
|---|---|---|---|
| Stripe | {{ $json.body.id }} (evt_…) | ||
| Shopify | {{ $json.headers['x-shopify-webhook-id'] }} | ||
| GitHub | {{ $json.headers['x-github-delivery'] }} | ||
| Typeform / Tally / forms | the response or submission id | ||
| Your own API | require an Idempotency-Key header | ||
| No id available | hash 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:
headersin 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
| Key | Default | Meaning |
|---|---|---|
dryRun | true | Report only. |
retrySafeWorkflowIds | [] | Allowlist. Nothing outside it is ever retried. |
retryableErrorClasses | rate_limit, timeout, network, upstream_5xx | auth and validation are deliberately excluded: retrying them repeats the failure, or worse. |
maxAttemptsPerExecution | 2 | Per original failed execution. |
backoffMinutes | [15, 60] | Minimum wait before attempt 1, attempt 2… |
minAgeMinutes / maxAgeHours | 5 / 24 | Candidate window. |
maxRetriesPerRun | 10 | Caps 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.