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 where you want to automate workflows based on new messages received on Zalo, such as customer support automation, chatbots, or notification systems.

For example, you could use this node to:

  • Trigger a workflow whenever a user sends a message to your Zalo account.
  • Monitor group conversations and respond automatically when certain keywords appear.
  • Log all incoming messages for analytics or auditing purposes.

Properties

Name Meaning
Event Types Types of messages to listen for. Options: User Messages (messages from individual users), Group Messages (messages from groups). You can select one or both.
Self Listen Whether to listen to messages sent by yourself (the authenticated Zalo account). Boolean value: true or false.

Output

The node outputs the incoming message data as JSON through its main output. The structure of the JSON corresponds to the raw message object received from Zalo, containing details about the message event.

Example output JSON structure (simplified):

{
  "message": {
    // message details such as sender, content, timestamp, etc.
  }
}

No binary data output is produced by this node.

Dependencies

  • Requires valid Zalo API credentials with authentication details including cookie, IMEI, and user agent.
  • Uses an external Zalo SDK/library (zca-js) to connect and listen for messages.
  • Needs the webhook URL configured in n8n to receive incoming message events via HTTP POST.
  • Requires network access to Zalo services.

Troubleshooting

  • Connection failures: If the node throws "Zalo connection failed," verify that the provided credentials are correct and have not expired. Ensure the cookie, IMEI, and user agent values are valid.
  • No messages received: Confirm that the webhook URL is correctly set up and publicly accessible. Also, check that the selected event types match the expected incoming messages.
  • Self Listen not working: If enabling self listen does not capture your own messages, ensure the account permissions allow it and the node parameter is properly set.
  • Unexpected errors: Check the node logs for detailed error messages. Network issues or changes in Zalo's API may require updating credentials or the SDK.

Links and References

Discussion