Mattermost Trigger icon

Mattermost Trigger

Trigger for Mattermost events

Mattermost Trigger

AI-generated

Overview

This node acts as a trigger for Mattermost events by establishing a WebSocket connection to a specified Mattermost server URL. It listens for real-time events such as new messages posted, users joining, or channels being deleted. When the selected event occurs, the node emits the event data, allowing workflows to react immediately.

Common scenarios include:

  • Automating responses or notifications when a new message is posted in Mattermost.
  • Tracking user join events to update team rosters or send welcome messages.
  • Monitoring channel deletions to maintain audit logs or clean up related resources.

Example: Automatically send a notification email whenever a new message is posted in a Mattermost channel.

Properties

Name Meaning
Event Type The type of Mattermost event to listen for. Options: "On Message Posted", "On User Joined", "On Channel Deleted".
WebSocket URL The WebSocket URL of the Mattermost server to connect to, e.g., ws://your-server.com/api/v4/websocket.

Output

The node outputs JSON data representing the event payload received from Mattermost:

  • For the "On Message Posted" event, the output JSON contains the parsed post object with detailed message information.
  • For other events ("On User Joined", "On Channel Deleted"), the output JSON contains the full event data as received.

The output is always an array of JSON objects, each representing one event occurrence.

No binary data output is produced by this node.

Dependencies

  • Requires a valid API authentication token (an API key credential) for Mattermost to authorize the WebSocket connection.
  • The WebSocket URL must be accessible and correctly configured on the Mattermost server.
  • Uses the ws library internally to manage WebSocket connections.

Troubleshooting

  • WebSocket Connection Issues: If the node fails to connect, verify the WebSocket URL and ensure the Mattermost server is reachable and supports WebSocket connections.
  • Authentication Errors: Ensure the provided API token has sufficient permissions and is valid.
  • Event Filtering: If no events are emitted, confirm that the selected event type matches the actual events occurring on the server.
  • JSON Parsing Errors: Malformed event data may cause parsing errors; check server logs or network issues if errors appear in the console.
  • NodeOperationError: This generic error indicates a problem with the WebSocket connection or message handling; reviewing the above points usually resolves it.

Links and References

Discussion