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 Message Flags" operation allows users to query message flags used in moderation workflows. This is useful for retrieving flagged messages that may require review or further action.

Common scenarios include:

  • Moderators fetching flagged messages to review inappropriate content.
  • Automating workflows that respond to flagged messages (e.g., sending alerts or escalating issues).
  • Auditing moderation actions by querying flags with specific filters.

Example: A moderator wants to retrieve all messages flagged by an automated moderation system since a certain date to review them manually.

Properties

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

Output

The output is an array of JSON objects, each representing a message flag matching the query criteria. Each object contains details about a flagged message, such as who flagged it, the reason, timestamps, and other metadata relevant to moderation.

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 uses the platform's server-side client SDK to interact with the moderation API.
  • Proper configuration of the API credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid JSON in Filter Query: If the filter query string is not valid JSON, the node will throw a parsing error. Ensure the filter query is correctly formatted JSON.
  • Permission Errors: Insufficient API permissions can cause authorization errors. Verify that the API key has moderation read access.
  • Empty Results: If no flags match the filter, the output will be an empty array. Adjust the filter or increase the limit if needed.
  • Rate Limits: Excessive queries might hit API rate limits. Implement retries or reduce query frequency.

Links and References

Discussion