To effectively debug n8n workflows, you must first inspect the data at each step of your automation. Start by running your workflow manually and checking the input and output tabs of each node to understand the data flow. For past failures, use the ‘Executions’ tab to load the exact data from a failed run directly into your editor, allowing you to replicate and fix the issue. For more complex problems, especially in self-hosted instances, you can increase the system’s log verbosity by setting the N8N_LOG_LEVEL
environment variable to debug
for more detailed error messages.
We’ve all been there. You spend hours crafting the perfect automation, it works flawlessly during your tests, and you deploy it with a sense of pride. Then, silence. Or worse, you check the logs and see a sea of red. A production run has failed, and you have no idea why. Let’s be honest, debugging can feel like being a detective without any clues. But what if I told you that n8n gives you a full forensic kit? You just need to know where to look.
The First Line of Defense: Debugging in the n8n UI
Before you dive into server logs or complex code editors, your first stop should always be the n8n canvas itself. It’s packed with powerful, user-friendly tools designed to help you pinpoint problems quickly.
Inspecting Node-by-Node Execution Data
This is the absolute cornerstone of how to debug n8n. When you click Test workflow, n8n executes each node sequentially. Once it finishes (or fails), you can click on any node to see exactly what happened.
- Input Data: Shows the data the node received from the previous node.
- Output Data: Shows the data the node produced after its operation.
Is the data structure what you expected? Did a field you rely on suddenly come through as null
? 90% of the time, comparing the input to the output of a failing node will tell you exactly what went wrong. It’s the simplest yet most powerful trick in the book.
The Power of “Pinning”: Using Past Execution Data
Now, here’s where it gets really interesting. What if a workflow that runs on a schedule failed overnight? You can’t just ‘test’ it again. This is where a fantastic feature comes into play: re-running with past data.
- Navigate to the Executions tab in your workflow.
- Find the specific execution that failed (it’ll be marked in red).
- Click on it, and you’ll see an option: Debug in editor.
Clicking this magically loads the exact data from that failed run into your editor and “pins” it to the trigger node. Now you can run the workflow manually, step-by-step, with the very data that caused the crash. No more guessing, no more trying to replicate weird edge cases. You have the culprit’s data right in front of you.
A Simple Trick: The NoOp Node as a Breakpoint
Sometimes you don’t want to stop the whole flow, you just want to see what the data looks like at a specific point, especially in a complex workflow with multiple branches. My go-to tool for this is the NoOp node (short for “No Operation, do nothing”). You can drop this little guy anywhere in your workflow to act as a clean breakpoint. It receives data and passes it through unchanged, but it allows you to pause and inspect the data stream at that exact spot.
Real-World Case Study: The Missing Company Name
Let’s make this practical. Imagine a workflow: a Webhook receives new lead data, an HTTP Request node enriches it with company info from an API, and a Google Sheets node adds the new lead to a spreadsheet.
The Problem: The workflow fails intermittently on the Google Sheets step.
Debugging Steps:
- Use Past Data: We find a failed execution and click Debug in editor. The lead data that caused the crash is now pinned to our Webhook.
- Manual Execution: We execute the workflow node by node. The Webhook passes the data. The HTTP Request node runs successfully.
- Inspect the Data: We click on the HTTP Request node and check its output. Ah-ha! The enriching API, for this specific lead, couldn’t find a company and returned a
null
value for thecompany_name
field. - The Discovery: Our Google Sheets node was configured to always receive a string for the company name. When it got
null
instead, it crashed. - The Fix: We add an IF node right after the HTTP request. It checks: “Is the
company_name
field empty?” If true, we can route it down a path that uses a Set node to assign a default value like “N/A” before sending it to the Google Sheets node. Problem solved, and our workflow is now more resilient.
For the Power Users: Advanced Debugging
Sometimes, the problem isn’t the data—it’s the environment, a custom node, or a sneaky configuration issue.
Configuring n8n’s Log Level
If you’re self-hosting n8n, you have access to detailed application logs. By default, n8n logs general information, but you can crank up the verbosity. This is done with an environment variable:
export N8N_LOG_LEVEL=debug
Setting the log level to debug
will output a huge amount of information to your console or log file, often revealing underlying errors that the UI can’t show, like specific API error codes, timeouts, or memory issues.
Log Level | Description |
---|---|
error |
Only shows critical errors that stopped an execution. |
warn |
Shows errors and potential issues (warnings). |
info |
Default. Shows general progress and lifecycle events. |
debug |
Maximum verbosity. Shows everything. Great for deep dives. |
Debugging Custom Nodes in VS Code
For those of you building your own n8n nodes (you’re the real heroes!), trying to debug them can be tough. The key is to run n8n in a way that your code editor’s debugger can attach to it. In the n8n community, a reliable method has emerged for VS Code users.
You’ll need to create a launch.json
file in your .vscode
directory with a special configuration. Crucially, you also need to set an environment variable, EXECUTIONS_PROCESS=main
. Why? By default, n8n cleverly runs each workflow in a separate process to keep things stable. However, this means your debugger, attached to the main process, can’t see what’s happening. This variable forces the workflow to run in the main process, making it visible to your debugger.
This is definitely an advanced topic, but it showcases the incredible flexibility and developer-friendliness of the n8n platform.
Ultimately, debugging isn’t a chore; it’s a skill. And with the tools n8n provides, you’re well-equipped to solve any problem that comes your way. Start with the UI, dig into the logs when you need to, and never be afraid to get your hands dirty. Happy automating!