Overview
This node listens to various real-time events from a messaging platform, specifically targeting events such as messages, group activities, reactions, and message undo actions. It is designed to capture these events as they happen, allowing workflows to react immediately to user interactions or group changes.
Common scenarios where this node is beneficial include:
- Monitoring incoming messages in personal or group chats to trigger automated responses.
- Tracking group events like member joins or leaves for administrative automation.
- Detecting reactions on messages to update sentiment analysis or engagement metrics.
- Capturing message undo (recall) events to maintain logs or notify users.
Practical example:
A customer support workflow could use this node to listen for new messages and automatically create support tickets. Another example is a community management workflow that listens for group events to welcome new members or moderate content based on reactions.
Properties
| Name | Meaning |
|---|---|
| Events | Select which event types to listen for. Options: Message (listen to user/group messages), Group (listen to group events), Reaction (listen to message reactions), Undo (listen to message recall events). |
| Include Self Events | Boolean indicating whether to listen to events sent by the bot/user itself. |
| Allowed Thread IDs | Comma-separated list of thread IDs (groups or users) to restrict listening to. If empty, all threads are listened to. Example: "123456789,987654321". |
| Blocked Thread IDs | Comma-separated list of thread IDs to exclude from listening. If empty, no threads are blocked. Example: "123456789,987654321". |
| Get Metadata | Boolean indicating whether to fetch additional user metadata from the platform (Zalo). |
Output
The node outputs JSON data representing the captured event. Each output item includes:
json: The event data serialized as JSON, containing details specific to the event type (e.g., message content, group info, reaction details).event: The type of event captured (e.g., "message", "group_event", "reaction", "undo").timestamp: The timestamp when the event was received.workflow_id: The ID of the workflow instance processing the event.
If the "Get Metadata" option is enabled, the output JSON also includes enriched user information fetched from the platform, such as user profile details.
The node does not output binary data.
Dependencies
- Requires connection to the Zalo messaging platform's API or SDK to receive real-time events.
- Needs an API authentication token or credential configured in n8n to access Zalo services.
- Optionally fetches user metadata from Zalo if enabled.
- The node internally manages event subscriptions and filtering based on provided thread IDs and event types.
Troubleshooting
- No events received: Check that the API credentials are valid and have permissions to subscribe to events. Verify that the selected event types and thread ID filters match actual active threads.
- Events missing or incomplete: Ensure "Get Metadata" is enabled if detailed user info is required. Also, confirm network connectivity to the Zalo API.
- Errors related to invalid thread IDs: Validate the format of allowed/blocked thread ID lists; they should be comma-separated numeric strings without extra spaces.
- Node stops listening unexpectedly: This might be due to network interruptions or API limits. Restart the workflow or check API usage quotas.
- Permission errors: Confirm that the API key has sufficient rights to listen to the requested event types.
Links and References
- Zalo Official Developer Documentation
- n8n Documentation - Creating Custom Nodes
- Real-time Messaging APIs Overview
This summary is based solely on static code analysis and provided property definitions. Runtime behavior depends on external API responses and environment configuration.