RocketChat icon

RocketChat

Consume Rocket Chat API

Message → Send Message

AI-generated

Overview

This n8n node allows you to send messages to Rocket.Chat rooms. It is designed for automation scenarios where you want to programmatically post messages, such as sending alerts, notifications, or updates to specific chat rooms from workflows. For example, you could use this node to notify a team about a new support ticket, deployment status, or any event that requires real-time communication in Rocket.Chat.

Properties

Name Type Meaning
Room Name or ID options The target room for the message. You can select from available rooms or specify a room ID using an expression.
Message string The text content of the message to be sent.
Additional Fields collection Optional fields to customize the message:
• Thread ID: Send as a reply in a thread.
• Alias: Display a custom sender name.
• Emoji: Use an emoji as the avatar.
• Avatar: Use a custom image URL as the avatar.

Output

The output is a JSON object containing the response from the Rocket.Chat API after sending the message. Typical fields may include:

{
  "message": {
    "_id": "string",
    "rid": "string",
    "msg": "string",
    "alias": "string",
    "emoji": "string",
    "avatar": "string",
    // ...other Rocket.Chat message properties
  },
  "success": true
}

If an error occurs and "Continue On Fail" is enabled, the output will contain an error field with the error message:

{
  "error": "Error message"
}

Dependencies

  • Rocket.Chat instance: You must have access to a running Rocket.Chat server.
  • API Credentials: Requires a credential named rocketChatApi configured in n8n with appropriate permissions (API URL, user ID, and auth token).
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

  • Invalid Room ID: If the specified room does not exist or the user does not have access, the API will return an error. Double-check the room selection or ID.
  • Missing Required Fields: If "Room Name or ID" or "Message" is empty, the node will throw an error.
  • Unknown Operation/Resource: If an unsupported operation or resource is selected, the node will throw an error like:
    • The operation "X" is not known!
    • The resource "Y" is not known!
  • Authentication Errors: If credentials are missing or invalid, the node will fail with an authentication error from the Rocket.Chat API.

Links and References

Discussion