All guides

Original explainer

n8n error workflows: diagnose a failed execution

Connect an Error Trigger workflow to the main workflow and distinguish node failures, trigger failures and missing execution fields.

AI Nav CityWritten / Updated Sources checked

When an AI workflow fails, preserve information that identifies the execution before choosing a retry. Based on the official error-handling page, this guide explains how to establish an Error Handler and interpret its fields. The intended output is an error workflow that makes the failure traceable. Start by inspecting received data without requiring delivery to another application.

Action and checking sequence

  1. Create the handler

    Create and save a workflow starting with Error Trigger.[1]

  2. Link the main workflow

    Select the handler in the main workflow Error workflow setting.[1]

  3. Inspect failure data

    Inspect workflow, execution or trigger fields according to the failure.[1]

Check the input, action and result at each step; see the final section for execution scope.

Connect error handling to the main workflow

  • Create a new workflow with Error Trigger as its first node, name it Error Handler and save it.
  • In the main workflow, open Options → Settings, select Error Handler under Error workflow and save.
  • Multiple main workflows can share the handler; use the received workflow fields to distinguish their origins.

[1]

The documentation says the linked error workflow runs when a main execution fails. Saving configuration only establishes the linkage; a controlled failure is needed to observe triggering and payload fields. Begin by displaying or retaining the necessary diagnostic fields before deciding on downstream actions.[1]

Do not assume execution.id always exists

The documentation says execution.id and execution.url depend on the execution being saved. If the main workflow trigger fails, the workflow has not executed and those fields can be absent. execution.retryOf exists only for a retry of a failed execution. Trigger failures have a different shape with more trigger information. Check field presence before constructing an execution link.[1]

Inspect the diagnostic path with a controlled failure

Original exercise: in a disposable main workflow, add a valid input field. When it is false, use the documented Stop And Error node to make execution fail. Inspect whether Error Handler receives workflow identification, error information and applicable execution fields. Separately inspect a trigger-stage failure so the handler tolerates missing execution fields. Use synthetic inputs for the exercise.[1]

Diagnose before choosing a retry

The documentation lists Executions for reviewing failures and loading previous execution data, as well as Log streaming. Repair malformed input or node settings according to the failure. Whether a retry is appropriate depends on side effects and idempotency in your workflow. No n8n login, workflow creation, failure trigger, notification or retry was executed here; only official steps and field descriptions were reviewed.[1]

Article sources

Original editorial content; official descriptions and checking suggestions are distinguished.

  1. n8n · Official sources
    View details