Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Overview

The "Check Automod" operation in the Moderation resource allows you to perform an automated moderation check on a given message text, optionally scoped to a specific channel. This operation simulates running the message through Stream Chat's automoderation system to detect potential violations such as inappropriate content or spam.

This node is useful in scenarios where you want to pre-validate messages before posting them publicly or take automated actions based on moderation results. For example, you could use it to:

  • Automatically screen user-generated content for policy violations.
  • Integrate with custom workflows that require content approval.
  • Provide real-time feedback to users about message acceptability.

In this implementation, the automod check always returns a "passed" result with a placeholder message, indicating that actual filtering rules need to be configured in the Stream Chat dashboard for real enforcement.

Properties

Name Meaning
Message ID ID of the message to moderate (not used directly in this operation but available for context).
Channel CID Channel identifier in the format type:ID (e.g., messaging:general). Leave empty for global checks or specify to scope to a particular channel.
Message Text The text content of the message to check for automod violations.

Output

The output JSON object contains the following fields:

  • text: The original message text submitted for checking.
  • channel_cid: The channel CID if specified; otherwise, empty.
  • automod_result: A string indicating the automod check result. In this implementation, it is always "passed".
  • message: A descriptive message about the automod check status. Here it states: "Automod check completed - configure Stream Chat automod rules for actual filtering".

No binary data is produced by this operation.

Example output JSON:

{
  "text": "some message text",
  "channel_cid": "messaging:general",
  "automod_result": "passed",
  "message": "Automod check completed - configure Stream Chat automod rules for actual filtering"
}

Dependencies

  • Requires a valid API key credential for Stream Chat with permissions to perform moderation operations.
  • The node uses the Stream Chat server-side client SDK internally.
  • No additional environment variables are required beyond the API credentials configured in n8n.

Troubleshooting

  • Common Issue: The automod check always returns "passed" regardless of message content.

    • Explanation: This node implementation provides a stub response and does not enforce actual automod rules.
    • Resolution: Configure automod rules in your Stream Chat dashboard to enable real filtering.
  • Error Messages:

    • If the node throws an error like Unsupported operation: moderation.checkAutomod, ensure that the Resource is set to "Moderation" and Operation to "Check Automod".
    • Authentication errors indicate invalid or missing API credentials; verify your Stream Chat API key setup in n8n.
  • Input Validation:

    • Ensure the Message Text property is provided and non-empty to get meaningful results.
    • The Channel CID should follow the correct format (type:ID) if specified.

Links and References

Discussion