Running and Testing Workflows

Difficulty
2/10
Tags
EssentialsManual TriggerEdit Fields (Set)ExpressionsJSON

Building workflows is only half the battle. You also need to know how to run them, test them, and fix them when something goes wrong.

n8n provides powerful tools for understanding what your workflow is doing. In this lesson, you'll learn to use these tools by debugging a broken workflow.

What you'll practice:

  • Running workflows in different modes
  • Reading error messages
  • Inspecting data at each step
  • Finding and fixing bugs

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

The exercise workflow has a bug. It should output:

{
  "full_name": "John Smith",
  "email": "john.smith@example.com"
}

But something is wrong. Find the bug, fix it, and verify the output is correct.

Hint: The bug is in the second Edit Fields node.

Get the exercise workflow

Create a free account to copy exercises into your n8n editor.

Hints

  1. Run the workflow by clicking Execute
  2. Look for the red error indicator on any node
  3. If there's no error, click each node to inspect the output data
  4. Compare the actual output to what's expected
  5. In this case, check the Edit Fields node that creates full_name
  6. The expression has a typo - it references $json.firstname but the field is called first_name (with underscore)
  7. Fix the expression and run again to verify

Explanation

The bug:

The expression {{ $json.firstname }} references a field that doesn't exist. The actual field name is first_name (with an underscore).

How to find bugs like this:

  1. Look for red nodes - Nodes with errors are marked in red after execution
  2. Check the output - Even without errors, the output might be wrong (like undefined or missing data)
  3. Trace backwards - Start from the incorrect output and work backwards to find where things went wrong
  4. Check field names - Typos in field names are the most common bug in n8n

Expression debugging tip:

When you're inside an expression field, you can see available fields by typing $json. - n8n will show you what fields exist. This helps avoid typos.

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

How was this lesson?

Get the solution workflow

Create a free account to copy solutions into your n8n editor.

Related Content

Continue your learning journey with these related lessons and guides: