Skip to content

Durasi: 13 menit | Block: 5 Format: Gamified active learning


🎯 Goal

Peserta latihan debug workflow yang sengaja dibikin broken. Temukan dan fix semua bug.


🐛 Workflow: "Order Processor" (6 Bug)

Instruksi: Download/import workflow JSON ini ke n8n. Ada 6 bug. Temukan dan fix.


Bug Hunt List (Untuk Instructor)

#BugLokasiGejalaFix
1Wrong field nameSet Node$json.customer_name padahal inputnya namaGanti ke $json.nama
2Missing credentialSheets Node"No credential found"Connect Google credential
3Wrong conditionIf NodeRoute salah — "VIP" vs "vip" (case).toLowerCase() atau samakan case
4No fallbackSwitch NodeData ga match → hilangTambah fallback output
5Expression errorEmail Node{{ $json.amount.toLocaleString() }} tapi amount masih stringNumber($json.amount).toLocaleString()
6Missing returnCode NodeCode Node output kosongTambah return { json: ... }

Workflow JSON (Broken Version)

json
{
  "name": "Bug Hunt - Order Processor",
  "nodes": [
    {
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "parameters": {
        "httpMethod": "POST",
        "path": "order-process"
      }
    },
    {
      "name": "Format Data",
      "type": "n8n-nodes-base.set",
      "parameters": {
        "values": {
          "string": [
            {"name": "customer", "value": "=\{{ $json.customer_name }}"},
            {"name": "product", "value": "=\{{ $json.product }}"},
            {"name": "amount_str", "value": "=\{{ $json.amount }}"}
          ]
        }
      }
    },
    {
      "name": "Check VIP",
      "type": "n8n-nodes-base.if",
      "parameters": {
        "conditions": {
          "string": [{
            "value1": "=\{{ $json.tier }}",
            "operation": "equal",
            "value2": "VIP"
          }]
        }
      }
    },
    {
      "name": "Route",
      "type": "n8n-nodes-base.switch",
      "parameters": {
        "rules": [
          {"value": "express", "output": 0},
          {"value": "regular", "output": 1}
        ]
      }
    },
    {
      "name": "Notify Sales",
      "type": "n8n-nodes-base.emailSend",
      "parameters": {
        "subject": "Order Rp \{{ $json.amount_str.toLocaleString() }}",
        "body": "Order from \{{ $json.customer }}"
      }
    },
    {
      "name": "Transform",
      "type": "n8n-nodes-base.code",
      "parameters": {
        "jsCode": "const items = $input.all();\nconst total = items.reduce((s, i) => s + i.json.amount, 0);\n// missing return"
      }
    }
  ]
}

🏆 Scoring

Bug FoundPoints
Bug 1 (field name)10 pts
Bug 2 (credential)10 pts
Bug 3 (case sensitivity)20 pts
Bug 4 (no fallback)20 pts
Bug 5 (type conversion)20 pts
Bug 6 (missing return)20 pts
Total100 pts

📋 Debrief (Setelah Hunt)

  1. Bug mana yang paling tricky?
  2. Apa strategi debug kamu?
  3. Bug mana yang paling sering terjadi di production?

Debug Strategy Checklist

  • [ ] Check execution log → node mana yang merah?
  • [ ] Klik node merah → baca error message
  • [ ] Check Output tab → data apa yang keluar?
  • [ ] Check expression → field name match?
  • [ ] Check credential → connected?
  • [ ] Check data type → string vs number?
  • [ ] Check logic → condition correct?
  • [ ] Check Code Node → ada return?

Bootcamp AI Automation — akala.id