CHACHAT Create Group Node

Node for creating a group via API

Overview

This node, named "CHACHAT Create Group Node," is designed to create a group via an external API. It takes a list of participant phone numbers and a group name as inputs, then sends a request to the API to create a new group with those participants. This node is useful in scenarios where you want to automate group creation in a chat or messaging platform, such as setting up discussion groups, team chats, or event coordination groups programmatically.

Practical examples:

  • Automatically creating a customer support group chat when a new ticket is opened.
  • Setting up project-specific group chats by adding relevant team members based on project data.
  • Creating event-based group conversations by providing participant phone numbers and naming the group accordingly.

Properties

Name Meaning
Participants An array of phone numbers representing the participants to be added to the group. Each participant is specified by their phone number string.
Group Name The name assigned to the newly created group.

Output

The node outputs a JSON object containing the response data from the group creation API. This typically includes details about the newly created group such as its ID, name, participants, and any other metadata returned by the API.

If the API supports it, the output may also include status information confirming successful creation or error details if the operation failed.

No binary data output is indicated in the source code.

Dependencies

  • Requires an external API accessible via HTTP POST at the endpoint /v1/createGroup on a base URL provided by credentials.
  • Needs an API authentication token and session identifier supplied through node credentials.
  • Uses the Axios library for making HTTP requests.
  • Requires proper configuration of credentials within n8n that provide the base URL, token, and session values.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrectly formatted participant phone numbers may result in API errors.
    • Network connectivity problems can prevent the API call from succeeding.
    • If the group name is empty or invalid, the API might reject the request.
  • Error messages:

    • Errors thrown by the API are caught and wrapped as node operation errors with context indicating which input item caused the failure.
    • If continueOnFail is not enabled, the node execution stops on the first error.
    • To resolve errors, verify credentials, ensure participant phone numbers are valid strings, and confirm the API endpoint is reachable.

Links and References

Discussion