Overview
This node sends messages through the Zalo messaging platform using its API, authenticated via a cookie-based login. It supports sending text messages to either individual users or groups, with options for message urgency, quoting previous messages, mentioning users, and attaching images by URL.
Typical use cases include automating customer support replies, broadcasting announcements to groups, or integrating Zalo messaging into workflows that require notifications or alerts.
For example, you can send an urgent message quoting a previous conversation, mention specific users in the message, and attach one or more images hosted online.
Properties
| Name | Meaning |
|---|---|
| Thread ID | The ID of the thread (user or group) where the message will be sent. |
| Type | The type of the message recipient: "User" (individual) or "Group". |
| Message | The text content of the message to send. |
| Urgency | The urgency level of the message: "Default", "Important", or "Urgent". |
| Quote Message | Optional quoted message details including: Message ID, Sender ID, and Content to quote. |
| Mentions | Optional mentions within the message specifying User ID, position in text, and length of mention. |
| Attachments | One or more image attachments specified by public URLs. |
Output
The node outputs an array with one item per input message containing a JSON object with the following fields:
success: Boolean indicating if the message was sent successfully.response: The raw response from the Zalo API after sending the message.threadId: The ID of the thread where the message was sent.threadType: Numeric code representing user (0) or group (1).messageContent: The full message object sent, including text, urgency, quotes, mentions, and attachments if any.- If an error occurs and the node is set to continue on failure, the output includes:
success: falseerror: Error message describing what went wrong.
If attachments are included, the node downloads the images temporarily before sending and removes them afterward.
Dependencies
- Requires valid Zalo API credentials configured with a cookie, IMEI, and user agent string.
- Uses an external helper utility to download and remove image attachments.
- Relies on the
zca-jslibrary for interacting with the Zalo API. - Requires proper configuration of the credential containing the cookie and device info.
Troubleshooting
- Failed to initialize Zalo API: Indicates invalid or expired credentials. Verify the cookie and device information are correct.
- Zalo login error: Could be due to network issues or incorrect authentication data.
- Cannot send typing event: Non-critical; the node logs this but continues sending the message.
- Error sending Zalo message: May occur if thread ID is invalid, message content is missing, or API limits are exceeded. Check the error message for details.
- Ensure all required properties (
Thread ID,Message) are provided. - When using attachments, verify that image URLs are publicly accessible.
Links and References
- Zalo Official API Documentation
- n8n Documentation on Creating Custom Nodes
- zca-js GitHub Repository (for Zalo API client library)