Zalo Message Trigger icon

Zalo Message Trigger

Sự kiện lắng nghe tin nhắn trên Zalo

Overview

This node acts as a trigger to listen for incoming messages on the Zalo platform, a popular messaging app. It is designed to capture real-time message events either from individual users or group chats. This functionality is useful in scenarios such as automating responses, logging conversations, or integrating Zalo messages into broader workflows.

Practical examples include:

  • Automatically responding to user inquiries sent via Zalo.
  • Monitoring group chat messages for specific keywords or commands.
  • Logging all incoming messages for analytics or compliance purposes.

Properties

Name Meaning
Event Types Types of messages to listen for. Options: User Messages (messages from individual users), Group Messages (messages from groups). Multiple selections allowed.
Self Listen Whether to listen to messages sent by the bot itself. Boolean value: true (listen to own messages), false (ignore own messages).

Output

The node outputs JSON data representing the incoming message event received from Zalo. The output structure contains a message object with details about the message event captured by the webhook. This includes all relevant information provided by Zalo's message payload.

No binary data output is produced by this node.

Example output JSON structure:

{
  "message": {
    // message details as received from Zalo webhook
  }
}

Dependencies

  • Requires an API key credential to connect to the Zalo platform.
  • Uses a third-party library (zca-js) to handle Zalo API interactions and message listening.
  • Needs valid authentication cookies, device IMEI, and user agent strings configured within the credentials.
  • The node sets up a webhook endpoint to receive message events from Zalo.

Troubleshooting

  • Connection failures: If the node throws a "Zalo connection failed" error, verify that the provided credentials (cookie, IMEI, user agent) are correct and have not expired.
  • No credentials found: Ensure that the required API key credential is properly configured in n8n before activating the node.
  • Webhook issues: Confirm that the webhook URL is accessible from Zalo and correctly registered.
  • Message filtering: If no messages are triggering the workflow, check that the selected event types match the actual incoming message types and that "Self Listen" is set appropriately.

Links and References

Discussion