본문으로 건너뛰기
Skillpedia
자동화23k · #10128

n8n-error-handling

하는 일

n8n 워크플로에서 오류를 잡고, 명확한 상태 코드를 반환하고, 네트워크 단계를 다시 시도하고, 문제가 생기면 누군가에게 알리는 방법을 설명합니다. 사람 없이 돌아가는 n8n 자동화나 웹훅을 운영하는 분들을 위한 스킬입니다.

사용하는 경우

  • ✓다른 시스템이 의존하는 n8n 웹훅이나 API를 만들 때.
  • ✓예약된 n8n 워크플로가 실패했는데 아무도 눈치채지 못할 때.
  • ✓일시적인 네트워크 문제로 실패하는 단계를 n8n이 다시 시도하게 하고 싶을 때.

스킬 링크

https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-error-handling/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-error-handling/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“n8n 웹훅이 단계가 실패하면 명확한 오류 코드를 반환하고 저에게 알리도록 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 각 단계의 실패를 자체 오류 분기로 보내고, 응답 상태를 원인에 맞게 설정하며, 그 분기를 통과한 나머지 오류를 위해 워크플로 수준의 오류 처리기를 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

n8n Error Handling

By default, when an n8n node throws, the whole workflow halts. For an interactive run you're watching, that's fine — you see the red node and fix it. For anything unattended (a webhook API, a cron job, a queue worker, an agent tool), it's the wrong default: the caller gets a timeout or an empty 500, the operator gets no alert, and the symptom is "the integration just stopped working" with no log and no clue.

This skill is about making failures loud, structured, and recoverable — and, best case, self-healing so transient blips never reach a human at all.

The two ideas that prevent most silent failures:

  • Per-node error outputs — a node's failure routes down a second output you control, instead of killing the run.
  • A workflow-level error workflow — a catch-all that fires for anything that escapes per-node handling (timeouts, crashes between nodes, unwired failures).

When you actually need this

Workflow shape Error handling posture
Webhook / API (anything with Respond to Webhook) Required. Every fallible node's error output wired; status code matches cause.
Scheduled / cron / queue worker / agent tool (unattended) Required. A workflow-level error workflow, plus retryOnFail on network nodes.
Internal one-off you run and watch yourself Optional. Default onError: "stopWorkflow" is fine — you'll see the red node and re-run.

The dividing line: if anyone other than you sees the output — a downstream system, an end user, an on-call engineer — the failure has to be handled, not swallowed. If you're the only watcher and the cost of failure is "I notice and re-run", looser is fine.


The #1 silent trap: per-node error output is a TWO-step setup

This is the single most common way an n8n workflow "handles" errors while actually swallowing them. Routing a node's failure to a handler takes two changes, and doing only one looks complete but misbehaves:

  1. Set onError: "continueErrorOutput" on the node. This is what creates the second output. Without it, main[1] doesn't exist no matter what you wire.
  2. Wire that error output (connections.<node>.main[1], i.e. sourceIndex: 1) to a real handler. Without a target, the error data is emitted into the void.

Get one without the other and you hit a failure mode:

What you did What happens at runtime
onError set, error output not wired Error data is silently discarded. Downstream doesn't fire. The dashboard shows the run as succeeded. Worst case — no error logged anywhere.
Error output wired, onError not set The slot never fires; the handler is unreachable. On failure the workflow just halts (default stopWorkflow).
Both done Failure routes down main[1] to your handler. ✅

Doing both with n8n_update_partial_workflow

// 1) Turn on the error output (creates main[1])
{ type: "updateNode", nodeName: "HTTP Request",
  changes: { onError: "continueErrorOutput" } }

// 2) Wire the error output to a handler. sourceIndex: 1 = the error output.
{ type: "addConnection",
  source: "HTTP Request",
  target: "Handle Error",
  sourceIndex: 1 }

sourceIndex: 0 is the success path, sourceIndex: 1 is the error path. (For IF nodes the aliases branch: "true"/"false" map to index 0/1; for a generic fallible node, use the explicit sourceIndex: 1.)

Then verify. This trap doesn't surface in validate_workflow — a half-wired error output validates clean. Pull the workflow with n8n_get_workflow and confirm both halves:

  • The node's onError is "continueErrorOutput".
  • connections["HTTP Request"].main[1] contains your handler.

Valid onError values:

Value Effect
"stopWorkflow" (default) Error halts the whole workflow.
"continueRegularOutput" Error item flows out the normal output. Rare, usually wrong — downstream gets error-shaped data and keeps going.
"continueErrorOutput" Error item flows out the separate error output (main[1]). The one you wire.

Full failure-mode catalog, fan-in/fan-out shapes, and verification: NODE_ERROR_OUTPUTS.md.


Self-healing first: retryOnFail before you wire error paths

Before you build error branches, absorb the transient failures so they never reach those branches. On any node that calls a network service — HTTP Request, comms (Gmail/Slack/Discord), databases, AI nodes,

자주 묻는 질문

오류 하나 때문에 워크플로 전체가 멈추는 이유는 무엇인가요?

기본적으로 n8n은 단계가 실패하면 워크플로를 멈춥니다. 직접 지켜보는 실행에는 적합하지만, 사람 없이 도는 실행에는 위험합니다.

재시도 설정이란 무엇인가요?

실패한 단계를 다시 시도하게 하는 설정입니다. 스킬은 네트워크 단계에 이 설정을 권합니다.

별도의 오류 워크플로가 필요한가요?

사람 없이 돌아가거나 예약된 워크플로라면, 스킬은 전체를 잡아내는 용도로 워크플로 수준의 오류 워크플로를 권합니다.

상세 정보

작성자의 원본 설명

Wire n8n error handling so failures are loud, structured, and recoverable. Use when building any webhook/API workflow, a scheduled or unattended workflow, or any path where a silent failure would drop user-visible work — and whenever the user mentions error handling, onError, continueErrorOutput, error branches/outputs, retries, retryOnFail, Respond to Webhook status codes, 4xx/5xx, Error Trigger, or "my workflow fails silently". Covers per-node error outputs and wiring, retry/self-healing, error-trigger workflows, and 4xx/5xx response shapes.

repo: czlonkowski/n8n-mcp

인기도

GitHub 스타
23k
순위
#10128
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬