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 based on user configuration. This node is useful in scenarios where you want to automate workflows triggered by new messages on Zalo, such as customer support automation, chatbots, or notification systems.

For example, you could use this node to:

  • Automatically respond to user messages received on Zalo.
  • Log group chat messages into a database for analysis.
  • Trigger alerts or other workflows when specific types of messages arrive.

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 allow listening to messages sent by yourself. Boolean value: true or false.

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 about the message as provided by the Zalo API.

No binary data output is produced by this node.

Example output JSON structure:

[
  {
    "message": {
      // message details as received from Zalo
    }
  }
]

Dependencies

  • Requires an API key credential to connect to the Zalo platform.
  • Uses the zca-js library internally to handle Zalo API interactions and message listening.
  • Needs proper configuration of the webhook URL in n8n to receive incoming message events.
  • Requires valid Zalo credentials including cookie, IMEI, and user agent strings for authentication.

Troubleshooting

  • Connection failures: If the node throws "Zalo connection failed," verify that the provided credentials are correct and have not expired.
  • No messages received: Ensure the webhook URL is correctly set up and publicly accessible. Also, confirm that the selected event types match the expected incoming messages.
  • Self Listen not working: If you do not receive your own sent messages despite enabling self listen, check if the Zalo API or library supports this feature fully.
  • Credential errors: Make sure the API key credential includes all required fields (cookie, IMEI, user agent) and that they are valid.

Links and References

Discussion