Search all guides

Reference · Tools

RocketChat integration

Post messages to channels or direct messages on a Rocket.Chat server, including rich attachments and custom sender details.

Action Communication v1

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.

Works as
Action
Tool name
rocketchat
Operations
1 — Chat: Post Message
Parameters
9
Outputs
Output, Error
Credentials
Rocket.Chat API
Official docs
RocketChat docs developer.rocket.chat

What you can build with RocketChat

  • 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.

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.

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Rocket.Chat API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Chatchat

Operations

OperationValueDescription
Chat: Post MessagepostMessagePost a message to a channel or a direct message.

Parameters

Chat: Post Message

ParameterTypeRequiredDefaultDescription
ChannelstringYes—The channel name with the prefix in front of it (e.g., “#general”, “@username”). Use # for channels, @ for direct messages. Supports expressions.
TextstringNo—The text of the message to send. Optional if attachments are provided. Supports expressions.
JSON ParametersbooleanNofalseWhether to provide attachments as a raw JSON array instead of using structured fields.
OptionscollectionNo{}Additional options for the message.
— AliasstringNo—This will cause the message’s name to appear as the given alias, but your username will still display.
— AvatarstringNo—If provided, this will make the avatar use the provided image URL.
— EmojistringNo—If provided, this will set the avatar to the specified emoji (e.g., “:smile:”).
AttachmentscollectionNo{}Rich attachment objects to include with the message. Add one entry per attachment block. (shown when JSON Parameters is false)
— ColorstringNo#ff0000The color for the left-side border. Any CSS background-color value.
— TextstringNo—The text to display for this attachment, different from the message text.
— TimestampstringNo—Displays the time next to the text portion. Use ISO 8601 format.
— Thumb URLstringNo—An image that displays to the left of the text. Best when relatively small.
— Message LinkstringNo—Only applicable if timestamp is provided. Makes the time clickable to this link.
— CollapsedbooleanNofalseWhether the image, audio, and video sections should be hidden when collapsed.
— Author NamestringNo—Name of the author.
— Author LinkstringNo—Providing this makes the author name clickable and points to this link.
— Author IconstringNo—Displays a tiny icon to the left of the author name.
— TitlestringNo—Title to display for this attachment, displayed under the author.
— Title LinkstringNo—Providing this makes the title clickable, pointing to this link.
— Title Link DownloadbooleanNofalseWhether clicking the title saves the link to file.
— Image URLstringNo—The image to display. Will be “big” and easy to see.
— Audio URLstringNo—Audio file to play. Only supports what HTML audio does.
— Video URLstringNo—Video file to play. Only supports what HTML video does.
— FieldsfixedCollectionNo{}Labelled rows displayed inside the attachment. Add one entry per row.
— — ShortbooleanNofalseWhether this field should be a short field (displayed inline).
— — TitlestringNo—The title of this field.
— — ValuestringNo—The value of this field, displayed underneath the title.
Attachments (JSON)jsonNo—A JSON array of attachment objects. See Rocket.Chat API documentation for the attachment schema. (shown when JSON Parameters is true)

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum 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.

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

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

This tool posts messages to Rocket.Chat channels or direct messages. It is the right tool when you need to send notifications or communications within Rocket.Chat without requiring a direct, interactive response. The tool produces a successfully posted message within the specified Rocket.Chat conversation.

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 RocketChat

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 BusyBot

Last reviewed . Spotted something wrong? Tell us.