Reference · Tools
RocketChat
Post messages to channels and direct messages on a Rocket.Chat server.
The RocketChat node posts messages to channels and direct messages on a Rocket.Chat server, with attachments. A typical build is routing alerts into the right channel with structured attachment blocks rather than a wall of plain text.
- Node type
- Action
- Parameters
- 9
- Outputs
- Output, Error
- Credentials
- Rocket.Chat API
RocketChat
Post messages to channels and direct messages on a Rocket.Chat server.
Overview
Rocket.Chat is an open-source team communication platform. This tool posts messages to Rocket.Chat channels or direct messages using the REST API. It supports plain text messages, rich attachments with colors/images/fields, custom aliases, avatars, and emoji overrides. Authentication uses User ID and Auth Token headers. Attachments can be provided via structured UI fields or raw JSON.
Category: Communication
Tool Name: rocketchat
Version: 1
Appearance: Icon: si-rocketdotchat | Color: #F5455C
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires Rocket.Chat API credentials. See the Credentials Guide for setup instructions.
Resources
| Resource | Value |
|---|---|
| Chat | chat |
Operations
| Operation | Value | Description |
|---|---|---|
| Chat: Post Message | postMessage | Post a message to a channel or a direct message. |
Parameters
Chat: Post Message
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Channel | string | Yes | — | The channel name with the prefix in front of it (e.g., “#general”, “@username”). Use # for channels, @ for direct messages. Supports expressions. |
| Text | string | No | — | The text of the message to send. Optional if attachments are provided. Supports expressions. |
| JSON Parameters | boolean | No | false | Whether to provide attachments as a raw JSON array instead of using structured fields. |
| Options | collection | No | {} | Additional options for the message. |
| — Alias | string | No | — | This will cause the message’s name to appear as the given alias, but your username will still display. |
| — Avatar | string | No | — | If provided, this will make the avatar use the provided image URL. |
| — Emoji | string | No | — | If provided, this will set the avatar to the specified emoji (e.g., “:smile:”). |
| Attachments | collection | No | {} | Rich attachment objects to include with the message. Add one entry per attachment block. (shown when JSON Parameters is false) |
| — Color | string | No | #ff0000 | The color for the left-side border. Any CSS background-color value. |
| — Text | string | No | — | The text to display for this attachment, different from the message text. |
| — Timestamp | string | No | — | Displays the time next to the text portion. Use ISO 8601 format. |
| — Thumb URL | string | No | — | An image that displays to the left of the text. Best when relatively small. |
| — Message Link | string | No | — | Only applicable if timestamp is provided. Makes the time clickable to this link. |
| — Collapsed | boolean | No | false | Whether the image, audio, and video sections should be hidden when collapsed. |
| — Author Name | string | No | — | Name of the author. |
| — Author Link | string | No | — | Providing this makes the author name clickable and points to this link. |
| — Author Icon | string | No | — | Displays a tiny icon to the left of the author name. |
| — Title | string | No | — | Title to display for this attachment, displayed under the author. |
| — Title Link | string | No | — | Providing this makes the title clickable, pointing to this link. |
| — Title Link Download | boolean | No | false | Whether clicking the title saves the link to file. |
| — Image URL | string | No | — | The image to display. Will be “big” and easy to see. |
| — Audio URL | string | No | — | Audio file to play. Only supports what HTML audio does. |
| — Video URL | string | No | — | Video file to play. Only supports what HTML video does. |
| — Fields | fixedCollection | No | {} | Labelled rows displayed inside the attachment. Add one entry per row. |
| — — Short | boolean | No | false | Whether this field should be a short field (displayed inline). |
| — — Title | string | No | — | The title of this field. |
| — — Value | string | No | — | The value of this field, displayed underneath the title. |
| Attachments (JSON) | json | No | — | A JSON array of attachment objects. See Rocket.Chat API documentation for the attachment schema. (shown when JSON Parameters is true) |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. |
Output Data
One output item is produced per input item, on the Output port. Rocket.Chat’s response to the post — its record of the message that was created — is merged onto the item JSON at the top level rather than nested under a wrapper property, so the rest of the incoming item passes through unchanged and response fields are addressed directly by expression. Binary data on the input item is forwarded untouched. The node never fans out: one input item is one posted message and one output item.
When the server replies with an empty body, nothing is merged and the item passes straight through. A non-2xx reply raises an item error carrying the HTTP status; failures go to the Error port in errorPort mode, carrying _error.
Usage Examples
- Send a message to a Rocket.Chat channel
- Post a notification to #general in Rocket.Chat
- Send a direct message to a Rocket.Chat user
- Post a message with rich attachments to Rocket.Chat
- Send a Rocket.Chat message with a custom alias and avatar
Example Configuration
Post plain text to a channel:
{
"type": "rocketchat",
"parameters": {
"resource": "chat",
"operation": "postMessage",
"channel": "#notifications",
"text": "{{ $json.message }}"
}
}
Send the same message as a direct message by using the @ prefix:
{
"type": "rocketchat",
"parameters": {
"resource": "chat",
"operation": "postMessage",
"channel": "@john.doe",
"text": "Hi John, your export finished."
}
}
Post under a custom display name and emoji avatar:
{
"type": "rocketchat",
"parameters": {
"resource": "chat",
"operation": "postMessage",
"channel": "#alerts",
"text": "ALERT: {{ $json.alertMessage }}",
"options": {
"alias": "Alert Bot",
"emoji": ":warning:"
}
}
}
Attach a coloured status card with two inline fields — Attachments is a repeating field, so its value is a list:
{
"type": "rocketchat",
"parameters": {
"resource": "chat",
"operation": "postMessage",
"channel": "#status",
"text": "System Status Report",
"jsonParameters": false,
"attachments": [
{
"color": "#36a64f",
"title": "All Systems Operational",
"titleLink": "https://status.example.com",
"authorName": "Status Monitor",
"collapsed": false,
"fields": {
"fieldsValues": [
{ "title": "Uptime", "value": "{{ $json.uptime }}", "short": true },
{ "title": "Response Time", "value": "{{ $json.responseTime }}ms", "short": true }
]
}
}
]
}
}
Supply the attachments as raw JSON instead — the value is the text of a JSON array:
{
"type": "rocketchat",
"parameters": {
"resource": "chat",
"operation": "postMessage",
"channel": "#general",
"text": "Status update with multiple attachments:",
"jsonParameters": true,
"attachmentsJson": "[{\"color\":\"#36a64f\",\"title\":\"Server Status\",\"text\":\"All systems operational\"},{\"color\":\"#ff9900\",\"title\":\"Maintenance Window\",\"text\":\"Scheduled maintenance tonight at 2 AM\"}]"
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Post messages to channels and direct messages on a Rocket.Chat server via the REST API.
Notes
- Give the message something to show: Text may be left empty only when you supply at least one attachment.
- JSON Parameters chooses which attachment input the node reads. With it off, Attachments is used and Attachments (JSON) is ignored; with it on, the reverse.
- Attachments is a repeating field — its value is a list of attachment objects, and each entry becomes one attachment block in Rocket.Chat. A single object supplied where a list is expected is ignored.
- Attachments (JSON) is parsed as text. If it is not valid JSON, the message is still posted, just without attachments.
- Channel, Text, Options and the attachment fields all accept
{{ … }}expressions, so a card’s colour, title and field values can come from the item.
Frequently asked questions
Can I post a message with no text?
Only if you supply at least one attachment. Text may be left empty in that case, but a message with neither text nor attachment has nothing to show.
What does the JSON Parameters toggle change?
Which attachment input is read. With it off, Attachments is used and Attachments (JSON) is ignored; with it on, the reverse.
How are attachments structured?
Attachments is a repeating field whose value is a list of attachment objects, so several can be attached to one message.
Which credential does it need?
A Rocket.Chat API credential for the server you are posting to.
Build with the RocketChat node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Rocket.Chat API credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.