n8n-nodes-zalo-v1
v2.1.9
Published
n8n node for Zalo automation
Downloads
1,604
Maintainers
Readme
n8n-nodes-zalo-v1
This is an n8n community node that allows you to interact with Zalo messaging platform in your n8n workflows.
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the installation guide in the n8n community nodes documentation.
Community Node Installation
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-zalo-v1in the Enter npm package name field - Agree to the risks and select Install
Troubleshooting: "The specified package could not be loaded"
If you encounter this error, it's a known n8n issue with stale files. Fix it by running:
./fix-n8n-install.shOr manually:
# Stop n8n
docker stop <your-n8n-container>
# Clear nodes directory
docker exec <container> rm -rf /home/node/.n8n/nodes/*
# Start n8n
docker start <your-n8n-container>
# Then install via n8n UI againSee TROUBLESHOOTING.md for more details.
Manual Installation
To install the node locally for development:
# Clone the repository
git clone https://github.com/TechxnixLLC/n8n-nodes-zalo-v1.git
cd n8n-nodes-zalo-v1
# Install dependencies
npm install
# Build the node
npm run build
# Link the node to n8n
npm link
cd ~/.n8n/nodes
npm link n8n-nodes-zalo-v1Features
Main Node: Zalo User
The Zalo User node supports the following operations:
Message Resource
- Send Message - Send text messages to users or groups
- Send Sticker - Send stickers
- Send Image - Send images
- Send Link - Share links
Friend Resource
- Send Friend Request - Send friend requests
- Accept Friend Request - Accept incoming friend requests
- Get All Friends - Retrieve list of all friends
- Block User - Block specific users
Group Resource
- Create Group - Create new groups
- Add User to Group - Add users to existing groups
- Remove User from Group - Remove users from groups
- Change Group Name - Update group names
- Create Poll - Create polls in groups
Get Resource
- Get All Friends - Get list of friends
- Get All Groups - Get list of groups
- Get User Info - Get information about specific users
- Get Last Message - Retrieve last message from a thread
Trigger Node: Zalo User Trigger
The trigger node listens for real-time events:
- New Message - Trigger on new messages
- Friend Request - Trigger on friend requests
- Group Event - Trigger on group events
- All Events - Trigger on any Zalo event
Filter Options
- Filter by specific user IDs
- Filter by specific group IDs
- Keyword filtering
- Option to exclude self messages
Credentials
To use this node, you need to set up Zalo User API credentials:
Authentication Methods
QR Code (Recommended for first-time setup)
- Scan QR code with Zalo mobile app
Cookie (For automated workflows)
- Extract cookie from browser after logging into Zalo Web
- Open browser console and run:
document.cookie - Copy the entire cookie string
Required Fields
- Authentication Method: Choose QR Code or Cookie
- Cookie: Your Zalo session cookie (if using Cookie method)
- IMEI: Device identifier (optional, auto-generated if not provided)
- User Agent: Browser user agent string
Usage Example
Send a Message Workflow
- Add the Zalo User node to your workflow
- Select Message as the resource
- Choose Send Message operation
- Enter the recipient's Thread ID
- Select Thread Type (User or Group)
- Enter your Message text
- Execute the node
Listen for New Messages
- Add the Zalo User Trigger node
- Select New Message as event type
- Set polling interval (default: 5 seconds)
- Optionally configure filters
- Activate the workflow
Important Notes
⚠️ Placeholder Implementation
This is a template/starter implementation with placeholder responses. To make it fully functional, you need to:
Integrate with actual Zalo API:
- Use official Zalo API from https://developers.zalo.me
- Or integrate with libraries like
zalo-api-final - Or implement browser automation
Replace placeholder responses in:
nodes/ZaloUser/ZaloUser.node.tsnodes/ZaloUser/ZaloUserTrigger.node.ts
Implement real authentication in credentials
QR Login Node
The package includes a dedicated Zalo Login node that handles authentication:
- Login with QR Code - Displays QR code in terminal for scanning
- Login with Cookies - Authenticate using existing credentials
- Validate Credentials - Check if session is still valid
Uses the zca-js library (v2.0.4) for lightweight, reliable Zalo API access without requiring a browser.
API Integration Options
Option A: zca-js (Recommended - Already Included)
npm install zca-jsLightweight Zalo API wrapper with built-in authentication. See: https://www.npmjs.com/package/zca-js
Option B: Official Zalo API
npm install axiosRegister your app at https://developers.zalo.me and use OAuth tokens.
Option C: Community Libraries
npm install zalo-api-finalUse community-maintained Zalo libraries.
Development
Build the project
npm run buildWatch mode for development
npm run devLint the code
npm run lint
npm run lintfixFormat the code
npm run formatResources
License
Support
For issues and questions:
- Open an issue on GitHub
- Check n8n community forum
Version History
0.1.0
- Initial release
- Basic node structure with placeholder implementations
- Support for Message, Friend, Group, and Get resources
- Trigger node for real-time events
- Zalo Login node with QR code authentication
- zca-js integration for reliable API access
- Cookie and credential-based authentication methods
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
