Description
@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
- ✅ 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
- 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)
🔧 Enhanced Connection Handling
Auto-reconnection Scenarios
Connection Monitoring
📦 Installation
Via n8n Community Nodes (Recommended)
1. Open your n8n instance
2. Go to Settings → Community 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
N8NCOMMUNITYPACKAGES=@artymaximus/n8n-nodes-mattermost-trigger-enhanced
⚙️ Configuration
Required Credentials
https://mattermost.example.com)Supported Events
posted – New messages posted to channelsreaction_added – Reactions added to messagesreaction_removed – Reactions removed from messageschannel_created – New channels createdchannel_deleted – Channels deleteduseraddedto_channel – Users added to channelsuserremovedfrom_channel – Users removed from channels🔍 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:
Events not received:
High CPU usage:
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
Reliability Improvements
📝 Version History
v0.2.1 (Current)
v0.1.0 (Original)
🤝 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
💬 Support
—
Made with ❤️ for the n8n community