Actions10
Overview
This node manages interactions with Zalo users, specifically enabling operations such as sending friend requests, accepting friend requests, blocking/unblocking users, updating user profile settings, retrieving user information, and more. It is useful for automating social interactions on the Zalo platform, such as managing contacts or integrating Zalo user management into workflows.
For the "Gửi Lời Mời Kết Bạn" (Send Friend Request) operation, the node sends a friend request to a specified Zalo user ID along with a custom message. This can be used in scenarios like automating outreach campaigns, onboarding new contacts, or integrating Zalo friend requests into customer engagement processes.
Practical Example
- Automatically send personalized friend requests to a list of user IDs collected from another system.
- Include a welcoming message with each friend request to improve acceptance rates.
Properties
| Name | Meaning |
|---|---|
| User ID | The unique identifier of the Zalo user to whom the friend request will be sent. |
| Message | The accompanying message text that will be sent along with the friend request invitation. |
Output
The node outputs an array of JSON objects corresponding to each input item processed. For the "sendFriendRequest" operation, each output item contains:
status: A string indicating the result status, typically"Thành công"meaning "Success".response: The raw response object returned by the Zalo API after sending the friend request, which may include details about the request status or any metadata.
Example output JSON structure:
{
"status": "Thành công",
"response": {
// API response details here
}
}
No binary data output is produced by this node.
Dependencies
- Requires valid Zalo API credentials including authentication cookies, device IMEI, and user agent strings.
- Uses the external
zalo-api-finallibrary to interact with the Zalo platform. - The node expects these credentials to be configured in n8n beforehand.
- Proper API authentication tokens or cookies must be provided to successfully perform operations.
Troubleshooting
Common Issues:
- Invalid or expired credentials leading to failed login attempts.
- Missing required parameters such as User ID or Message causing errors.
- Network connectivity issues preventing communication with the Zalo API.
Error Messages:
"No API instance found. Please make sure to provide valid credentials."
Indicates failure to authenticate with Zalo API. Verify that the API key credential is correctly set up and not expired.- Errors related to missing parameters will usually specify which input is invalid or missing.
- API rate limits or permission errors may also occur depending on the Zalo account's status.
Resolution Tips:
- Double-check the API credentials and refresh them if necessary.
- Ensure all required input fields are provided and correctly formatted.
- Check network access and firewall settings.
- Use the "Continue On Fail" option in n8n to handle individual item errors gracefully.
Links and References
- Zalo Official Developer Documentation
- Zalo API Node.js SDK (zalo-api-final) (for reference)
- n8n Documentation on Creating Custom Nodes