zalo-bot

Community node for n8n to integrate with Zalo Bot Platform (send messages, get profiles, webhooks)

Documentation

n8n-nodes-zalo-bot

Community node for n8n to integrate with Zalo Bot Platform.

Installation

Community Node (Recommended)

In n8n, go to Settings > Community Nodes and install:

@baoplh/n8n-nodes-zalo-bot

Manual Install

cd ~/.n8n/nodes
npm install @baoplh/n8n-nodes-zalo-bot

Then restart n8n.

Features

Zalo Bot Node

  • Bot Operations:

    • getMe - Get bot information
    • getUpdates - Get updates from bot
    • setWebhook - Configure webhook
    • deleteWebhook - Delete webhook
    • getWebhookInfo - Get webhook information
  • Message Operations:

    • sendMessage - Send text message
    • sendPhoto - Send photo
    • sendSticker - Send sticker
    • sendChatAction - Show typing status

Zalo Bot Trigger (Webhook)

Webhook trigger to receive events from Zalo Bot:

  • Auto-register webhook on activation
  • Validate requests with secret token
  • Support all event types
  • Requires public URL (for production)

Zalo Polling Bot Trigger ⭐

Polling trigger to receive messages from Zalo Bot without public URL:

  • No public domain required - Perfect for local development and testing
  • ✅ Works behind firewall/NAT
  • ✅ Easy setup - Just activate and start receiving messages
  • Configurable polling interval (default: 3000ms)
  • Support multiple event types (message, text, photo, sticker)
  • Auto-start/stop with workflow activation

Use Cases:

  • 🔧 Local development and testing
  • 🏠 Self-hosted n8n without public domain
  • 🔒 Secure environments with restricted network access
  • 💡 Quick prototyping without webhook setup

Configuration

Credentials

Create a new credential with type Zalo Bot API:

  1. Access Token: Your bot token (format: BOT_ID:SECRET_TOKEN)
  2. Secret Key: (Optional) Key for webhook signature verification

Get Bot Token

  1. Visit Zalo Bot Platform
  2. Create a new bot or select an existing one
  3. Copy the Bot Token from dashboard

Usage Examples

Send Message

  1. Add Zalo Bot node
  2. Select Resource: Message
  3. Select Operation: sendMessage
  4. Enter Chat ID and Text

Receive Webhook

  1. Add Zalo Bot Trigger node
  2. Configure Secret Token (auto-generated if left empty)
  3. Activate workflow
  4. Webhook will be automatically registered
  5. Note: Requires n8n with public HTTPS URL

Polling Mode - No Public URL Required! 🚀

Perfect for local development and self-hosted instances:

  1. Add Zalo Polling Bot Trigger node
  2. Configure Polling Interval (default: 3000ms)
    • Shorter interval = faster response, more API calls
    • Longer interval = slower response, fewer API calls
  3. Select event types to listen for:
    • message - All messages
    • text - Text messages only
    • photo - Messages with photos
    • sticker - Sticker messages
  4. Activate workflow - That's it! No webhook configuration needed

Comparison:

Feature Webhook Trigger Polling Trigger
Public URL ✅ Required ❌ Not Required
Real-time ✅ Instant ⚠️ Near real-time
Setup Complex Simple
Firewall Must allow inbound Works anywhere
Best for Production Development/Testing

Development

Build

pnpm run build

Development mode

pnpm run dev

Publish

# Patch version
pnpm run release:patch

# Minor version
pnpm run release:minor

# Major version
pnpm run release:major

License

MIT

Links

Discussion