Actions10
Overview
This node manages interactions with Zalo users, specifically providing operations related to user management on the Zalo platform. The "Undo Message" operation allows you to revoke or retract a previously sent message in a conversation thread. This is useful when you want to delete a message that was sent by mistake or contains incorrect information.
Practical examples:
- Automatically retracting messages sent in error during customer support chats.
- Implementing a feature to allow users to undo their last message within a chat bot workflow.
- Moderating conversations by removing inappropriate messages programmatically.
Properties
| Name | Meaning |
|---|---|
| Thread ID | The identifier of the conversation thread where the message was sent. |
| Thread Type | The type/category of the user or conversation thread (e.g., individual chat, group chat). |
| msgId | The unique identifier of the message to be undone (revoked). |
| cliMsgId | The client-side message ID corresponding to the message to be undone. |
Output
The output JSON object contains:
status: A string indicating the success status, typically"Thành công"meaning "Success".response: The raw response from the Zalo API after attempting to undo the message. This may include details about the operation result.
No binary data output is produced by this operation.
Example output JSON:
{
"status": "Thành công",
"response": {
// API response details here
}
}
Dependencies
- Requires an active connection to the Zalo API via credentials that provide a valid cookie, device IMEI, and user agent.
- The node uses an external library (
zca-js) to interact with the Zalo API. - Proper configuration of the Zalo API credential in n8n is necessary, including authentication tokens or cookies.
Troubleshooting
Common issues:
- Invalid or expired credentials leading to failure in creating the API instance.
- Incorrect
threadId,msgId, orcliMsgIdcausing the undo operation to fail. - Network or API rate limiting errors from Zalo.
Error messages:
"No API instance found. Please make sure to provide valid credentials."
Resolution: Verify that the Zalo API credentials are correctly set up and not expired.- Errors returned from the Zalo API in the
responsefield may indicate invalid parameters or permission issues. Check the IDs provided and ensure the authenticated user has rights to undo the message.
Enabling "Continue On Fail" in the node settings can help process multiple items even if some fail.
Links and References
- Zalo Official Developer Documentation
- Zalo Messaging API Reference
- n8n Documentation for general node usage and credential setup guidance