Zalo icon

Zalo

Zalo Node

Overview

This node operation "Add User To Group" under the "API" resource is designed to add one or more users to a specified group via an API call. It accepts a group identifier and a list of user IDs, then sends a request to add those users to the group.

Common scenarios where this node would be beneficial include:

  • Automating membership management in team collaboration tools.
  • Adding multiple users to a project or communication group based on workflow triggers.
  • Synchronizing user groups across different systems by programmatically updating group memberships.

Practical example:

  • When a new project is created, automatically add all assigned team members to the project's communication group by providing the group ID and the user IDs.

Properties

Name Meaning
Send Option Choice between sending the message as raw JSON (Raw Json) or using a predefined message format (Message).
Group ID The unique identifier of the group to which users will be added.
User IDs A comma-separated string listing the user IDs to add to the group.

Output

The node outputs JSON data representing the response from the API after attempting to add users to the group. This typically includes confirmation of success or details about any errors encountered.

If the node supports binary data output (not evident from the provided code), it would represent related binary content such as attachments or media associated with the API response.

Dependencies

  • Requires access to the target API that manages groups and users.
  • Needs appropriate API authentication credentials configured in n8n (e.g., an API key or token).
  • Uses external libraries for HTTP requests and possibly for handling JSON data (implied by bundled dependencies).

Troubleshooting

  • Invalid Group ID or User IDs: Ensure that the group ID and user IDs are correct and exist in the target system.
  • Authentication Errors: Verify that the API credentials are valid and have sufficient permissions to modify group memberships.
  • Malformed User IDs List: The user IDs must be comma-separated without extra spaces or invalid characters.
  • API Rate Limits: If adding many users at once, the API might throttle requests; consider batching additions.
  • Error Messages: The node may throw errors if the API returns failure responses; check the error message for details and adjust inputs accordingly.

Links and References

  • Refer to the API documentation of the service managing groups and users for exact parameter formats and authentication requirements.
  • n8n documentation on creating and configuring custom nodes: https://docs.n8n.io/integrations/creating-nodes/
  • General best practices for API authentication and error handling in n8n workflows.

Discussion