Overview
In this tutorial, you will learn how to effectively debug and handle errors in your AI automation workflows built with n8n. By understanding workflow executions, exploring execution logs, and configuring node error handling settings, you'll be able to quickly identify issues, troubleshoot errors, and build more resilient workflows. This guide covers both manual and automated executions, interpreting execution logs, common causes of failures, and practical techniques to manage errors gracefully.
For faster development cycles, consider combining these debugging techniques with Mock Data Testing in n8n to simulate inputs without relying on live APIs.
Understanding Workflow Executions and Execution Logs in n8n
What Is a Workflow Execution?
A workflow execution in n8n refers to a single run of your automation workflow. This can happen in two ways:
- Manual Execution: Triggered by clicking the
Execute Workflowbutton in the n8n editor. - Production Execution: Occurs automatically when the workflow is activated and triggered by an event or schedule.
Each execution processes data through the configured nodes, performing the specified automation steps.
What Are Execution Logs?
Execution logs track every workflow execution, recording:
- The workflow triggered
- Execution status (success, error, cancelled, etc.)
- Start time and runtime duration
- Trigger type (manual or production)
- Input and output data for each node
These logs are invaluable for debugging because they show exactly what happened during an execution, including any errors encountered.
For more details on how n8n manages execution data, you can review the n8n data pinning documentation{:target="_blank"} which explains how input and output data is stored and accessed.
Accessing and Using Execution Logs in n8n
Navigating to Execution Logs
- Log into your n8n workspace (cloud or self-hosted).
- Open your project and locate the Executions tab.
- Here, you will see a list of all past workflow executions with details like status, runtime, and type.
Filtering Executions
You can filter executions by:
- Workflow name
- Status (success, error, cancelled, etc.)
- Date and time range
Note: Advanced data search within execution logs is available only on higher-tier plans (e.g., Pro plan).
Interpreting Execution Log Details
Click on a specific execution to view:
- Trigger information: Whether the execution was manual or triggered by an event/schedule.
- Node execution data: Input and output data for each node.
- Error messages: Detailed error descriptions if the execution failed.
Example: Viewing Output Data
When you select a node in the execution view, you can see its output data in JSON format. This helps you verify if the node processed data correctly or identify where things went wrong.
Differentiating Manual and Production Executions
- Manual executions are triggered by you during testing and are marked with a test icon in the execution logs.
- Production executions happen automatically once the workflow is activated and triggered. These are marked differently and may include scheduled or event-based triggers.
You can activate a workflow by adding an automatic trigger (e.g., a Schedule Trigger) and toggling the active/inactive button.
Managing Execution Log Storage
You can configure whether executions are saved in the logs via workflow settings:
- Open your workflow.
- Click the three dots (
...) menu and select Settings. - Adjust these options:
- Save failed production executions (default: save)
- Save successful production executions (default: save)
- Save manual executions (default: save)
This helps you control storage and focus on logging only the executions you care about.
Debugging Workflow Errors Using Execution Logs
Step-by-Step Error Investigation
- Identify failed executions in the Executions tab.
- Click on the failed execution to open detailed logs.
- Locate the node where the error occurred.
- Read the error message to understand the cause.
- Inspect input and output data to see what data caused the failure.
Common Error Types You May Encounter
- Misconfigured nodes: Incorrect parameters or missing required settings.
- Service downtime: External APIs (like Gmail or Notion) returning 4xx or 5xx errors.
- Invalid or missing data: For example, an invalid email address in an email-sending node.
- Authentication/Authorization errors: Expired API keys or revoked credentials.
- Logic errors: Incorrect conditional expressions or unhandled boundary cases.
If you want to speed up fixing these issues, check out our guide on how to Fix AI Automation Workflows in n8n.
Practical Example: Troubleshooting an Email Sending Error
Imagine a workflow triggered by a webhook that sends thank-you emails to customers. The execution fails with an error message:
Problem in node "Send Thank You Email": Bad Request - sender invalid parameter value
By examining the execution log, you discover the email field contains invalid or empty emails like @jennaiunplugged or empty strings. This indicates the source form allows invalid inputs and needs validation.
Configuring Node Error Handling Settings
To make your workflows more resilient and reduce failures, you can configure node settings as follows:
1. Retry on Fail
- In the node's Settings tab, enable Retry On Fail.
- Configure the number of retries and delay between retries.
- Useful for handling temporary service outages or transient errors.
Example settings:
{
"maxRetries": 3,
"retryDelay": 1000 // milliseconds
}
2. On Error Behavior
By default, a node failure stops the entire workflow. You can change this behavior:
- Stop Workflow (default): Halts the workflow on error.
- Continue On Error (Regular Output): Ignores errors and continues processing other items, but errors are silently suppressed.
- Continue On Error (Error Output): Sends failed items to an error output branch, allowing you to handle errors explicitly within the workflow.
Example: Using Error Output for Fine-Grained Error Handling
- Set On Error to Continue On Error (Error Output).
- The node will output two branches: success and error.
- You can connect the error branch to another workflow or node to log errors, notify teams, or perform corrective actions.
For more detailed information, refer to the n8n Error Handling Documentation{:target="_blank"}.
Troubleshooting Tips and Common Mistakes
- Ignoring errors silently: Using "Continue On Error (Regular Output)" suppresses errors, which might hide issues. Prefer using the error output branch to handle errors explicitly.
- Not validating input data: Always validate incoming data (e.g., email formats) before processing.
- Not configuring retries: Without retries, temporary API glitches can cause workflow failures.
- Overlooking execution log filters: Use filters to quickly find relevant executions when logs grow large.
- Confusing manual and production executions: Remember manual runs are for testing and won't trigger production triggers.
To improve overall workflow performance and reduce debugging time, consider learning how to Optimize n8n Workflows.
Summary: Best Practices for Debugging and Error Handling in n8n
- Use execution logs actively to review workflow runs and pinpoint errors.
- Configure node retry settings to handle transient errors gracefully.
- Use error output branches for detailed error management and reporting.
- Validate data before processing to prevent avoidable failures.
- Adjust execution log saving settings to optimize storage and debugging needs.
- Monitor external service health and API changes to anticipate failures.
Quick Reference Cheat Sheet
| Term | Description |
|---|---|
| Execution | One run of a workflow, manual or automatic |
| Execution Log | Record of past workflow executions with detailed info |
| Manual Execution | Triggered by clicking Execute Workflow button |
| Production Execution | Triggered by an activated workflow's event or schedule |
| Retry On Fail | Node setting to automatically retry failed attempts |
| On Error (Stop Workflow) | Default behavior that stops workflow on node failure |
| On Error (Continue Output) | Continue processing items even if some fail |
| Error Output Branch | Separate output branch for failed items to handle errors |
Additional Resources
- n8n Execution Overview{:target="_blank"}
- n8n Error Handling Documentation{:target="_blank"}
By mastering these debugging and error handling techniques, you will enhance the reliability of your AI automation workflows and reduce downtime caused by unexpected failures. As shown in the video above, leveraging execution logs and node error settings is key to efficient workflow maintenance and troubleshooting.