Actions12
Overview
The Zalo User node allows managing Zalo user interactions programmatically. Specifically, the "Thu Hồi Tin Nhắn" (Undo Message) operation enables users to recall or retract a previously sent message in a Zalo chat thread. This is useful when you want to delete a message from a conversation after sending it, for example, to correct mistakes or remove sensitive information.
Typical scenarios include:
- Automatically retracting messages sent by mistake.
- Managing conversations by removing outdated or incorrect messages.
- Integrating with workflows that require message moderation or cleanup.
Properties
| Name | Meaning |
|---|---|
| Thread ID | The unique identifier of the user or chat thread where the message was sent. |
| Thread Type | The type/category of the user or thread (e.g., individual chat, group chat). |
| msgId | The unique identifier of the message to be undone (recalled). |
| cliMsgId | The client-side message ID associated with the message to be undone. |
Output
The node outputs a JSON object containing:
status: A string indicating the result of the operation, typically"Thành công"meaning "Success".response: The raw response data returned from the Zalo API after attempting to undo the message. This may include confirmation details or error information if the operation failed.
Example output JSON structure:
{
"status": "Thành công",
"response": {
// API response details here
}
}
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Zalo API.
- Uses stored credentials including cookie, IMEI, and user agent strings to establish a session.
- Depends on the external
zca-jslibrary to interact with the Zalo API. - Requires proper configuration of the Zalo API credentials within n8n to function correctly.
Troubleshooting
- Invalid Credentials or Session: If the node throws an error about no API instance found, ensure that the provided credentials (cookie, IMEI, user agent) are valid and up to date.
- Message Not Found: If the message ID or client message ID is incorrect or the message has already been deleted, the undo operation will fail.
- Thread ID/Type Mismatch: Providing incorrect thread identifiers or types can cause the API call to fail; verify these values carefully.
- API Rate Limits or Restrictions: Frequent undo operations might be limited by Zalo's API policies; monitor for rate limit errors.
- Continue On Fail: The node supports continuing execution on failure per item, which helps in batch processing scenarios where some items might fail.
Links and References
- Zalo Official API Documentation
- n8n Documentation
- zca-js GitHub Repository (replace with actual link if available)