SuperAPI AI Directory

n8n: execution failure handling

n8n's error handling documentation, introducing how to gracefully handle workflow execution failures through error workflows. Contents include: methods for investigating failed executions (viewing execution records, enabling log streaming), steps for setting up an error workflow (creating an error workflow using the Error Trigger node and specifying it in the settings of the target workflow), the data structure received by the error workflow (availability conditions for the execution and trigger fields), and using the Stop And Error node to intentionally trigger a workflow failure to test error handling. Suitable for scenarios that need to add error monitoring and alerting to n8n automation processes.

Open website

About this tool

n8n's error handling documentation provides mechanisms for gracefully handling execution errors in workflow design.

Purpose: To help users respond in a controlled way when an n8n workflow execution fails, such as sending email or Slack alerts, and to facilitate investigating the cause of failures.

Main capabilities:

  • Investigating errors: You can view the execution records (Executions) of a single workflow or all accessible workflows, and load data from previous executions into the current workflow; you can also enable log streaming.
  • Setting up an error workflow: Each workflow can specify an error workflow in Workflow Settings, which runs automatically when that workflow execution fails. The error workflow must use the Error Trigger node as its first node. The same error workflow can be reused by multiple workflows.
  • Data received by the error workflow: By default, the error data includes information such as execution and trigger. Among these, execution.id and execution.url require the execution record to have been saved to the database; if the error occurs at the trigger node of the main workflow, they will not appear; execution.retryOf appears only when the execution is a retry of a failed execution. If the error is caused by the trigger node of the main workflow, the data sent to the error workflow has less execution{} information and more trigger{} information.
  • Intentionally failing a workflow: You can use the Stop And Error node to force a workflow to fail under specified conditions, thereby triggering the error workflow, which is useful for testing error handling logic.

How to use:

  1. Create a new workflow, use Error Trigger as the first node, and name it (for example, Error Handler).
  2. In the workflow where you need to monitor errors, select Options > Settings, select the error workflow you just created in Error workflow, and then save. After that, when the workflow errors, the associated error workflow will run.

Applicable scenarios: Scenarios that need to add error monitoring, alerting, and fault investigation capabilities to n8n automation processes.

Limitations: The documentation does not provide specific limitations on the number of error workflows, execution frequency, or performance impact; the availability of some data fields (such as execution.id, execution.url) depends on whether the execution is saved to the database and the stage at which the error occurs.