Zalo icon

Zalo

Zalo Node

Overview

This node implements an API interaction to send messages either to individual users or groups within a chat or messaging platform. It supports sending messages in two formats: a predefined simple message format and a raw JSON format that allows for rich text styling and urgency levels.

Common scenarios where this node is beneficial include automating notifications, alerts, or chat communications within workflows. For example, it can be used to send urgent system alerts to a user or broadcast announcements to a group chat with styled text emphasizing important parts.

Practical examples:

  • Sending a plain text message to a specific user notifying them of a completed task.
  • Sending a styled JSON message to a group chat with bold, red, and large font styles to highlight critical information.
  • Attaching files or setting a time-to-live (TTL) for messages that should expire after a certain period.

Properties

Name Meaning
Thread ID The identifier of the target user or group to which the message will be sent.
Thread Type Specifies whether the message is sent to a single user ("User") or a group chat ("Group").
Send Option Choose between sending a "Raw Json" formatted message or a "Message" with predefined fields.
Raw Json The full JSON object representing the message content, including text, urgency, and styles. Used when "Send Option" is "Raw Json".
Message The plain text message content to send. Used when "Send Option" is "Message".
Attachment File path(s) for attachments to include with the message. Optional, used with "Message" option.
TTL (Milliseconds) Time-to-live for the message in milliseconds; how long the message should persist before expiring. Optional, used with "Message" option.
Urgency The importance level of the message: "Default", "Important", or "Urgent". Optional, used with "Message" option.

Output

The node outputs a JSON object representing the result of the send message operation. This typically includes confirmation details such as message ID, status, or any response data from the messaging API.

If binary data output is supported (not explicitly shown in the code), it would represent any file attachments or media sent along with the message.

Dependencies

  • Requires access to the messaging platform's API endpoint capable of sending messages to users or groups.
  • Needs appropriate API authentication credentials configured in n8n (e.g., an API key or token).
  • May depend on external libraries for HTTP requests and JSON handling (implied by usage but not explicitly shown).
  • Environment variables or n8n credential configurations must provide necessary authentication details.

Troubleshooting

  • Missing or invalid Thread ID: Since Thread ID is required, ensure it is correctly provided; otherwise, the API call will fail.
  • Incorrect Thread Type: Using the wrong thread type (user vs. group) may cause the message not to deliver or API errors.
  • Malformed Raw JSON: When using the Raw Json option, ensure the JSON structure is valid and matches the expected schema; otherwise, the API may reject the message.
  • Attachment Path Issues: If attachments are specified, verify the file paths are correct and accessible by n8n.
  • API Authentication Errors: Ensure the API key or token is valid and has permissions to send messages.
  • TTL Misconfiguration: Setting TTL incorrectly might cause messages to expire immediately or never expire; use sensible values.
  • Error Messages: Common error messages likely relate to invalid parameters, authentication failures, or network issues. Review API documentation and logs to resolve.

Links and References


Note: The source code was heavily obfuscated, so the above summary is based on static analysis of input properties and typical patterns for such nodes.

Discussion