N8n102 - Hands-on Exercise: Webhook-Driven Order Processing System

Im at Step 3.11: Test and get your confirmation code. Earlier I passed the Test 1 and Test 2 in the
Webhook Tester. i dont know why Im back at step 1 test and it has error (see image 1). I have error in “OrderExists” IF NODE. The error says wrong type (see image2) but in the instruction said Id set the type STRING (see image3)

**
i reviewed all the instructions and check if I overlooked something then I cant find one. Is there someone got stuck in this situation before?**

Hi @leomel! That’s a classic issue with the new IF node (v2), and your own OUTPUT screenshot gives you the clue: “Wrong type: ‘7’ is a number but was expecting a string”. The order id arrives as a number (7), but the condition compares it as text and, by default, the IF validates the type strictly: it stops right there and execution fails, which is why it sends you back to Test 1 (the “Valid order returns 200” never gets to pass).

Two ways to fix it, either one works:

  1. In the condition itself, check the “Convert types where required” box (just below the field, the one that shows in your 2nd screenshot). You leave the type as String as the exercise asks and n8n converts the 7 on its own.
  2. Or force the text in the expression of the first field: {{ $json.id.toString() }}.
  3. The IF v2 caught me the same way the first time: you trust that “is empty” compares and that’s it, but it’s very picky about number vs string. Once I started using “Convert types where required” it stopped causing trouble.

One question to narrow it down: does the error only show up in the “OrderExists” IF or are some other IFs in the flow throwing the same “wrong type”? Let me know and we’ll keep going. I’m self-taught and more hands-on than theory, but I’ve definitely stepped on this one :slightly_smiling_face:

Thanks! I tried to go back and review all the nodes and instructions. I found out that in the image 3 the value should be {{ $json.order_id }} not {{ $json.id }}. That is why its expecting to be string. Now it has no error now in execution tab in both workflow and subworkflow but the Step 1 test in the Webhook Tester still has the same error like in the image 1. I dont know why there is an error there while in the execution tab there’s none. I’m still trying to figure it out. Hope I could pass this 2nd hands on course before I lose my mind lol. Thanks for the help by the way, really appreciate it.