Based on a tutorial by MCBII
Are you looking to create an automated Zalo chatbot to streamline your business operations? Or maybe you want to integrate Zalo with other automation workflows?
In this comprehensive guide, I’ll summarize the detailed tutorial from MCBII’s channel on how to use N8N to create a fully functional Zalo chatbot. From basic setup to advanced workflows including AI integration, bulk messaging, and group member management.
Quick Navigation
- Installing N8N Zalo Node and Initial Configuration (00:00-08:30)
- Zalo Login via QR Code (08:31-12:15)
- Creating Basic Workflow – Auto Reply Messages (12:16-18:45)
- Telegram Integration – Send from Telegram to Multiple Zalo Groups (18:46-28:30)
- Extract Zalo Group Members to Google Sheets (28:31-35:20)
- Building AI-Powered Zalo Chatbot (35:21-end)
Installing N8N Zalo Node and Initial Configuration
To get started with Zalo automation, you’ll need to install the Zalo node for N8N. This is a community node developed by Cảng Phạm and is completely free to use.

Installation Steps:
- Install Node: Go to Settings → Community nodes → Install the node with the provided name
- Create API Key: Navigate to Personal → Settings → N8N API → Create API key (select no expiration)
- Create Credential: Set up N8N account credential with the API key you just created
- URL Endpoint: Enter your exact N8N instance URL (without trailing slash)
The Zalo node provides 5 main functional groups:
- Zalo User: Friend management, user search, accept friend requests
- Zalo Group: Create groups, add/remove members, get group information
- Zalo Message: Send messages to individuals or groups
- Zalo Message Trigger: Listen for incoming messages
- Zalo Login via QR Code: Authenticate with Zalo
Personal Experience:
I recommend setting up N8N on a VPS from the start if you’re serious about automation. The VPS cost is just a few dollars per month, but the flexibility is significantly higher than the cloud version.
Zalo Login via QR Code
After installing the node and setting up credentials, the next step is to authenticate with Zalo to get a session.
Authentication Process:
- Select the “Zalo login via QR code” node
- Choose the N8N account credential you just created
- If using an overseas VPS, configure a Vietnam proxy
- Click “Test step” to display the QR code
- Open Zalo on your phone and scan the QR code
- After successful login, click Save
After successful authentication, the system will create a new “Zalo API” credential in your Credentials section. You can rename this credential for easier management.
Pro Tip:
Name your credentials using the format “Zalo_AccountName” to easily distinguish between multiple Zalo accounts.
Creating Basic Workflow – Auto Reply Messages
Your first workflow will help you understand how Zalo Message Trigger works and how to set up automatic message responses.
Basic Workflow Structure:
- Zalo Message Trigger: Listen for incoming messages
- Processing Logic: Distinguish between personal and group messages
- Zalo Message: Send automatic replies
Message Trigger Configuration:
// Message type distinction:
// type = 0: Personal message (user)
// type = 1: Group message (group)
// Get sender ID:
{{ $json.uidFrom }} // ID of message sender
// Get message content:
{{ $json.message.data.content }} // Text content
In the demo workflow, the system automatically responds with “Hello, just testing” when receiving messages. You can customize the response logic based on message content or sender ID.
Real-world Applications:
This workflow can be expanded into auto-reply for fan pages, automated customer service, or notification bots for work groups.
Telegram Integration – Send from Telegram to Multiple Zalo Groups
This workflow allows you to send messages from a Telegram topic to multiple Zalo groups simultaneously – very useful for marketing or bulk notifications.
Workflow Structure:
- Telegram Message Trigger: Receive messages from specific topic
- IF Node: Filter messages by chat ID and thread ID
- Multiple Zalo Message Nodes: Send to different groups
Telegram Message Filtering Configuration:
// IF Conditions:
{{ $json.message.chat.id }} // Chat ID of Telegram group
{{ $json.message.message_thread_id }} // Thread ID of topic
// Get message content:
{{ $json.message.text }} // Message content
In the video demo, the creator sends announcements about the AI Automation Club community from Telegram, and the message gets distributed to 3 different Zalo groups simultaneously.
Why Use Telegram as Intermediary:
According to the creator, sending from Telegram is more stable and avoids direct spam from Zalo. Additionally, Telegram has a better management interface for bot control.
Extract Zalo Group Members to Google Sheets
This workflow helps extract member lists from Zalo groups and save them to Google Sheets for management or analysis purposes.
Process Flow:
- Get Group Info: Retrieve group information and member list
- Split Out: Split member list into individual items
- Loop through Get User Info: Get details for each member
- Google Sheets: Save information to spreadsheet
Member Data Processing:
// Aggregate node to avoid expression errors:
{{ $json.memberList }} // Member list from group info
// Split out configuration:
// Input: memberList
// Include: Binary Data = false
// Information retrieved for each user:
// - Display Name
// - Zalo ID
// - Avatar URL
// - Date of Birth (if available)
In the demo, the system extracts information from 40 members of a test group and saves it to Google Sheets with columns: Display Name, Zalo ID, Avatar. The creator hid date of birth information to protect privacy.
Real-world Applications:
This workflow is useful for member list backups, demographic analysis, or preparing data for targeted marketing campaigns.
Building AI-Powered Zalo Chatbot
The final workflow is a complete AI chatbot that can answer questions based on data from the creator’s YouTube channel and WordPress site.
AI Chatbot Features:
- Content Search: Scans database of YouTube videos and WordPress articles
- Message Classification: Handles text, images, videos, stickers
- Trigger Conditions: Only activates when mentioned or contains “@AI” keyword
- AI Agent: Uses Gemini 2.0 Pro for intelligent responses
Trigger Condition Configuration:
// Activation conditions:
1. Message contains "@AI"
2. Message is a mention (reply)
3. Thread ID matches specific group
// Message classification:
{{ $json.msgType }} // text, photo, video, file, sticker
// Get content:
{{ $json.message.data.content }} // Text content
The chatbot is integrated with an AI Agent that has 2 main tools:
- YouTube Tool: Search within crawled video database
- WordPress Tool: Search within blog articles from mcba.vn
When receiving questions related to existing content, the bot returns relevant YouTube video links or blog articles. For general questions, the bot uses AI to provide answers.
Expansion Potential:
This is a foundation for building customer service bots, FAQ bots, or personal assistant bots. You can integrate additional data sources like CRM, product databases, etc.