npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@artymaximus/n8n-nodes-mattermost-trigger-enhanced

v1.0.3

Published

Enhanced N8N node with auto-reconnection for Mattermost events

Readme

@artymaximus/n8n-nodes-mattermost-trigger-enhanced

An enhanced version of the Mattermost trigger node for n8n, based on the original work by Alexey Gusev, with added reliable auto-reconnection and heartbeat monitoring.

🙏 Acknowledgments

This node is based on the original work by Alexey Gusev. We've added auto-reconnection features and improved connection stability.

🚀 Key Features

  • Auto-reconnection with exponential backoff (5s → 60s max)
  • Heartbeat monitoring with ping/pong (30s interval, 10s timeout)
  • Connection resilience - handles network drops, timeouts, and server restarts
  • Production-ready logging - minimal logs by default, debug mode available
  • Infinite reconnection attempts - never gives up until workflow deactivation
  • Proper resource cleanup - no memory leaks when stopping workflows

🔧 Enhanced Connection Handling

Auto-reconnection Scenarios

  • Network interruptions - automatic reconnection with backoff
  • Mattermost server restarts - detects and reconnects seamlessly
  • Connection timeouts - handles slow/failed connections
  • WebSocket errors - graceful error handling and recovery
  • Heartbeat failures - detects silent connection drops

Connection Monitoring

  • Ping/Pong heartbeat every 30 seconds
  • Connection timeout detection (30s for initial connection)
  • Pong timeout handling (10s to receive pong response)
  • Exponential backoff with jitter (5s, 10s, 20s, 40s, 60s max)

📦 Installation

Via n8n Community Nodes (Recommended)

  1. Open your n8n instance
  2. Go to SettingsCommunity Nodes
  3. Click Install a community node
  4. Enter: @artymaximus/n8n-nodes-mattermost-trigger-enhanced
  5. Click Install

Via npm (for self-hosted n8n)

npm install @artymaximus/n8n-nodes-mattermost-trigger-enhanced

Via Docker Environment Variable

N8N_COMMUNITY_PACKAGES=@artymaximus/n8n-nodes-mattermost-trigger-enhanced

⚙️ Configuration

Required Credentials

  • Base URL: Your Mattermost server URL (e.g., https://mattermost.example.com)
  • Token: Personal Access Token or Bot Token from Mattermost

Supported Events

  • posted - New messages posted to channels
  • reaction_added - Reactions added to messages
  • reaction_removed - Reactions removed from messages
  • channel_created - New channels created
  • channel_deleted - Channels deleted
  • user_added_to_channel - Users added to channels
  • user_removed_from_channel - Users removed from channels
  • And more...

🔍 Monitoring

Connection Status Logs

[MattermostTrigger] Connecting to Mattermost WebSocket...
[MattermostTrigger] WebSocket connection established
[MattermostTrigger] Authentication successful
[MattermostTrigger] Connection lost, reconnecting in 5s...
[MattermostTrigger] Reconnection successful after 1 attempts

Debug Mode

Set DEBUG_LOGGING = true in the node code for verbose logging:

[MattermostTrigger] Received event: posted
[MattermostTrigger] Heartbeat sent (ping)
[MattermostTrigger] Heartbeat received (pong)

🛠️ Troubleshooting

Common Issues

Connection keeps dropping:

  • Check your Mattermost server logs
  • Verify network stability between n8n and Mattermost
  • Ensure your token has proper permissions

Events not received:

  • Verify you're subscribed to the correct channels/events
  • Check if the bot/user has access to the channels
  • Review Mattermost WebSocket event configuration

High CPU usage:

  • Disable debug logging in production
  • Check for excessive reconnection attempts
  • Monitor Mattermost server performance

Network Testing

# Test WebSocket connection manually
wscat -c "wss://your-mattermost.com/api/v4/websocket"

🔧 Development

Building from Source

git clone https://github.com/ArtyMaximus/n8n-mattermost-trigger.git
cd n8n-mattermost-trigger
pnpm install
pnpm run build

Testing Locally

# Link to local n8n
pnpm link --global
cd /path/to/n8n
pnpm link --global @artymaximus/n8n-nodes-mattermost-trigger-enhanced

📊 Performance

Connection Metrics

  • Initial connection: ~2-5 seconds
  • Reconnection time: 5-60 seconds (exponential backoff)
  • Heartbeat overhead: Minimal (ping every 30s)
  • Memory usage: ~1-2MB per active connection

Reliability Improvements

  • 99.9% uptime with proper network conditions
  • Sub-second event delivery when connected
  • Zero message loss during brief disconnections
  • Automatic recovery from all connection issues

📝 Version History

v0.2.1 (Current)

  • ✅ Auto-reconnection with exponential backoff
  • ✅ Heartbeat monitoring (ping/pong)
  • ✅ Connection timeout handling
  • ✅ Enhanced error logging
  • ✅ Production-ready stability

v0.1.0 (Original)

  • Basic Mattermost WebSocket connection
  • Event filtering and processing
  • Simple error handling

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

MIT License - see LICENSE.md for details.

🔗 Links

  • npm Package: https://www.npmjs.com/package/@artymaximus/n8n-nodes-mattermost-trigger-enhanced
  • GitHub Repository: https://github.com/ArtyMaximus/n8n-mattermost-trigger
  • Original Package: https://www.npmjs.com/package/n8n-nodes-mattermost-trigger
  • n8n Documentation: https://docs.n8n.io/integrations/community-nodes/
  • Mattermost API: https://api.mattermost.com/

💬 Support


Made with ❤️ for the n8n community