Zalo Friend Trigger icon

Zalo Friend Trigger

Lắng nghe sự kiện kết bạn trên Zalo

Overview

This node listens for friend-related events on the Zalo platform, specifically friend requests. It acts as a webhook trigger that activates when such events occur, allowing workflows to respond automatically to new friend requests on Zalo.

Common scenarios where this node is beneficial include:

  • Automatically processing incoming friend requests to send welcome messages.
  • Logging or tracking friend request activity for analytics.
  • Triggering other automated actions in response to social interactions on Zalo.

For example, a workflow could use this node to listen for new friend requests and then add the requester’s information to a CRM system or notify a team via chat.

Properties

Name Meaning
Event Types Friend events to listen for. Options: "Friend Requests" (listens for friend request events)

Output

The node outputs JSON data representing the friend event received from Zalo. The output structure includes a friendEvent object containing details about the specific friend event (e.g., a friend request).

Example output JSON structure:

{
  "friendEvent": {
    "type": <event type number>,
    "data": {
      // event-specific data fields
    }
  }
}

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential to connect with the Zalo platform.
  • Uses the external zca-js library to handle Zalo API login and event listening.
  • Needs valid Zalo credentials including cookie, device IMEI, and user agent string.
  • The node sets up a webhook URL within n8n to receive event notifications from Zalo.

Troubleshooting

  • Connection failures: If the node cannot establish a connection, ensure that the provided Zalo credentials are correct and have not expired. Invalid or missing cookies, IMEI, or user agent values will cause login failure.
  • No events received: Confirm that the webhook URL is correctly configured and accessible by Zalo. Also verify that the selected event types match the actual events being sent.
  • Error messages like "No API instance found": This indicates failure during login or initialization of the Zalo API client. Double-check credentials and network connectivity.
  • Webhook not triggering: Make sure the workflow is active and the webhook path matches what is registered in Zalo.

Links and References

Discussion