Artifact Sesi 3 | Routing + branching + external data
📋 Workflow Spec
Name: Lead Router v2
Pattern: Trigger → Classify → Route → Notify/Log
[Webhook Trigger (POST)]
│
▼
[Set Node: Extract & Classify]
│
▼
[Switch Node: Route by category]
├── "sales" → [Slack: #sales] + [Sheets: log]
├── "support" → [Email: support team]
├── "billing" → [Sheets: billing log]
└── (fallback) → [Email: general inbox]Node Details
1. Webhook Trigger
| Setting | Value |
|---|---|
| Method | POST |
| Path | inquiry-router |
2. Set Node
| Field | Value |
|---|---|
| nama | {{ $json.body.nama }} |
{{ $json.body.email }} | |
| pesan | {{ $json.body.pesan }} |
| category | {{ $json.body.category }} |
| source | {{ $json.body.source }} |
| timestamp | {{ $now.format('DD/MM/YYYY HH:mm') }} |
3. Switch Node
| Output | Condition | Target |
|---|---|---|
| 0 | {{ $json.category }} equals "sales" | Sales path |
| 1 | {{ $json.category }} equals "support" | Support path |
| 2 | {{ $json.category }} equals "billing" | Billing path |
| 3 | Fallback | General path |
4. Output Nodes (per path)
Each path has notification node with enriched data.
Test Payloads
json
// Sales inquiry
{"nama": "Budi", "email": "budi@email.com", "pesan": "Mau tahu harga produk X", "category": "sales", "source": "website"}
// Support inquiry
{"nama": "Ani", "email": "ani@email.com", "pesan": "Produk saya rusak", "category": "support", "source": "whatsapp"}
// Billing inquiry
{"nama": "Citra", "email": "citra@email.com", "pesan": "Tagihan saya belum update", "category": "billing", "source": "email"}Checklist
- [ ] Webhook menerima data
- [ ] Switch node meroute dengan benar
- [ ] Semua output path jalan
- [ ] Fallback path ada dan jalan
- [ ] External integration (Sheets/Email/Slack) connect