Overview
This node listens to various real-time events from the Zalo messaging platform. It acts as a trigger that activates workflows when specific types of Zalo events occur, such as new messages, message retractions, reactions, typing notifications, group or friend events, and message delivery or seen confirmations.
Common scenarios where this node is beneficial include:
- Automating responses or logging when new messages arrive in personal or group chats.
- Tracking message retractions or reactions for moderation or analytics.
- Monitoring typing indicators to enhance user experience in chatbots.
- Responding to group membership changes or friend requests automatically.
- Keeping track of message delivery and read statuses for customer support workflows.
Practical example: A business could use this node to listen for new incoming messages and automatically create support tickets or send acknowledgments. Another example is monitoring group events to update membership databases or notify administrators.
Properties
| Name | Meaning |
|---|---|
| Events | Types of Zalo events to listen for. Options include: Message, Undo Message, Reaction, Typing, Group Event, Friend Event, Seen Messages, Delivered Messages. Default is "Message". |
| Self Listen | Boolean flag to allow listening to events generated by the authenticated user itself. Default is false. |
| Allowed Thread IDs | Comma-separated list of thread IDs to exclusively listen to. Leave empty to listen to all threads. |
| Blocked Thread IDs | Comma-separated list of thread IDs to ignore events from. |
Output
The node outputs JSON data representing the event received from Zalo. The output structure includes:
event: The type/name of the event (e.g., "message", "undo", "reaction").- Additional fields depend on the event type and contain detailed event data such as message content, thread ID, user info, etc.
The output is always delivered as an array with one object per event.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the Zalo platform.
- Uses an external Zalo SDK library (
zca-js) to manage connection and event listening. - Needs proper configuration of webhook URL in n8n to receive incoming event HTTP POST requests.
- Requires environment capable of maintaining persistent WebSocket connections for real-time event listening.
Troubleshooting
- Connection failures: Errors during login or connection setup may occur if credentials are invalid or network issues exist. The node attempts automatic reconnection after disconnections.
- Event filtering issues: Misconfiguration of allowed or blocked thread IDs can cause missing or unwanted events. Ensure correct comma-separated lists without extra spaces.
- Permission errors: If the API key lacks required permissions, events will not be received.
- Webhook misconfiguration: The webhook path must be correctly set and publicly accessible for Zalo to deliver events.
Common error message:
"Zalo connection failed: <error message>"indicates failure during login or connection setup. Verify credentials and network connectivity.
Links and References
- Zalo Official Developer Documentation
- n8n Webhook Documentation
- Zalo SDK (zca-js) GitHub Repository (Note: hypothetical link based on code)