NIE EXPERTS SPAIN

Error-Handling Runbook

System Documentation · Node Agency

05 · Error runbook

Verified live 2026-06-30. What to do when a Discord error channel lights up. Written for both Christian (run-the-business: which channel means what, what to click) and devs (the recovery internals). Cross-refs: integrations 04-integrations.md, flow catalog 03-flow-catalog.md, audit AUDIT-FINDINGS.md.

The two-layer error model

The system alerts on errors in two layers that work together:

  1. Passive global net — NIE_LIB_ErrorHandler. Wired as the error workflow on n8n executions. Any uncaught node failure anywhere falls through to here and posts to #technical-errors. This is the safety net: if nothing more specific caught it, it lands here.
  2. Active typed router — NIE_LIB_DiscordError. Called deliberately at known failure points (PDF fill, Tasa, Drive, delivery) and routes to a specific channel with context. This is the diagnosis layer: the channel itself tells you what broke.

Christian: think of #technical-errors as "something unexpected broke — a dev should look", and the named channels (#ex-18-errors, #tasa-790-error, etc.) as "this specific step failed — here's what to check." A named channel is more actionable; #technical-errors usually needs Node.

Channel → meaning → cause → action

Discord channel What it means Likely cause What to do
#technical-errors Any uncaught n8n node failure, or missing practice_id (W09) Anything unhandled — schema drift, API down, bad payload Open the n8n execution, read the error node, retry the execution; if it repeats, escalate to Node
#ex-18-errors EX-18 PDF fill failed in W03 Template/field mapping issue or bad anagrafici Check the Fase-2 data for that practice; effect: token reset + practice marked pdf_generation_failed. Re-mint the token if the customer must re-submit
#tasa-790-error Tasa 790/012 generation failed in W03 Tasa endpoint/template issue W03 falls back to a stub so the EX-18 still ships — the Tasa may be missing. Regenerate the Tasa manually / check the Tasa endpoint
#drive-errors Drive share or upload failed (W03 / W05) Drive quota or permissions Check Drive quota/permissions. W05 attempts recovery automatically
#delivery-errors Email bounce or WhatsApp failure after ≥2 correction attempts (W05) Bad email/phone, persistent bounce Contact the client by another channel; verify the corrected contact details
#cliente-insoddisfatto A client was flagged dissatisfied (W20) Dissatisfaction score crossed threshold Human follow-up. Note: review-gating may be intentionally blocking a review request for this client
#chargeback A Stripe dispute opened (W10) Customer disputed the charge Gather evidence and respond in Stripe before the deadline

How recovery works automatically (devs)

The system is built to self-heal the common cases — do not rush to intervene before checking these:

What is NOT auto-handled — needs a human

Situation Why it needs you Reference
Tasa stub gap The stub keeps EX-18 on time but leaves the Tasa missing — someone must regenerate it #tasa-790-error
GDPR purge failure (W21) W21 has no own error/idempotency handling and no retry — a failed Drive delete only surfaces via the global net AUDIT-FINDINGS H8
Notion sync failure (W15) W15 has no per-node error handling — a sync can fail quietly; reconcile against Supabase AUDIT-FINDINGS H9
Anything in #technical-errors By definition uncaught — read the execution, retry, escalate to Node if it repeats

Christian: if a channel is in the "needs a human" table, the system will not fix it on its own. Everything else, give it a few minutes first — it usually recovers.