n8n-nodes-rocket-chat
v0.2.0
Published
Community node for Rocket.Chat (send, files, webhook/polling/realtime receive)
Maintainers
Readme
n8n-nodes-rocket-chat
A comprehensive n8n community node for Rocket.Chat integration, enabling powerful chat automation workflows.
🚀 Features
Core Capabilities
- Send Messages: Post messages to channels, groups, and direct messages
- File Upload: Upload files to rooms with optional message attachments
- Message Management: Update and delete existing messages
- Direct Messaging: Open DM channels and send private messages
- Real-time Triggers: Receive messages via webhook, polling, or WebSocket
Three Powerful Nodes
🔥 Rocket.Chat Message
Complete message management with advanced targeting options:
- Operations: Post, Send (advanced), Update, Delete messages
- Direct Messages: Open DM channels and send private messages
- Flexible Targeting: Text input (#channel/@user/roomId) or dropdown selectors
- Rich Features: Thread replies, custom avatars, emoji support, attachments
📁 Rocket.Chat File
Seamless file upload capabilities:
- Upload files to any room (channels, groups, DMs)
- Optional message text with file uploads
- Flexible room targeting options
- Support for various file types
⚡ Rocket.Chat Trigger
Multiple ways to receive messages:
- Webhook: Real-time HTTP webhook integration
- Polling: Regular API polling for new messages
- WebSocket: Real-time stream for instant message reception
- Configurable room filtering and message processing
📦 Installation
Option 1: n8n Community Nodes (Recommended)
- Go to Settings → Community Nodes in your n8n instance
- Install:
n8n-nodes-rocket-chat - Restart n8n
Option 2: Manual Installation
# Install in your n8n installation directory
npm install n8n-nodes-rocket-chat
# For self-hosted n8n
cd ~/.n8n/nodes
npm install n8n-nodes-rocket-chatOption 3: Docker
Add to your n8n Docker environment:
docker run -it --rm \
-p 5678:5678 \
-e N8N_NODES_INCLUDE="n8n-nodes-rocket-chat" \
n8nio/n8n🔧 Configuration
Credentials Setup
- In Rocket.Chat, go to Administration → Personal Access Tokens
- Create a new Personal Access Token
- In n8n, create new Rocket.Chat PAT credentials:
- Base URL: Your Rocket.Chat server URL (e.g.,
https://open.rocket.chat) - User ID: Your Rocket.Chat user ID
- Auth Token: The personal access token from step 2
- Default Target (optional): Default channel/user for messages
- Base URL: Your Rocket.Chat server URL (e.g.,
API Permissions
Ensure your Rocket.Chat user has appropriate permissions:
chat.postMessage- Send messageschat.update- Update messageschat.delete- Delete messagesupload-file- Upload filesim.open- Open direct messages
🎯 Usage Examples
Basic Message Sending
// Send a message to #general channel
{
"operation": "post",
"target": "#general",
"text": "Hello from n8n! 🚀"
}File Upload with Message
// Upload file to a room
{
"targetMode": "text",
"target": "#announcements",
"message": "Weekly report attached",
"file": "{{ $binary.file }}"
}Real-time Message Trigger
// WebSocket trigger configuration
{
"mode": "realtime",
"rooms": ["GENERAL", "random"],
"includeAll": false
}Direct Message Workflow
// Open DM and send message
{
"operation": "sendDm",
"dmUsername": "john.doe",
"text": "Your task has been completed ✅"
}🛠 Development
Prerequisites
- Node.js 18+
- TypeScript 5+
- n8n development environment
Build from Source
# Clone repository
git clone https://github.com/your-repo/n8n-nodes-rocket-chat.git
cd n8n-nodes-rocket-chat
# Install dependencies
npm install
# Build
npm run build
# Development mode
npm run devProject Structure
├── credentials/ # Authentication credentials
│ └── RocketChatPat.credentials.ts
├── nodes/ # Node implementations
│ ├── RocketChatMessage.node.ts
│ ├── RocketChatFile.node.ts
│ └── RocketChatTrigger.node.ts
├── transport/ # API utilities
│ └── GenericFunctions.ts
└── dist/ # Compiled output🔌 API Reference
Rocket.Chat REST API Endpoints Used
POST /api/v1/chat.postMessage- Send messagesPOST /api/v1/chat.sendMessage- Send messages (advanced)POST /api/v1/chat.update- Update messagesPOST /api/v1/chat.delete- Delete messagesPOST /api/v1/rooms.upload- Upload filesPOST /api/v1/im.open- Open direct messagesGET /api/v1/channels.list.joined- List channelsGET /api/v1/groups.list- List private groupsGET /api/v1/im.list- List direct messages
WebSocket Realtime API
stream-room-messages- Real-time message streaming
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit:
git commit -m 'feat: add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support & Issues
- Documentation: n8n Community Nodes Docs
- Issues: GitHub Issues
- Rocket.Chat API: Official API Documentation
🙏 Acknowledgments
- Built with ❤️ for the n8n community
- Powered by Rocket.Chat API
- Compatible with n8n workflow automation platform
Made possible by: n8n | Rocket.Chat
