Overview
This node listens for incoming messages on the Zalo platform, a popular messaging app. It acts as a trigger that activates workflows when specific types of messages are received. Users can configure it to listen to messages from individual users or groups, filter by allowed or blocked thread IDs, and decide whether to include messages sent by themselves.
Common scenarios where this node is beneficial include:
- Automating responses or actions based on user or group messages in Zalo.
- Monitoring conversations in selected groups or with specific users.
- Filtering out unwanted message sources to focus on relevant interactions.
For example, a business could use this node to automatically respond to customer inquiries sent via Zalo or to log messages from certain groups for analytics.
Properties
| Name | Meaning |
|---|---|
| Event Types | Types of messages to listen for: - User Messages (messages from individual users) - Group Messages (messages from groups) |
| Self Listen | Whether to listen to messages sent by the bot itself (true/false). |
| Allowed Thread IDs | Comma-separated list of thread IDs (groups or users) to listen to. If empty, listens to all threads. |
| Blocked Thread IDs | Comma-separated list of thread IDs to ignore and not listen to. |
Output
The node outputs JSON data representing the incoming message event. The structure includes details about the message such as its content and metadata, encapsulated under a message property inside the JSON object.
Example output JSON structure:
[
{
"message": {
"threadId": "string",
"senderId": "string",
"text": "string",
"timestamp": "number",
"...": "other message properties"
}
}
]
No binary data output is produced by this node.
Dependencies
- Requires an API key credential to connect to the Zalo platform.
- Uses an external Zalo SDK/library (
zca-js) to handle connection and message listening. - Needs proper configuration of credentials including cookie, device IMEI, and user agent strings.
- The node sets up a webhook endpoint to receive message events forwarded from the listener.
Troubleshooting
- Connection failures: Errors like "Zalo connection failed" indicate issues with authentication or invalid credentials. Ensure the API key and related parameters (cookie, IMEI, user agent) are correct and valid.
- No messages received: Check if the allowed and blocked thread ID filters are set correctly. An empty allowed list means all threads are listened to; if specified, only those threads will trigger events.
- Self Listen not working: Verify the "Self Listen" property is enabled if you want to capture messages sent by the bot itself.
- Webhook not triggered: Confirm the webhook URL is correctly configured and accessible by Zalo's servers.
Links and References
- Zalo Official Developer Documentation
- n8n Webhook Documentation
- Zalo SDK (zca-js) GitHub Repository (for reference on the used library)