Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The node performs server-side moderation-related operations for a chat platform. Specifically, the Query Flags operation allows users to query moderation flags that have been raised within the system, such as flags on users or messages indicating potential violations or issues.

This node is beneficial in scenarios where automated or manual moderation workflows are needed to monitor flagged content or users. For example, a community manager might use this node to retrieve all flags created by an automated moderation system or to review recent user reports for inappropriate behavior.

Practical examples include:

  • Fetching all flags created by an automated moderation bot to review them.
  • Querying flags filtered by date or user ID to focus on specific cases.
  • Limiting the number of results returned to manage data volume.

Properties

Name Meaning
Filter Query A JSON string representing a MongoDB-style filter to narrow down which flags to query. Examples: {"created_by_automod": true}, {"user_id": "specific_user"}, {"created_at": {"$gte": "2023-01-01"}}
Limit The maximum number of flag results to return. Must be a positive integer (minimum 1). Default is 50.

Output

The output is a JSON array containing the queried moderation flags matching the filter criteria. Each item in the array represents a moderation flag object with details about the flag, such as who created it, the reason, timestamps, and related user or message information.

No binary data is output by this operation.

Dependencies

  • Requires an API key credential with permissions to perform moderation queries on the chat platform.
  • The node depends on the Stream Chat server-side client library to interact with the chat service's moderation API.
  • Proper configuration of the API credentials in n8n is necessary for authentication.

Troubleshooting

  • Common Issues:

    • Invalid JSON syntax in the Filter Query property can cause parsing errors.
    • Using filters that do not match any records will result in empty outputs.
    • Insufficient API permissions may lead to authorization errors.
  • Error Messages:

    • "Unsupported operation: moderation.queryFlags": Indicates the operation name or resource was incorrectly specified.
    • JSON parsing errors for the filter query: Ensure the filter query is valid JSON.
    • API errors related to authentication or rate limits: Verify API credentials and usage limits.
  • Resolutions:

    • Validate JSON filter strings before input.
    • Check API key permissions and update if necessary.
    • Use smaller limit values or more specific filters to reduce data load.

Links and References

Discussion