Skip to main content

Receive and process incoming direct messages in Rocket.Chat

Workflow preview

Workflow preview
100%
Receive and process incoming direct messages in Rocket.Chat preview
Open on n8n.io

1. Workflow Overview

Description Use this workflow to automatically check Rocket.Chat for unread direct messages, process the latest user message in each thread, and send a response back to the conversation. It is usef...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.splitout, n8n-nodes-base.splitinbatches, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.filter, n8n-nodes-base.sort, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Wetomate AI.

Original n8n.io source

1.1 Workflow description

Title
Receive and process incoming direct messages in Rocket.Chat
Workflow name
Receive and process incoming direct messages in Rocket.Chat

Description

Use this workflow to automatically check Rocket.Chat for unread direct messages, process the latest user message in each thread, and send a response back to the conversation. It is useful for building automated support, AI chat, or message-handling workflows inside Rocket.Chat.

How it Works

This workflow runs on a schedule and checks Rocket.Chat for new unread direct messages every time-tick using the Schedule Trigger node. It then calls the Rocket.Chat subscriptions.get endpoint to retrieve the current message subscriptions and splits the returned updates into individual items for processing. Next, the workflow filters for unread direct-message conversations and loops through each matching thread one at a time. For each conversation, it loads the direct messages, extracts the relevant user messages, and selects the latest one to use as the input for the response flow.

Before replying, the workflow includes a No Operation step where you can add your own custom logic, such as cleaning the message, passing it to an AI model, applying rules, or formatting the final response. Once processing is complete, the workflow sends the reply back to Rocket.Chat using the Post a message node.

Setup

Before using this workflow, configure your Rocket.Chat connection and update the placeholder values in the HTTP Request and message nodes. You’ll need valid Rocket.Chat API credentials, your Rocket.Chat server URL, and a bot or user account with permission to read direct messages, mark conversations as read, and post replies RocketChat.

Update these nodes before publishing:

  • Subscription.get: set your Rocket.Chat server URL for the subscriptions endpoint RocketChat.
  • IM.Messages: set your Rocket.Chat server URL for the direct message retrieval endpoint RocketChat.
  • Mark as Read: set your Rocket.Chat server URL for the subscriptions read endpoint RocketChat.
  • Post a message: replace the placeholder response text with the message you want the bot to send. You should also review the No Operation, do nothing node and add your own processing logic there if you want to transform the latest user message before replying.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 3 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Subscription.get

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - IM.Messages

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Split Out1

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 7 - Get last

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Only Users Prompt

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 9 - Sort

Type / Role
n8n-nodes-base.sort - sort
Config choices
Version 1

Block 10 - Unread and Direct Messages

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 11 - Mark as Read

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 14 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - RocketChat

Type / Role
n8n-nodes-base.rocketchat - rocketchat
Config choices
Version 1

Block 16 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Receive and process incoming direct messages in Rocket.Chat
Complexity advanced
Nodes 18
Categories Support Chatbot, AI Chatbot
Author Wetomate AI
Published 17 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15775/15775.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Receive and process incoming direct messages in Rocket.Chat do?

Description Use this workflow to automatically check Rocket.Chat for unread direct messages, process the latest user message in each thread, and send a response back to the conversation. It is usef...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.