Zalo User Interact icon

Zalo User Interact

Gửi tin nhắn và tương tác với Zalo User

Overview

This n8n custom node implements the "Send Message" operation for the "Message" resource, likely targeting a messaging platform such as Zalo. The node allows users to send rich messages—including text, attachments, styles, mentions, and more—to individual users or groups. It supports advanced features like message styling, urgency levels, mentions, quoting previous messages, and setting message lifetimes.

Common scenarios:

  • Sending automated notifications or alerts to users or groups.
  • Delivering files, images, or other attachments as part of a workflow.
  • Sending formatted or styled messages (e.g., bold, colored, lists).
  • Mentioning specific users in group chats.
  • Quoting previous messages for context in replies.

Practical examples:

  • Notifying a support team group with an urgent, styled message and attached logs.
  • Sending a personalized message with mentions and file attachments to a user.
  • Automating reminders with highlighted text and quoted previous instructions.

Properties

Below are the supported input properties for the "Send Message" operation:

Display Name Type Description
User/Group Id string (required) ID of the Zalo User or Group to send the message to.
Message string Content of the message.
Thread Type options (required) Type of conversation: User or Group.
Attachments fixedCollection List of attachment paths (e.g., /files/example.txt or https://example.com/image.png).
Attachments string Comma-separated list of attachment URLs or paths.
Styles fixedCollection List of styles (bold, italic, color, size, etc.) to apply to parts of the message.
Urgency options (required) Priority level of the message: Default, Important, or Urgent.
Mentions fixedCollection List of user mentions, specifying position and length in the message.
Quote Message json JSON object representing a quoted message.
Message Lifetime number Time-to-live (TTL) for the message (in seconds).

Output

The node outputs an array of objects, each corresponding to an input item. Each output object contains:

{
  "success": true,
  "data": {
    // Response from the messaging API after sending the message
    // This may include message IDs, timestamps, status, etc.
  }
}
  • If the message is sent successfully, success will be true and data will contain the response details.
  • If there is an error, the output will include:
    • success: false
    • error: Error message
    • stack: Stack trace (if available)

Note: If attachments are provided as URLs, the node attempts to download them and may store them temporarily before sending.


Dependencies

  • External Service: Requires access to the target messaging platform's API (e.g., Zalo).
  • API Key / Token: Authentication credentials must be configured in n8n for the messaging service.
  • File System Access: The node may write temporary files when handling attachments.
  • n8n Configuration: Proper credentials and permissions must be set up in n8n for this node to function.

Troubleshooting

Common Issues

  • Invalid User/Group ID: If the provided ID does not exist or is incorrect, the message will not be delivered.
  • Attachment Download Failure: If an attachment URL is invalid or inaccessible, the node may fail to send the message.
  • Incorrect Style/Mention Indices: If style or mention indices do not match the message content, formatting or mentions may not appear as expected.
  • Missing Required Fields: Omitting required fields like User/Group Id or Thread Type will result in errors.

Error Messages

  • "Error sending message: ..."
    Indicates a failure in the messaging API call. Check credentials, network connectivity, and input data.
  • "Attachment could not be downloaded or saved."
    Ensure the attachment URL/path is correct and accessible.
  • "Invalid mention/style parameters."
    Verify that positions and lengths correspond to the actual message content.
  • "Unknown operation: ..."
    Make sure the operation property is set to "sendMessage".

Resolution Steps:

  • Double-check all required fields.
  • Validate attachment URLs/paths.
  • Review API credentials and permissions.
  • Consult the stack trace for deeper debugging if available.

Links and References


Tip: For best results, always test your configuration with a simple message before adding advanced features like attachments, styles, or mentions.

Discussion