Zalo Message Trigger icon

Zalo Message Trigger

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

Overview

This node listens for incoming messages on the Zalo platform, a popular messaging app. It acts as a trigger that activates workflows when new messages arrive from users or groups. This is useful for automating responses, logging conversations, or integrating Zalo messages with other systems.

Common scenarios include:

  • Automatically processing user or group messages to provide instant replies.
  • Monitoring specific chat threads for important updates.
  • Filtering messages based on allowed or blocked thread IDs to control which conversations trigger workflows.

For example, you could use this node to listen only to group messages in certain groups and automatically save them to a database or notify a team via email.

Properties

Name Meaning
Event Types Types of messages to listen for. Options: User Messages (messages from individual users), Group Messages (messages from groups).
Self Listen Whether to listen to messages sent by yourself. If enabled, messages you send will also trigger the workflow.
Allowed Thread IDs Comma-separated list of thread IDs (groups or users) to listen to. If empty, all threads are listened to. Example: 123456789,987654321
Blocked Thread IDs Comma-separated list of thread IDs to ignore. Messages from these threads will not trigger the workflow. Example: 123456789,987654321

Output

The node outputs JSON data representing the received message event. The output contains a message object with details about the incoming message, including its content and metadata such as the thread ID.

Example output structure:

[
  {
    "message": {
      "threadId": "string",
      "senderId": "string",
      "text": "string",
      "timestamp": "number",
      "...": "other message properties"
    }
  }
]

No binary data is output by this node.

Dependencies

  • Requires an API key credential to connect to the Zalo platform.
  • Uses the zca-js library internally to handle Zalo API interactions.
  • Needs proper configuration of credentials including cookie, IMEI, and user agent strings for authentication.
  • The node sets up a webhook URL where Zalo sends message events; this URL must be accessible publicly.

Troubleshooting

  • Connection failures: If the node throws "Zalo connection failed," verify that the provided credentials (cookie, IMEI, user agent) are valid and have not expired.
  • No messages triggering: Check if the allowed and blocked thread ID lists are correctly set. An empty allowed list means all threads are accepted, but if blocked list includes relevant threads, those messages will be ignored.
  • Self Listen not working: Ensure the "Self Listen" property is enabled if you want to receive your own sent messages.
  • Webhook issues: Make sure the webhook URL is reachable by Zalo servers and that the node's webhook is properly registered.

Links and References

Discussion