Zalo Message Trigger
AI-generatedOverview
This node listens for incoming messages on the Zalo platform, supporting multiple users and message types. It acts as a trigger that activates workflows when specific message events occur, such as receiving user messages or group messages. The node is useful for automating responses, logging conversations, or integrating Zalo messaging with other systems.
Common scenarios include:
- Monitoring direct user messages to automate customer support replies.
- Listening to group chats for mentions or keywords to trigger notifications or actions.
- Filtering group messages based on mention types (e.g., any mention, mention of the current account, mention of a specific user ID, or mention of everyone).
Practical example:
- A business wants to automatically respond when a customer sends a direct message on Zalo.
- A community manager wants to track when they are mentioned in group chats to prioritize responses.
- An automation triggers when anyone mentions "@all" in a group chat to send an alert to moderators.
Properties
| Name | Meaning |
|---|---|
| Event Types | Types of messages to listen for. Options: User Messages (direct messages from users), Group Messages (messages from groups). |
| Group Message Mode | Filter for group messages (shown only if "Group Messages" is selected in Event Types). Options: Any message, Mention (any), Mention Me (current account), Mention Specific User ID, Mention Everyone (@all/@everyone). |
| Debug mention detection | Whether to always emit a debug payload with mention detection details even when messages are filtered out (only for group messages). |
| Mention User ID | The specific user ID to match when Group Message Mode is set to "Mention Specific User ID". |
| Self Listen | Whether to allow listening to messages sent by yourself (the authenticated account). |
| User Identifier | A unique identifier string for this user instance to distinguish it from others (e.g., "user1", "user2"). |
Output
The node outputs an array of JSON objects representing the received messages that match the configured filters. Each message object includes:
- Original message data from Zalo.
- Additional metadata fields prefixed with underscores:
_timestamp: ISO timestamp when the message was processed._instanceKey: Unique key combining credential and user identifier._credentialId: Identifier of the used API credential._userIdentifier: The configured user identifier._eventType: Type of the event/message._groupMessageMode: The group message filter mode applied._mentionUserId: The user ID used for mention filtering (if applicable)._selfUid: The user ID of the authenticated account._source: Fixed string"zalo_message_trigger"indicating the source node.
If the node receives no messages, it outputs a single object with _trigger set to "empty" and debug information about the webhook and message queue state.
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 an external Zalo SDK/library (
zca-js) to handle login, message listening, and mention detection. - Needs a publicly accessible webhook URL configured in n8n to receive message events.
- Relies on n8n's HTTP request helper to forward matched messages to the workflow via webhook calls.
Troubleshooting
- No credentials found: Ensure you have configured a valid Zalo API credential with correct authentication details.
- No webhook URL available: Make sure the node has a webhook URL assigned and that it is publicly reachable.
- Failed to create Zalo instance: Check the validity of the provided credentials and network connectivity.
- Webhook trigger failures: If forwarding messages to the workflow fails, messages are queued internally and retried later. Persistent failures may indicate network issues or misconfiguration.
- Messages filtered unexpectedly: Verify the group message mode and mention user ID settings. Enable "Debug mention detection" to receive detailed debug payloads for troubleshooting.
- Self Listen disabled: If you want to receive messages sent by the authenticated account itself, enable the "Self Listen" option.
Links and References
- Zalo Official Developer Documentation
- n8n Webhook Node Documentation
- Zalo Messaging API Concepts (general reference)
This summary is based solely on static analysis of the provided source code and property definitions.