Skip to content

MqttTrigger

The MQTT Trigger operation subscribes to a configured full topic and starts an execution path when a matching MQTT message is received. It exposes MQTT metadata outputs including QoS, retained flag, response-topic related fields, content type, and computed message-expiry seconds.

MQTT Trigger operation

Trigger

This operation is a trigger. It starts a new execution path when an MQTT message matching the subscribed topic is received. The > output pulses true during the trigger callback and returns to false afterward.

Inputs

This operation has no inputs.

Outputs

PortTypeDefaultDescription
>AnyfalseUntyped trigger pulse. true during callback, then false.
TimeStamp(ns)IntegerNilArrival timestamp in nanoseconds (system_clock epoch).
TopicStringNilFull received topic.
PayloadBinaryNilRaw message payload.
QoSIntegerNilIncoming QoS level.
MessageExpiry(s)IntegerNilRemaining lifetime in seconds. Computed from expiry metadata or Nil if unavailable.
ResponseTopicStringNilMQTT 5 response topic, if present.
CorrelationDataBinaryNilMQTT 5 correlation data, if present.
UserPropertiesMapNilMQTT 5 user properties.
ContentTypeStringNilMQTT 5 content type.

Properties

NameTypeDefaultDescription
TopicTextLine""Full topic to subscribe to. Must start with <slot>/. Hint: Add full topic as <slot>/…

This Operation can never err: it has no Input to check, and a message that arrives is a message, so its Node carries no On Error policy.

State on Reload

State is preserved across restarts for the following outputs:

  • Topic
  • Payload
  • TimeStamp(ns)

Metadata outputs (QoS, MessageExpiry, ResponseTopic, CorrelationData, UserProperties, ContentType) are not persisted. Saved state is discarded if the configured Topic changed.


  1. Startup — The configured topic is validated (must start with <slot>/) and the operation subscribes to it.

  2. Message receive — When a matching message arrives, the operation sets all output values: TimeStamp(ns), Topic, Payload, QoS, and any MQTT 5 metadata fields.

  3. MessageExpiry computation — If an absolute expiresAtMs exists, the remaining seconds are computed as ceil((expiresAtMs - nowMs) / 1000) floored at 0. Otherwise, messageExpiryInterval is used if present, or the output is Nil.

  4. Trigger pulse — The > output pulses to true for the callback execution, starting the downstream execution path, then returns to false.


When the operation is reset:

  • Topic, Payload, TimeStamp(ns), QoS, ResponseTopic, CorrelationData, UserProperties, ContentType, MessageExpiry(s) are cleared to Nil.
  • Retained is set to false.

  • Topic validation requires the <slot>/... prefix when mqttbroker.requireSlotPrefix is enabled; otherwise any structurally valid topic is accepted. Isolation between slots does not depend on the prefix.
  • Topic matching and ACL behavior are enforced by the MQTT stack/plugin path.

One host setting bounds MQTT Trigger. It is read at start-up from the host’s configuration file; see the MQTT Broker configuration reference.

KeyTypeDefaultEffect
mqttbroker.maxTriggerPerTaskInteger-1How many MQTT Trigger nodes one Task may contain. Negative means unlimited.

The cap travels to the editor in the operation’s schema, so the editor refuses to add a Trigger beyond it rather than letting you build a Task the server will reject.

The broker-wide settings a Trigger runs under — the granted QoS level, whether retained messages are stored, the packet-size ceiling, and the per-device rate limits — are on the same page.