tpg-zalo-listener

n8n trigger node that listens to Zalo (personal account) messages using the open-source zca-js library. Emits { message: { type, data, threadId, isSelf }, isVoiceMessage } per message.

Documentation

n8n-nodes-tpg-zalo-listener

n8n trigger node Zalo Listener Trigger (TPG): nghe tin nhắn Zalo (cá nhân + nhóm) bằng thư viện mã nguồn mở
zca-js (MIT). Không có khóa/giấy phép riêng, không gọi máy chủ nào ngoài Zalo.

Mỗi tin nhắn = một item, cùng dạng với trigger Zalo cũ:

{ "message": { "type": 1, "data": { "msgType": "webchat", "content": "...", "dName": "...", "ts": "..." }, "threadId": "...", "isSelf": false }, "isVoiceMessage": false }

Cài đặt

n8n → Settings → Community Nodes → Install → n8n-nodes-tpg-zalo-listener.

Credential "Zalo Listener (TPG) API"

Lấy cả ba giá trị từ CÙNG một trình duyệt đã đăng nhập chat.zalo.me:

  1. Cookie (JSON): tiện ích Cookie-Editor → Export as JSON (dạng [ {...}, ... ]).
  2. IMEI: F12 → Console → localStorage.getItem('z_uuid').
  3. User-Agent: F12 → Console → navigator.userAgent.

Lưu ý

  • Zalo chỉ cho một phiên nghe mỗi tài khoản. Bật workflow (hoặc bấm "Listen for test event") sẽ đẩy phiên khác ra ngoài.
  • Khi Zalo đóng kết nối vì đăng nhập nơi khác (mã 3000/3003), node báo lỗi để n8n kích hoạt lại workflow.
  • zca-js là API không chính thức: dùng có thể bị Zalo khóa tài khoản, tự chịu rủi ro.
  • Kiểm thử offline (không đăng nhập Zalo thật): npm test.

Discussion