Zalo User icon

Zalo User

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

Overview

This n8n node allows you to interact with Zalo users, specifically to send a friend request ("Gửi lời mời kết bạn") to another user on the Zalo platform. It is useful in automation scenarios where you want to programmatically connect with new contacts, such as onboarding workflows, CRM integrations, or social engagement bots.

Practical Example:
Automatically send a personalized friend request message to a list of Zalo user IDs when they sign up for your service.

Properties

Name Type Meaning
User ID String ID của người dùng cần gửi lời mời kết bạn (Target user's Zalo ID to whom the friend request will be sent)
Message String Tin nhắn kèm theo lời mời kết bạn (Message to accompany the friend request)

Output

The node outputs a JSON object for each input item processed:

{
  "status": "Thành công",
  "response": { /* Response from Zalo API after sending the friend request */ }
}
  • status: Always set to "Thành công" (Success) if the operation completes without error.
  • response: Contains the raw response returned by the Zalo API for the friend request action.

If an error occurs and "Continue On Fail" is enabled, the output will be:

{
  "error": "Error message"
}

Dependencies

  • External Service: Requires access to the Zalo API via the zca-js library.
  • Credentials: Needs a valid Zalo account credential (zaloApi) configured in n8n, including:
    • Cookie
    • IMEI
    • User Agent

Troubleshooting

Common Issues:

  • Invalid Credentials: If the provided Zalo credentials (cookie, IMEI, user agent) are missing or incorrect, the node will throw:
    "No API instance found. Please make sure to provide valid credentials."

    • Resolution: Double-check your Zalo credentials in n8n's credential manager.
  • API Errors: If the Zalo API returns an error (e.g., invalid user ID, already friends), the error message will appear in the output under the error field (if "Continue On Fail" is enabled).

    • Resolution: Review the error message for details; ensure the target user ID is correct and that your account is not restricted.
  • Missing Required Fields: Both "User ID" and "Message" are required. Omitting them will result in validation errors before execution.

Links and References

Discussion