Real-Time Message Processor via MQTT Trigger - n8n Workflow

Use this n8n workflow template to automatically trigger processes based on real-time messages received from an MQTT queue. Essential for IoT and system integrations.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

n8n Nodes Used

Who is this best for?

IoT Developers needing to process device data in real-time.
DevOps Engineers requiring automated responses to system telemetry or health checks.
Users looking for robust n8n templates for event-driven architecture.
Anyone building integrations relying on the MQTT protocol using a specialized n8n node.

Overview

This foundational n8n workflow solves the critical integration problem of connecting message queue systems (specifically MQTT) directly into powerful automation flows. MQTT is the standard communication protocol for many IoT and industrial applications, making integration capability vital. By using the dedicated MQTT n8n trigger, users can ensure that any data published to a specific topic instantly activates downstream logic—whether that involves updating a database, sending alerts, or initiating a complex data processing sequence. This specific n8n workflow provides the necessary, reliable starting point for building scalable, reactive, event-driven systems within n8n.

How it Works

This is a simple, single-step n8n workflow designed purely for ingestion and triggering. The flow starts immediately when a message is published to the configured topic on the connected MQTT broker.


  1. Setup & Connection: The user first establishes and saves the global MQTT connection credentials within n8n.

  2. Listen: The MQTT n8n node is configured to listen continuously to a specific, defined MQTT topic (e.g., telemetry/sensorid42).

  3. Trigger: When a message payload is received on that topic, the MQTT n8n trigger captures the data, transforms it into n8n's standard item structure, and initiates the execution of the full n8n workflow. The output of this n8n node is the message payload itself, ready for further processing by subsequent nodes.

Installation Guide

To deploy this n8n workflow and start capturing MQTT messages, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance via the 'New' menu -> 'Import from JSON'.

  2. Set Credentials: This n8n workflow requires MQTT credentials. Navigate to Settings -> Credentials and create a new MQTT credential instance, providing the Broker URL, port, and any necessary authentication (username/password).

  3. Configure the n8n Node: Click on the 'MQTT Trigger' n8n node. Ensure the correct credential is selected, and crucially, define the exact 'Topic' you want this n8n trigger to subscribe to. Topics are case-sensitive.

  4. Activate: Save the n8n workflow and toggle the 'Active' switch on the top left. The n8n trigger will immediately begin listening for real-time messages.

Node Details

MQTT Trigger
Function: Acts as the primary n8n trigger, listening for real-time messages published to a defined MQTT topic. It is the gatekeeper that starts the entire n8n workflow upon receiving data.
* Key Configuration: Requires a configured MQTT credential pointing to your broker. The user must manually input the specific MQTT Topic subscription pattern (e.g., devices/+/status) within the n8n node configuration for the flow to function correctly.

Related n8n Workflows

Free

Nodes: 1 Nodes
Updated: December 26 2025
View all
Created by
ghagrawal17
ghagrawal17

Featured*