Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

This node enables server-side operations for managing channels in a Stream Chat application. Specifically, the Create Channel operation allows you to create new chat channels of various types (e.g., messaging, team, livestream) and optionally add members to them at creation time.

Use cases include:

  • Creating 1-on-1 or group chat channels dynamically when users start conversations.
  • Setting up team or broadcast channels for collaboration or events.
  • Automating channel creation workflows based on external triggers or user actions.

Example: Automatically create a "team" type channel named "project-alpha" with initial members "john_doe" and "jane_smith".

Properties

Name Meaning
Channel Type The type of channel to create. Common options are:
- messaging (1-on-1 chats)
- team (group channels)
- livestream (broadcast channels)
Channel ID Unique identifier for the channel (e.g., "general", "random", "team-alpha"). Combined with type to form the full channel ID (CID).
Members Comma-separated list of user IDs to add as members upon channel creation (e.g., "john_doe,jane_smith,admin123"). No spaces around commas. Optional.

Output

The output JSON contains the response from the Stream Chat API after creating the channel. This typically includes details about the newly created channel such as its ID, type, members, creation timestamp, and other metadata.

If the creation is successful, the output will have the channel object data. If there is an error, the output will contain an error message describing the failure.

No binary data is produced by this operation.

Dependencies

  • Requires a valid API key credential configured in n8n for authenticating with the Stream Chat service.
  • The node uses the Stream Chat server-side client library to perform operations.
  • Ensure the API key has permissions to create channels and manage members.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Using a duplicate Channel ID with the same type may result in errors or unexpected behavior.
    • Providing invalid user IDs in the members list can cause member addition to fail.
    • Network or permission issues on the Stream Chat side can prevent channel creation.
  • Error messages:

    • "Unsupported operation: channel.createChannel": Indicates the operation name might be misspelled or not supported.
    • API errors returned from Stream Chat will be passed through, e.g., "Channel ID already exists", "User not found".
  • Resolutions:

    • Verify API credentials and permissions.
    • Ensure unique Channel ID per channel type.
    • Validate user IDs before passing them as members.
    • Check network connectivity and Stream Chat service status.

Links and References

Discussion