Zalo User icon

Zalo User

Quản lý người dùng Zalo

Overview

This node allows you to manage Zalo users by interacting with the Zalo platform through various user-related operations. Specifically, for the "Gửi lời mời kết bạn" (Send Friend Request) operation, it enables sending a friend request to a specified Zalo user along with a custom message.

Common scenarios where this node is beneficial include automating social engagement workflows, such as:

  • Automatically sending friend requests to new contacts collected from other sources.
  • Personalizing connection requests with custom messages to increase acceptance rates.
  • Integrating Zalo user management into broader marketing or CRM automation pipelines.

For example, you could use this node to send a welcome friend request message to new leads captured via a web form, helping to build relationships directly on Zalo.

Properties

Name Meaning
User ID The unique identifier of the Zalo user to whom the friend request will be sent.
Message The personalized message that accompanies the friend request invitation.

Output

The node outputs JSON data containing:

  • status: A string indicating the success status of the operation, typically "Thành công" (Success).
  • response: The raw response object returned from the Zalo API after sending the friend request.

The output is paired with the input item index to maintain traceability in workflows.

No binary data is produced by this operation.

Example output JSON structure:

{
  "status": "Thành công",
  "response": {
    // API response details here
  }
}

Dependencies

  • Requires an API key credential to authenticate with the Zalo platform.
  • Uses stored credentials including cookie, device IMEI, and user agent strings to establish a session.
  • Depends on the external zca-js library to interact with the Zalo API.
  • Proper configuration of the Zalo API credential in n8n is necessary before using this node.

Troubleshooting

  • Invalid Credentials: If the node throws an error about missing or invalid API instance, verify that the Zalo API credentials are correctly configured and valid.
  • User ID Not Found: Ensure the provided User ID corresponds to a valid Zalo user; otherwise, the API may return errors.
  • Message Required: The message field is mandatory; leaving it empty may cause the operation to fail.
  • API Rate Limits: Frequent friend requests might trigger rate limiting by Zalo; consider adding delays or handling retries.
  • Continue On Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error details in the output.

Links and References

Discussion