n8n connects to Mosquitto via its native MQTT Trigger node. When a device publishes a message to a Mosquitto topic (e.g., factory/line-3/temp), n8n receives the message and begins executing a workflow — no polling required. This makes Mosquitto the edge data source and n8n the downstream business logic engine.
IoT Device → Mosquitto broker (port 1883)
↓
n8n MQTT Trigger node (subscriber)
↓
n8n workflow (transform, route, store, notify)
↓
ERP / Database / Slack / Email / AI
n8n acts as an MQTT client subscribing to one or more topics. Mosquitto handles QoS, session persistence, and retained messages — n8n processes each message as a workflow execution.
+ single level, # multi-level)body output (JSON-parsed message payload)