Actions9
Overview
This node allows you to manage Zalo users within n8n workflows. Specifically, with the "Chặn người dùng" (Block User) operation, it enables you to block a specified user on Zalo by their User ID. This is useful in scenarios where you need to automate moderation tasks, enforce access restrictions, or manage your Zalo contacts programmatically.
Practical examples:
- Automatically block users who violate community guidelines.
- Integrate with other systems to block users based on external triggers (e.g., from a CRM or support system).
- Batch-block multiple users as part of an administrative workflow.
Properties
| Name | Type | Meaning |
|---|---|---|
| User ID | String | ID của người dùng cần chặn (User to block) |
Output
The output for each processed item will be a JSON object with the following structure:
{
"status": "Thành công",
"response": { /* API response from Zalo */ }
}
- 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 block operation.
If an error occurs and "Continue On Fail" is enabled, the output will be:
{
"error": "Error message"
}
Dependencies
- Zalo API credentials: You must provide valid Zalo credentials (cookie, IMEI, user agent) via the
zaloApicredential in n8n. - zca-js: The node uses the
zca-jslibrary to interact with Zalo. - n8n configuration: Ensure that the custom credential type
zaloApiis configured and available.
Troubleshooting
Common issues:
- Invalid credentials: If the provided cookie, IMEI, or user agent are incorrect or expired, the node will throw an error:
"No API instance found. Please make sure to provide valid credentials."
Resolution: Update your Zalo credentials in n8n. - Missing required property: If "User ID" is not provided, the node will fail before making the API call.
- API errors: If Zalo returns an error (e.g., user not found, already blocked), the error message will appear in the output if "Continue On Fail" is enabled, or as a thrown error otherwise.