Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The node enables server-side operations for managing chat channels using the Stream Chat service. Specifically, the "Send Image" operation allows users to upload and send an image file to a specified chat channel. This is useful in scenarios where automated workflows need to share images within team chats, group channels, or broadcast livestream channels.

Practical examples include:

  • Automatically sending product images to a sales team channel when new inventory arrives.
  • Sharing event photos in a livestream channel after an event concludes.
  • Uploading user-generated content images to a messaging channel for review or collaboration.

Properties

Name Meaning
Channel Type The type of channel to send the image to. Common types: "messaging" (1-on-1 chats), "team" (group channels), "livestream" (broadcast channels)
Channel ID Unique identifier for the target channel (e.g., "general", "random", "team-alpha"). Combined with Channel Type to form the full channel ID (CID).
File Path Local file path of the image to upload and send.
File Name Optional name to assign to the uploaded image file.

Output

The output JSON contains the response from the Stream Chat API after uploading and sending the image to the specified channel. This typically includes metadata about the uploaded image message such as message ID, URL, timestamps, and channel information.

If the operation succeeds, the output JSON will represent the sent image message object. If it fails, the output may contain an error message describing the failure.

The node does not output binary data directly; instead, it uploads the local image file and returns metadata about the uploaded image message.

Dependencies

  • Requires a valid API key credential for the Stream Chat service configured in n8n.
  • The node uses the Stream Chat server-side client SDK to perform operations.
  • The local file path provided must be accessible by the n8n instance running this node.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect channel type or channel ID can result in "channel not found" errors.
    • Providing an invalid or inaccessible file path will cause file upload errors.
    • Missing required parameters like filePath or channelId will cause validation errors.
  • Error messages:

    • "Unsupported operation": Indicates the selected resource-operation combination is not implemented.
    • "Error in channel.sendImage operation": General failure during image upload or sending; check file path and channel details.
    • Authentication errors usually mention invalid API keys or permissions.
  • Resolutions:

    • Verify API credentials and permissions.
    • Confirm the channel exists and the channel type matches.
    • Ensure the file path is correct and the file is accessible.
    • Provide all required parameters.

Links and References

Discussion