n8n-nodes-zalo-stephen
v0.9.19
Published
Các node hỗ trợ Zalo cho n8n
Maintainers
Readme

n8n-nodes-zalo
A comprehensive n8n community node package for automating Zalo (Vietnamese messaging platform) workflows. This package enables seamless integration between n8n and Zalo, allowing you to automate messaging, group management, user interactions, and more—all within your own n8n instance with complete data privacy and security.
🔑 Key Features
- 🔐 Secure Cookie-Based Authentication - Login using JSON cookies with IMEI for secure authentication
- 💬 Message Automation - Send messages to users or groups programmatically
- 👥 Group Management - Full control over Zalo groups (create, manage members, change settings)
- 👤 User Management - Manage friends, block/unblock users, search users
- 📊 Poll Management - Create and manage polls in groups
- 🏷️ Tag Management - Organize contacts with tags
- ⚡ Real-time Triggers - Listen to incoming messages and friend requests
- 🔒 Privacy-First - All operations run within your n8n instance, no third-party API dependencies
- 🌐 Proxy Support - Optional proxy configuration for international VPS deployments
📦 Available Nodes
1. Zalo Login 🔐
Authenticate with Zalo using Cookie JSON and IMEI.
Features:
- Cookie JSON-based authentication
- Automatic credential creation via n8n API
- Proxy support for international IPs
- IP location detection with recommendations
2. Zalo Send Message 💬
Send messages to Zalo users or groups.
Features:
- Send text messages to users or groups
- Support for message urgency levels (Default, Important, Urgent)
- Quote/reply to existing messages
- File attachments support
3. Zalo Message Trigger 📨
Real-time webhook trigger for incoming Zalo messages.
Event Types:
- User messages
- Group messages
- Self-message listening (optional)
4. Zalo Group 👥
Complete group management operations.
Operations:
createGroup- Create a new groupgetGroupInfo- Get group informationgetAllGroups- List all groupsgetGroupMembers- Get group member listaddUserToGroup- Add members to groupremoveUserFromGroup- Remove members from groupaddGroupDeputy- Add group deputy/adminchangeGroupName- Change group namechangeGroupAvatar- Change group avatarcreateNote- Create notes in group
5. Zalo User 👤
Manage user profiles and friend relationships.
Operations:
getUserInfo- Get user informationgetAllFriends- Get all friends listfindUser- Search users by phone numbersendFriendRequest- Send friend requestacceptFriendRequest- Accept friend requestblockUser- Block a userunblockUser- Unblock a userchangeAccountSetting- Change account settingschangeAliasName- Change friend alias name
6. Zalo Poll 📊
Create and manage polls in groups.
Operations:
createPoll- Create a new pollgetPollInfo- Get poll informationgetPollVoters- Get poll voters listvotePoll- Vote on a pollclosePoll- Close a poll
7. Zalo Tag 🏷️
Organize contacts with tags.
Operations:
- Create, update, and manage contact tags
8. Zalo Friend Trigger 👥
Webhook trigger for friend request events.
Events:
- New friend requests
- Friend request accepted
🚀 Installation
Community Nodes (Recommended)
For n8n v0.187+ users, you can install this package directly from the Community Nodes panel:
- Open your n8n editor
- Go to Settings > Community Nodes
- Search for
n8n-nodes-zalo-stephen - Click Install
- Reload the n8n editor
Manual Installation
You can also install this package manually:
cd YOUR_N8N_INSTALLATION_DIRECTORY
npm install n8n-nodes-zalo-stephenNote: There's also an Update button available within Community Nodes for easy updates.
📖 Login Guide - Cookie JSON Authentication
This package uses Cookie JSON authentication with IMEI (required). The IMEI must be retrieved from browser localStorage, not from cookies. Follow these detailed steps to get your credentials.
⚠️ Important: Understanding IMEI
IMEI is Required and Must be Provided Manually
- IMEI is stored in browser
localStoragewith keyz_uuid - IMEI is NOT stored in cookies
- You must retrieve IMEI separately from cookies
- IMEI is mandatory for authentication
Method 1: Using Zalo Cookies Extension (Recommended) ⭐
The easiest way to get both Cookies and IMEI.
Step 1: Install Zalo Cookies Extension
- Open Chrome Web Store: Zalo Cookies Extension
- Click Add to Chrome to install
- Pin the extension to your toolbar for easy access
Step 2: Login to Zalo Web
- Open Zalo Web in your browser
- Login with your Zalo account credentials
- Wait until you're fully logged in (you should see your chat list)
Step 3: Extract Cookies and IMEI
- Click the Zalo Cookies extension icon in your browser toolbar
- The extension will automatically display:
- Cookies JSON - A JSON array in a text area
- IMEI - A separate field showing the
z_uuidvalue
- Copy both values:
- Click Copy button next to Cookies JSON (or select all and copy)
- Copy the IMEI value
What the extension shows:
┌─────────────────────────────────────┐
│ Zalo Cookies Extension │
├─────────────────────────────────────┤
│ Cookies JSON: │
│ [{"name":"...","value":"..."},...] │
│ [Copy Button] │
├─────────────────────────────────────┤
│ IMEI: │
│ abc123xyz789... │
│ [Copy Button] │
└─────────────────────────────────────┘Method 2: Using Cookie Editor Extension (Alternative)
If you prefer Cookie Editor or Zalo Cookies Extension is not available:
Step 1: Install Cookie Editor Extension
- Install Cookie Editor Extension
- Login to Zalo Web
Step 2: Export Cookies
- Click the Cookie Editor extension icon
- Navigate to Export tab
- Select format: JSON
- Copy the exported JSON array
Step 3: Get IMEI from Browser Console
Important: IMEI must be retrieved separately from localStorage!
- On the Zalo Web page, press
F12(or right-click → Inspect) to open Developer Tools - Click the Console tab
- Type or paste this command and press Enter:
localStorage.getItem('z_uuid') - The console will display a string value like:
"abc123xyz789..." - Copy this value - this is your IMEI
Console Example:
> localStorage.getItem('z_uuid')
< "550e8400-e29b-41d4-a716-446655440000"Method 3: Manual Export (Advanced Users)
For users who want complete control:
Step 1: Export Cookies Manually
- Open Zalo Web and login
- Press
F12→ Go to Application tab (Chrome) or Storage tab (Firefox) - In the left sidebar: Cookies →
https://chat.zalo.me - Select all cookies visible in the list
- Manually format as JSON array:
[ { "name": "cookie_name_1", "value": "cookie_value_1", "domain": ".zalo.me", "path": "/" }, { "name": "cookie_name_2", "value": "cookie_value_2", "domain": "chat.zalo.me", "path": "/" } ]
Step 2: Get IMEI from Console
Follow the same steps as Method 2, Step 3 above.
Step 4: Configure the Login Node in n8n
Now that you have both Cookies JSON and IMEI, configure the Zalo Login node:
Basic Configuration
- Add Zalo Login Node to your workflow
- Fill in required fields:
- Cookie JSON: Paste the entire cookies JSON array you copied
- IMEI: Paste the IMEI value (the
z_uuidfrom localStorage) - User Agent: Leave empty (will be extracted automatically) OR paste from browser DevTools
- Proxy: Leave empty unless using international VPS
Node Configuration Example:
┌─────────────────────────────────────┐
│ Zalo Login │
├─────────────────────────────────────┤
│ Cookie JSON: │
│ [{"name":"c_user","value":"123"} │
│ ,{"name":"xs","value":"abc"}] │
│ │
│ IMEI: │
│ 550e8400-e29b-41d4-a716-... │
│ │
│ User Agent: (optional) │
│ [empty - auto extract] │
│ │
│ Proxy: (optional) │
│ [empty] │
└─────────────────────────────────────┘Advanced: Auto Credential Creation
Enable automatic credential creation via n8n API:
- Enable Auto Create Credential: Toggle ON
- Set Credential Name: Default is "Zalo API Credentials"
- Configure n8n Account Credential:
- URL: Your n8n instance URL (default:
http://localhost:5678) - API Key: Found in n8n Settings → API → Generate API Key
- URL: Your n8n instance URL (default:
- Execute the node - Credentials will be created automatically!
Note: If auto-creation fails, the node output will show manual creation instructions with all required values.
📋 Cookie JSON Format Reference
Your Cookie JSON must follow this exact format:
[
{
"name": "cookie_name_1",
"value": "cookie_value_1",
"domain": ".zalo.me",
"path": "/"
},
{
"name": "cookie_name_2",
"value": "cookie_value_2",
"domain": "chat.zalo.me",
"path": "/"
}
]Format Requirements:
- Must be a valid JSON array (starts with
[and ends with]) - Each cookie is an object with
name,value,domain, andpath - Domain should be
.zalo.meorchat.zalo.me - Path is typically
/ - All cookies should be from the same Zalo session
✅ Quick Reference Checklist
Before executing the Login node, ensure you have:
- [ ] Cookie JSON: Valid JSON array with all cookies from Zalo Web session
- [ ] IMEI: Copied from
localStorage.getItem('z_uuid')(required!) - [ ] Cookies exported while actively logged in to Zalo Web
- [ ] All cookies have domain
.zalo.meorchat.zalo.me - [ ] (Optional) User Agent - can be auto-extracted
- [ ] (Optional) Proxy - only if VPS has non-Vietnamese IP
⚠️ Important Notes & Troubleshooting
IMEI Requirements
- ✅ IMEI is MANDATORY - Login will fail without it
- ✅ IMEI is stored in
localStorage, NOT in cookies - ✅ Use
localStorage.getItem('z_uuid')in browser console - ❌ Don't try to extract IMEI from cookie values
Cookie Requirements
- ✅ Export cookies while you're logged in (active session)
- ✅ Cookies must include all session cookies (typically 10-20 cookies)
- ✅ Domain must be
.zalo.meorchat.zalo.me - ❌ Expired cookies will cause authentication failure
- ❌ Missing important cookies (like session tokens) will fail
Common Errors and Solutions
Error: "Missing required params: IMEI"
- Solution: Make sure you copied the IMEI from
localStorage.getItem('z_uuid'), not from cookies
Error: "Cookie validation failed"
- Solution: Re-export cookies while actively logged in to Zalo Web. Ensure all cookies are included.
Error: "Login failed: Missing required params"
- Solution: Check that Cookie JSON is a valid JSON array format, and IMEI is not empty
Login works but messages fail
- Solution: Cookies may be expired. Re-export fresh cookies and update credentials.
Proxy Configuration
When to use Proxy:
- Your VPS/server is located outside Vietnam
- Zalo requires additional verification for non-Vietnamese IPs
- You're experiencing connection timeouts
Proxy Format:
https://username:password@proxy-host:portExample:
https://user:[email protected]:8080The Login node will detect your IP location and recommend proxy usage if needed.
🔄 Common Workflows
Workflow 1: Auto-Reply to Messages
Zalo Message Trigger → Function (Process Message) → Zalo Send MessageUse Case: Automatically reply to incoming messages with predefined responses.
Workflow 2: Group Member Management
Schedule Trigger → Zalo Group (getGroupMembers) → Process Data → Zalo Group (addUserToGroup/removeUserFromGroup)Use Case: Automatically manage group members based on conditions.
Workflow 3: Message Forwarding
Zalo Message Trigger → Filter (Check Conditions) → Zalo Send Message (Forward to Another User/Group)Use Case: Forward messages from one user/group to another.
Workflow 4: Friend Request Automation
Zalo Friend Trigger → Function (Check User Info) → Zalo User (acceptFriendRequest)Use Case: Automatically accept friend requests based on criteria.
Workflow 5: Poll Management
Schedule Trigger → Zalo Poll (createPoll) → Zalo Send Message (Notify Group)Use Case: Create and manage polls on a schedule.
Workflow 6: Bulk Message Sending
Google Sheets (Get Contacts) → Loop → Zalo Send MessageUse Case: Send messages to multiple contacts from a spreadsheet.
⚠️ Warning and Disclaimer
Please read this carefully before using the Zalo nodes:
⚠️ Important Disclaimer: The use of this library may violate Zalo's Terms of Service. Using automation tools with Zalo could result in your account being disabled or banned. We are not responsible for any consequences that may arise from using this package. Please use at your own risk and discretion.
🙏 Credits
We would like to extend our gratitude to:
- ZCA-JS - The underlying library that makes Zalo automation possible
📝 License
👨💻 Author
- Stephen - GitHub
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the GitHub repository.
Made with ❤️ for the n8n community
