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)
| # | Bug | Lokasi | Gejala | Fix |
|---|---|---|---|---|
| 1 | Wrong field name | Set Node | $json.customer_name padahal inputnya nama | Ganti ke $json.nama |
| 2 | Missing credential | Sheets Node | "No credential found" | Connect Google credential |
| 3 | Wrong condition | If Node | Route salah — "VIP" vs "vip" (case) | .toLowerCase() atau samakan case |
| 4 | No fallback | Switch Node | Data ga match → hilang | Tambah fallback output |
| 5 | Expression error | Email Node | {{ $json.amount.toLocaleString() }} tapi amount masih string | Number($json.amount).toLocaleString() |
| 6 | Missing return | Code Node | Code Node output kosong | Tambah 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 Found | Points |
|---|---|
| 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 |
| Total | 100 pts |
📋 Debrief (Setelah Hunt)
- Bug mana yang paling tricky?
- Apa strategi debug kamu?
- 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?