Actions22
- Get Actions
- Message Actions
- Friend Actions
- Group Actions
- Tool Actions
Overview
This node is designed to send messages through the Zalo platform, targeting either individual users or groups. It supports sending text messages with rich formatting styles, attachments (files or URLs), mentions of other users, quoted messages, and setting message urgency and lifetime. This node is useful for automating communication workflows such as customer support, notifications, group announcements, or interactive chatbots on Zalo.
Practical examples include:
- Sending a formatted announcement with attachments to a group.
- Messaging a user with styled text and mentioning specific users.
- Quoting a previous message in a reply.
- Sending urgent alerts with high priority flags.
Properties
Name | Meaning |
---|---|
User/Group Id | The ID of the Zalo user or group thread to which the message will be sent. |
Message | The textual content of the message to send. Optional if attachments are provided. |
Thread Type | Specifies whether the target thread is a User (0) or a Group (1). |
Attachments (Paths) | A collection of file paths or URLs pointing to attachments to include in the message. Each attachment requires a path string, e.g., /files/example.txt or https://example.com/image.png . Multiple attachments allowed. |
Attachments (URLs) | A comma-separated string listing URLs or file paths for attachments. Alternative to the fixed collection above. |
Styles | A collection of style objects defining text formatting within the message. Styles include options like Bold, Italic, Underline, StrikeThrough, colors (Red, Orange, Yellow, Green), font sizes (Small, Big), and list types (UnorderedList, OrderedList), Indent. Each style specifies start index and length. |
Urgency | The priority level of the message: Default (0), Important (1), or Urgent (2). |
Mentions | A collection of mention objects specifying users to mention in the message. Each mention includes position (index in message), user ID, and length of the mention text. |
Quote Message | A JSON object representing a quoted message to include in the new message, allowing replies that reference previous messages. |
Message Lifetime | Time-to-live (TTL) in seconds for how long the message should exist before expiring. Optional. |
Output
The node outputs an array of results, each containing a json
field with the following structure:
success
: Boolean indicating if the message was sent successfully.data
: Contains response data from the Zalo API or service confirming the message details.error
: If an error occurred, this field contains error information including message and stack trace.- Additional metadata fields related to the message sending operation.
If attachments are included, the node handles uploading or referencing them appropriately but does not output binary data directly.
Dependencies
- Requires access to the Zalo messaging API via an authenticated client instance.
- Uses an API key or token credential configured in n8n to authenticate requests.
- May require local or remote file access permissions for attachments specified by file paths.
- Uses internal helper classes and methods for handling message formatting, attachment processing, and API communication.
Troubleshooting
- Invalid Thread ID: If the provided user/group ID is incorrect or inaccessible, the node will throw an error indicating failure to send the message. Verify the ID is correct and the bot has permission to message the thread.
- Attachment Upload Failures: Errors may occur if attachment files do not exist at specified paths or URLs are invalid. Ensure all attachment paths are accessible and URLs are reachable.
- Authentication Errors: If the API key or token is missing or invalid, authentication errors will occur. Confirm credentials are properly set up in n8n.
- Message Content Issues: Empty messages without attachments may cause errors. Provide either message text or attachments.
- Style/Mention Index Out of Range: Specifying styles or mentions with invalid start indices or lengths beyond the message length can cause errors. Validate these values carefully.
- API Rate Limits: Sending too many messages in a short time may trigger rate limiting by Zalo. Implement delays or retries as needed.
Links and References
Note: Internal variable names, credential type names, and obfuscated code details have been omitted to comply with guidelines.