Overview
This node listens for incoming messages on the Zalo platform, supporting both individual user messages and group messages. It is designed to trigger workflows when new messages arrive, enabling automation based on real-time chat activity.
Common scenarios where this node is beneficial include:
- Monitoring direct messages from users to automate responses or logging.
- Listening to group chats with specific filters such as messages tagging all members or mentioning a particular user ID.
- Building chatbots or notification systems that react to Zalo conversations.
- Filtering group messages to only process relevant content based on tags or mentions.
For example, you could use this node to trigger a workflow whenever someone sends a message in a group chat that includes an @all tag, or when a specific user is mentioned, allowing targeted automated actions.
Properties
| Name | Meaning |
|---|---|
| Event Types | Types of messages to listen for. Options: User Messages, Group Messages. |
| Group Message Filters | Filters for group messages (applies only if "Group Messages" selected). Options: Any Group Message, Tag All (@all), Tag Specific User ID. |
| Tag User ID | Specific user ID to filter group messages by mention (used only if "Tag Specific User ID" filter is selected). |
| Self Listen | Whether to allow listening to messages sent by yourself (boolean). |
| User Identifier | Unique identifier for this user instance to distinguish between multiple users (string). |
Output
The node outputs JSON data representing each received message that matches the configured filters. Each output item contains:
- The original message data fields (such as type, senderId, body/content, mentions).
- Additional metadata fields prefixed with underscore
_:_timestamp: ISO timestamp when the message was processed._instanceKey: Unique key combining credential and user identifier._credentialId: ID of the connected API credential._userIdentifier: The configured unique user identifier._eventType: Numeric code of the message type._source: Fixed string"zalo_message_trigger"indicating the source node._groupFilters: Active group message filters applied._tagUserId: The user ID used for filtering mentions._filterMatched: Boolean indicating if the message passed the filters.
If the node cannot send the webhook due to errors, it queues messages internally and retries later, ensuring no data loss.
The node does not output binary data.
Dependencies
- Requires a valid Zalo API credential with authentication details (cookie, IMEI, user agent) to connect to the Zalo service.
- Uses the
zca-jslibrary to interact with Zalo's messaging system. - Needs proper webhook URL configuration in n8n to receive incoming messages.
- Workflow static data storage is used to maintain connection state and message queues.
Troubleshooting
- Connection failures: If the node fails to create a Zalo instance, ensure the provided API credentials are valid and contain correct cookie, IMEI, and user agent information.
- No messages triggering: Verify that the selected event types match the incoming message types. Also check group message filters if using group messages.
- Webhook delivery errors: If webhook POST requests fail, messages are queued internally. Check network connectivity and webhook URL correctness.
- Duplicate instances: The node reuses existing connections if the same credential and user identifier are used. To reset, delete the instance or change the user identifier.
- Filtering issues: Make sure the "Tag User ID" matches the actual user IDs found in message mentions for the filter to work correctly.
Links and References
- Zalo Official Developer Documentation
- n8n Webhook Node Documentation
- zca-js GitHub Repository (Note: Replace with actual repo if available)