Cara Menghubungkan n8n ke WhatsApp API Resmi & Gateway Praktis

Jawaban singkat: n8n punya 2 jalur WhatsApp — (1) WhatsApp Business API Resmi (node Official): butuh Phone Number ID + Access Token + Webhook HTTPS + Template approved, (2) Gateway Praktis (node Unofficial/HTTP): butuh scan QR / API Key + Webhook URL. Keduanya visual no-code. Artikel ini setup step-by-step keduanya, troubleshooting umum, dan kapan pilih mana.

Pilihan Jalur: API Resmi vs Gateway Praktis (Quick Decision)

Faktor WhatsApp Business API Resmi (Node Official) Gateway Praktis (Node Unofficial / HTTP Request)
Setup Time 1-7 hari (verifikasi bisnis Meta) 5-10 menit (scan QR)
Nomor WhatsApp Harus BERSIH (belum pernah daftar WhatsApp) Bisa pakai nomor existing (sudah dipakai)
Kredensial Phone Number ID + Access Token (System User) API Key / Token Gateway + Webhook URL
Webhook WAJIB: HTTPS domain sendiri + SSL valid Biasanya disediakan gateway (domain mereka)
Template Pesan WAJIB approved untuk inisiasi chat (Marketing/Utility) TIDAK perlu (balas chat masuk bebas)
Fitur Native Katalog, Tombol CTA, List, Flow, Click-to-WA Ads Teks, Gambar, File, Location, Contact
Biaya Per percakapan (Service GRATIS 1000/bln) Flat/bulanan Rp 0-150rb
Risiko Banned Sangat rendah (resmi Meta) Ada (mitigasi: provider terbukti + pola aman)
Node n8n “WhatsApp Trigger” & “WhatsApp Send” (Official) “WhatsApp Trigger (Unofficial)” / “HTTP Request”

Rekomendasi: Mulai Gateway Praktis (instan, murah, belajar). Migrasi ke API Resmi saat butuh: Katalog native, Tombol Beli, Click-to-WhatsApp Ads, Green Badge, Compliance ketat, Volume >10k/bln.

Jalur 1: Gateway Praktis (Unofficial) – Setup 10 Menit

Langkah 1: Pilih Provider Gateway

Kriteria: (a) >6 bulan operasi, (b) Keep-alive QR (auto re-koneksi), (c) Support responsif, (d) Dokumentasi n8n/webhook, (e) Limit harian cukup. Hindari gratisan random.

Langkah 2: Daftar & Dapatkan Kredensial

  • Daftar di dashboard gateway
  • Buat “Device” / “Instance” baru
  • Dapatkan: API Key / Token / Secret, Webhook URL (format: `https://gateway-domain.com/webhook/xxxx`)

Langkah 3: n8n – Setup Node WhatsApp (Unofficial)

  1. n8n → Workflow baru → Tambah Node: **”WhatsApp Trigger (Unofficial)”** (community node) ATAU **”HTTP Request”** (generic)
  2. Jika pakai HTTP Request:
    – Method: POST
    – URL: Webhook URL dari gateway
    – Headers: `Authorization: Bearer API_KEY`, `Content-Type: application/json`
    – Body: `{{JSON.stringify($json)}}`
  3. Jika pakai Community Node: Isi credential fields (API Key, Instance ID, dll)

Langkah 4: Konfigurasi Webhook di Gateway

  • Dashboard Gateway → Settings → Webhook
  • Set URL: `https://DOMAIN-ANDA/n8n/webhook/whatsapp` (harus HTTPS, domain sendiri)
  • Atau gunakan webhook URL gateway jika mereka provide (format: `https://gateway.com/webhook/xxx`)
  • Test: Kirim “Test” dari WhatsApp lain → Cek n8n Execution

Langkah 5: Scan QR & Test

  1. Dashboard Gateway → Device → “Connect” / “Scan QR”
  2. Buka WhatsApp di HP → Menu (3 titik) → Linked Devices → Link a Device → Scan QR
  3. Status: “Connected” / “Ready”
  4. Test: Chat dari nomor lain → Cek n8n Executions → Sukses

Jalur 2: WhatsApp Business API Resmi (Official) – Setup 1-7 Hari

Prasyarat (Wajib Siapkan Sebelum Mulai)

  • Meta Business Manager account (business.facebook.com)
  • Dokumen verifikasi: NPWP, NIB/Akte Pendirian, Website/Domain, Email Domain
  • Nomor Telepon BERSIH (belum pernah daftar WhatsApp / WhatsApp Business)
  • Domain sendiri dengan SSL valid (untuk Webhook HTTPS)

Langkah 1: Verifikasi Bisnis di Meta

  1. business.facebook.com → Buat Akun Bisnis / Pilih existing
  2. Business Settings → Brand Safety → Verifications → Start Verification
  3. Upload dokumen → Tunggu 1-7 hari kerja (status: “Verified”)

Langkah 2: Buat WhatsApp Business Account (WABA)

  1. Business Settings → WhatsApp Accounts → Add → “API”
  2. Isi: Nama Bisnis, Zona Waktu, Kategori Industri
  3. Submit → WABA Created (ID: `WABA_XXXXXXXXXX`)

Langkah 3: Daftarkan Nomor Telepon

  1. WABA → Phone Numbers → Add Phone Number
  2. Masukkan nomor bersih → Verifikasi via SMS/Call
  3. Dapatkan: **Phone Number ID** (format: `123456789012345`)

Langkah 4: Buat System User & Access Token

  1. Business Settings → Users → System Users → Add
  2. Nama: “n8n Bot” → Role: Admin → Next
  3. Assign Asset: Pilih WABA → Full Control → Save
  4. Generate New Token → Pilih: `whatsapp_business_management`, `whatsapp_business_messaging` → Copy Token (simpan aman, tidak expired)

Langkah 5: Setup Webhook di Meta (CRITICAL – Harus HTTPS Domain Sendiri)

  1. WABA → Configuration → Webhook → Edit
  2. Callback URL: `https://DOMAIN-ANDA/n8n/webhook/whatsapp` (harus valid SSL, bukan IP, bukan localhost)
  3. Verify Token: Buat random string (contoh: `n8n_whatsapp_webhook_2026_abc123`) → Simpan
  4. Subscribe Fields: Centang `messages`, `message_template_status_update`, `message_deliveries`, `message_reads`
  5. Verify & Save → Meta akan kirim challenge GET → n8n harus respond 200 OK dengan challenge string

Langkah 6: n8n – Setup Node WhatsApp Official

  1. n8n → Credentials → New → **”WhatsApp Business API”**
  2. Phone Number ID: (dari Langkah 3)
    Access Token: (System User Token dari Langkah 4)
  3. Workflow → Tambah Node: **”WhatsApp Trigger”** (Official) → Pilih Credential di atas
  4. Tambah Node: **”WhatsApp Send”** (Official) → Pilih Credential sama

Langkah 7: Buat Template Pesan (WAJIB untuk Inisiasi Chat)

  1. WABA → Message Templates → Create Template
  2. Kategori: **Utility** (untuk notifikasi/order) atau **Marketing** (promo)
  3. Nama: `order_confirmation`, `shipping_notification`, `welcome_message`
  4. Bahasa: Indonesian
  5. Header: Text / Media (opsional)
  6. Body: Template dengan variable `{{1}}`, `{{2}}` (contoh: “Halo {{1}}, pesanan {{2}} sudah dikonfirmasi.”)
  7. Footer: Opsional
  8. Buttons: Quick Reply / URL / Phone Number (opsional)
  9. Submit → Review biasanya <24 jam → Status: **APPROVED**

Langkah 8: Test End-to-End

  1. Chat ke nomor bisnis dari WhatsApp lain
  2. Cek n8n Executions → Trigger jalan → AI proses → Send balasan
  3. Kirim template test via Meta: Template → Send Test → Masukkan nomor test
  4. Verifikasi: Customer terima template, balas → Bot jawab

Troubleshooting Umum (Quick Fix)

Masalah Penyebab Solusi
Webhook verification failed (Meta) Callback URL tidak HTTPS / SSL invalid / domain salah / n8n tidak respond challenge Pastikan domain valid SSL, n8n webhook URL accessible public, n8n respond 200 OK dengan challenge string
“Invalid Phone Number ID” / “Invalid Token” Kredensial salah copy / token expired / Phone Number ID salah Copy ulang dari Meta: Phone Number ID (angka saja), System User Token (panjang, awalan `EAA…`)
Template REJECTED Kategori salah / Konten promotional di Utility / Variable format salah / Bahasa tidak didukung Baca alasan reject Meta → Perbaiki → Resubmit. Utility: transaksional. Marketing: promo.
Gateway: QR expired cepat / sering disconnect Provider tidak punya keep-alive / WhatsApp detect unofficial Ganti provider terbukti >6 bulan. Pola aman: delay, limit, tidak blast.
n8n Execution: “Connection refused” / “ECONNREFUSED” n8n tidak jalan / port salah / firewall block Cek `systemctl status n8n`, port 5678, firewall allow 5678, domain proxy (Nginx/Cloudflare) forward ke 5678
Gateway: “Rate limit exceeded” Kirim terlalu cepat / blast Tambah Delay node (2-5 detik), Limit batch (max 20/menit), Hindari broadcast massal

Migrasi Gateway Praktis → API Resmi (Saat Butuh)

  1. Setup API Resmi paralel (nomor baru bersih)
  2. Jalankan dual: Gateway (nomor lama) + API Resmi (nomor baru) sebulan
  3. Migrasikan data: Export KB Sheets, Import ke workflow baru (sama saja)
  4. Update workflow n8n: Ganti Node WhatsApp (Unofficial → Official), Kredensial baru
  5. Test penuh → Cutover: Umumkan nomor baru ke customer, forwarding nomor lama
  6. Decommission Gateway lama

Checklist Setup WhatsApp di n8n Minggu Ini

🚀 GATEWAY PRAKTIS (Mulai Hari Ini):

  • [ ] Pilih provider gateway terbukti (>6 bln, keep-alive, support)
  • [ ] Daftar, dapatkan API Key + Webhook URL
  • [ ] n8n: Tambah Node WhatsApp Unofficial / HTTP Request
  • [ ] Set Webhook di Gateway → URL n8n webhook
  • [ ] Scan QR di Gateway → Status Connected
  • [ ] Test: Chat dari nomor lain → n8n Execution sukses

🏢 API RESMI (Saat Butuh Fitur Native/Compliance):

  • [ ] Siapkan dokumen: NPWP, NIB, Domain, Email Domain, Nomor Bersih
  • [ ] Verifikasi Bisnis Meta (1-7 hari)
  • [ ] Buat WABA + Daftarkan Nomor Bersih → Dapat Phone Number ID
  • [ ] Buat System User + Token (whatsapp_business_messaging)
  • [ ] Setup Webhook Meta → Callback URL domain sendiri HTTPS + Verify Token
  • [ ] n8n: Credential WhatsApp Business API + Node Official Trigger & Send
  • [ ] Buat Template (Utility/Marketing) → Submit Review → Approved
  • [ ] Test End-to-End: Chat masuk → Bot jawab, Template kirim → Terima

FAQ: Menghubungkan n8n ke WhatsApp API

Apakah n8n punya node resmi WhatsApp Business API?

YA — n8n versi terbaru include node **”WhatsApp Business API”** (Official) untuk Trigger & Send. Credential: Phone Number ID + Access Token. Untuk Gateway Praktis: pakai Community Node “WhatsApp Unofficial” atau generic “HTTP Request” ke webhook gateway.

Kenapa API Resmi butuh domain sendiri HTTPS untuk webhook?

Meta requirement: Callback URL harus valid domain dengan SSL certificate (bukan IP, bukan localhost, bukan self-signed). n8n harus accessible public di port 443/80. Solusi: VPS + Domain + Nginx Proxy + SSL (Let’s Encrypt / Cloudflare) → forward ke n8n port 5678.

Bisa pakai nomor WhatsApp pribadi yang sudah ada untuk API Resmi?

TIDAK — API Resmi butuh nomor BERSIH (belum pernah daftar WhatsApp / WhatsApp Business). Solusi: Beli nomor baru khusus bisnis / gunakan nomor kantor yang belum dipakai WhatsApp. Gateway Praktis BISA pakai nomor existing (scan QR).

Berapa lama template approved di Meta?

Biasanya <24 jam. Kategori Utility (notifikasi/order) lebih cepat approved. Kategori Marketing (promo) lebih ketat. Pastikan format variable `{{1}}`, `{{2}}` benar, tidak promotional di Utility.

Template setup lengkap sudah jadi di mana?

Ebook + Template n8n — include: Dual-jalur workflow (Gateway + API Resmi), Setup guide lengkap dengan screenshot, Webhook configuration n8n + Nginx + Cloudflare, Template library (Utility/Marketing), Troubleshooting checklist, Migrasi guide, Compliance checklist.

Baca juga: Cara Menghubungkan n8n ke WhatsApp API Resmi & Gateway Praktis untuk panduan lengkapnya.

Scroll to Top