Module 3 Lesson 5: Testing & Debugging
·Automation

Module 3 Lesson 5: Testing & Debugging

Fail fast. Learn how to test individual nodes in isolation, read the execution JSON, and find the 'Needle in the haystack' when a workflow fails.

Module 3 Lesson 5: Testing & Debugging

Building a workflow is only 50% of the job. The other 50% is fixing it when it breaks. "Debug" is the most common button you will press in n8n.

1. The "Step Through" Method

Don't run the whole workflow at once.

  1. Select a node.
  2. Click "Execute Node."
  3. Inspect the Output on the right.
  • Is the email spelled correctly?
  • Is the number a string or an integer?

2. Reading the JSON (The Source of Truth)

Every node has a Toggle at the top: Table view vs JSON view.

  • Table view is pretty.
  • JSON view is Accurate. Always check the JSON if an expression isn't working. You might find hidden nested fields or "Null" values that the table view hid from you.

Visualizing the Process

graph TD
    Start[Input] --> Process[Processing]
    Process --> Decision{Check}
    Decision -->|Success| End[Complete]
    Decision -->|Retry| Process

3. The "Pin Data" Feature

If you are testing an "Email Sent" node, you don't want to actually send 50 emails to your boss while you are debugging.

  • Click the "Pin" icon on the input data.
  • Now, the node will "Freeze" that data. You can re-run the node 100 times, and it will use the pinned data instead of asking the previous (possibly expensive or slow) node for new info.

4. Execution Logs (Looking at the Past)

Found in the Sidebar.

  • You can filter by "Failed" executions.
  • You can click an old execution and see EXACTLY what data was present at every single node at that moment in time.

Exercise: The Debugging Detective

  1. Create a workflow that intentionally fails (e.g., an HTTP Request to a fake URL like https://aksjdhfkajsdh.com).
  2. Execute the workflow.
  3. Open the red node. What is the Error Message?
  4. Pin some "Mock" data to a SET node.
  5. Why is "Pinning" essential when you are working with a trigger like "New Stripe Payment"?
  6. Research: How do you "Disable" a node so the workflow skips over it during a test?

Summary

You have completed Module 3: The n8n Workflow. You now know how to start a workflow, transform data with action nodes, write custom code, direct the flow with logic, and debug when things go wrong.

Next Module: The language of data: Module 4: Working with Data (JSON, Strings, Math).

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn