MQTT
Message Brokers integration · 6 node(s) including 1 trigger.
00Overview
Talk to an MQTT broker from a flow — publish messages to a topic, read or clear a topic's retained value, wait for a message to arrive, or publish a request and wait for the reply. The trigger goes the other way: it starts a flow the moment a message lands on a topic you are watching, so a device, sensor or service can kick off automation just by publishing.
Every field below is exactly what you see in the Flomation editor. Fields marked ● live picker let you choose from a list pulled live from your account — no IDs to look up.
01Connecting MQTT
- Pick the Protocol your broker speaks:
mqtt(plain),mqtts(TLS), orws/wssfor MQTT over WebSockets. Use an encrypted option for anything crossing a network you do not control. - Enter the Broker Host as a bare hostname or IP — no
mqtt://in front of it — and set the Port if it is not the default (1883 plain, 8883 TLS, 8083 WebSocket, 8084 secure WebSocket). - If the broker requires credentials, fill in Username and Password, adding the password as an environment secret (e.g.
mqtt_pass). Leave both empty for a broker that allows anonymous clients. - For a broker with a privately-signed certificate, paste its authority into CA Certificate. If the broker also demands a client certificate (mutual TLS), add Client Certificate and Client Key. Allow Insecure TLS turns certificate checking off altogether — keep it for a self-signed test broker and nothing else.
- Leave Client ID blank and Flomation picks one for you: the actions get a fresh ID for every run, so they never collide on a shared broker, while the trigger keeps a stable one across reconnects — that is the identity the broker keys the trigger's queued messages to. Set it yourself only if your broker insists on a particular ID — some managed IoT services tie the client ID to the registered device and refuse the connection otherwise.
| Field | Type | Details | |
|---|---|---|---|
| Protocol | string | Required | MQTT (TCP), MQTT over TLS, MQTT over WebSocket, MQTT over Secure WebSocket |
| Password | secret | Broker password | |
| CA Certificate | secret | PEM-encoded CA cert — only for a privately-signed broker | |
| Client Certificate | secret | PEM-encoded client cert — only for mutual-TLS brokers | |
| Client Key | secret | PEM-encoded client private key — only for mutual-TLS brokers | |
| Allow Insecure TLS | boolean | Skip certificate verification — only for a self-signed broker | |
| Broker Host | string | Required | broker.example.com — hostname or IP, no scheme |
| Port | integer | 1883 (MQTT), 8883 (TLS), 8083 (WebSocket) | |
| Username | string | Leave empty for an anonymous broker | |
| Client ID | string | Leave empty to generate a unique ID per run (recommended) |
${secrets.your_secret}.02Message
MQTT: Wait for Message
messagebrokers/mqtt/message_wait · Action
Pause the flow and wait for the next message on a topic, up to a timeout. Use it to wait for a device to report back mid-flow. Check the Received output to branch on whether a message actually arrived.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Topic | string | Required | sensors/kitchen/+ — wildcards allowed (+ one level, # the rest) |
| Delivery Guarantee (QoS) | string | choices: 0 — At most once (fire and forget), 1 — At least once (acknowledged), 2 — Exactly once | |
| Wait For (seconds) | integer | 30 — how long to listen before giving up (maximum 300) | |
| Ignore Retained Value | boolean | Ticked (default): wait for a genuinely new message, skipping the topic's stored last value | |
| Parse JSON Payload | boolean | Decode the payload into fields you can reference downstream |
Returns: received, topic, payload, payload_json, qos, retained, received_at, result, tool_result, success, error
03Publish
MQTT: Publish Message
messagebrokers/mqtt/publish · Action
Publish a message to a topic on an MQTT broker. Choose the delivery guarantee (QoS) and optionally retain the message so the next subscriber receives it immediately.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Topic | string | Required | sensors/kitchen/temperature — wildcards are not allowed when publishing |
| Message | text | The payload to publish — plain text or JSON | |
| Delivery Guarantee (QoS) | string | choices: 0 — At most once (fire and forget), 1 — At least once (acknowledged), 2 — Exactly once | |
| Retain | boolean | Keep this as the topic's last known value, delivered to every new subscriber |
Returns: topic, result, tool_result, success, error
04Request
MQTT: Publish and Await Reply
messagebrokers/mqtt/request_reply · Action
Publish a request to one topic and wait for the answer on a reply topic — ask a device a question and get its response in a single step. Check the Replied output to branch on whether an answer came back.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Request Topic | string | Required | devices/boiler/command — where to send the request |
| Request Message | text | The payload to send — plain text or JSON | |
| Reply Topic | string | Required | devices/boiler/status — where the answer will arrive (wildcards allowed) |
| Delivery Guarantee (QoS) | string | choices: 0 — At most once (fire and forget), 1 — At least once (acknowledged), 2 — Exactly once | |
| Wait For Reply (seconds) | integer | 30 — how long to wait for the answer before giving up (maximum 300) | |
| Parse JSON Reply | boolean | Decode the reply into fields you can reference downstream |
Returns: replied, topic, payload, payload_json, qos, retained, received_at, request_topic, result, tool_result, success, error
05Retained
MQTT: Clear Retained Value
messagebrokers/mqtt/retained_clear · Action
Delete a topic's stored last known value, so new subscribers no longer receive a stale reading. Live messages on the topic are unaffected.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Topic | string | Required | sensors/kitchen/temperature — the topic whose stored value to clear |
Returns: topic, result, tool_result, success, error
MQTT: Get Retained Value
messagebrokers/mqtt/retained_get · Action
Read a topic's last known value — the message the broker has retained. Use it to ask 'what is the current temperature?' without waiting for the next reading. Check the Found output to branch on whether the topic has a stored value.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Topic | string | Required | sensors/kitchen/temperature — the topic whose stored value you want |
| Parse JSON Payload | boolean | Decode the payload into fields you can reference downstream |
Returns: found, topic, payload, payload_json, qos, retained, received_at, result, tool_result, success, error
06Triggers
sensors/# are allowed, and you can raise one topic's delivery guarantee by adding :1 or :2 after it. Leave Queue Messages While Disconnected ticked and the broker holds on to QoS 1 and 2 messages for this flow if the connection drops, replaying them once it is back — untick it and anything published while the trigger was away is simply missed. Tick Parse JSON Payload to have the message decoded into fields you can reference in later nodes. Edit the trigger's settings and Flomation re-dials the broker with the new configuration on its own.MQTT Trigger
trigger/mqtt · Trigger
Start a flow whenever a message arrives on an MQTT topic. Flomation holds a subscription open to your broker and runs the flow the moment a message is published. Wildcards are supported: + matches one level, # matches the rest.
| Field | Type | Details | |
|---|---|---|---|
| WebSocket Path | string | /mqtt | |
| Topics | string | Required | sensors/# — separate several with commas; add :1 or :2 after a topic to raise its delivery guarantee |
| Delivery Guarantee (QoS) | string | Applies to every topic that doesn't set its own — choices: 0 — At most once (fire and forget), 1 — At least once (acknowledged), 2 — Exactly once | |
| Parse JSON Payload | boolean | Decode the payload into fields you can reference downstream | |
| Queue Messages While Disconnected | boolean | Ticked (default): the broker holds QoS 1 and 2 messages for this flow if the connection drops, and delivers them on reconnect |
Returns: content, topic, payload, payload_json, qos, retained, received_at, broker
07Notes & Limitations
Behaviours and constraints worth knowing before you build with these nodes.
- The MQTT trigger holds a durable subscription to the broker, so messages published while Flomation is restarting or briefly offline are queued by the broker and delivered once the connection is re-established, provided the topic is subscribed at QoS 1 or higher.
- MQTT topics broadcast rather than queue, so every subscriber receives its own copy of each message and two flows listening to the same topic will both run for every message published.
- Request/Reply never accepts a retained message, so it only ever sees a reply that arrives after it subscribes, and Wait for Message behaves the same way unless you turn Ignore Retained Value off — so a reading published moments before the node started listening is missed. When you want a topic's current value rather than its next one, use Get Retained Value instead.
- Client ID should be set explicitly on brokers that tie permissions to it — AWS IoT Core expects the thing name and Azure IoT Hub the device ID, and both refuse the connection otherwise. Flomation sends whatever you enter verbatim and never checks its length, so match what your broker expects; where you are free to choose, keep it short, as some older brokers still enforce the original 23-byte limit.
- Secure connections are verified against the CA certificate you provide, so a broker presenting a self-signed certificate, or one whose certificate does not name the address you are connecting to, will be rejected unless insecure connections are explicitly allowed.