
MQTT RealtimeTrigger
CertifiedTrigger flow per MQTT message
MQTT RealtimeTrigger
Trigger flow per MQTT message
Subscribes to MQTT topics and starts one execution immediately for each incoming message. Defaults to JSON payloads with QoS 1 and keeps consuming until stopped or disconnected; use Trigger for scheduled batch pulls instead.
type: io.kestra.plugin.mqtt.RealtimeTriggerExamples
Consume a message from MQTT topics in real-time.
id: mqtt_realtime_trigger
namespace: company.team
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ trigger.payload }}"
triggers:
- id: realtime_trigger
type: io.kestra.plugin.mqtt.RealtimeTrigger
server: tcp://localhost:1883
clientId: kestraProducer
qos: 1
topic:
- kestra/sensors/cpu
- kestra/sensors/mem
serdeType: JSONProperties
topic *Requiredobject
Topics to consume
String or list of strings; when multiple topics are provided they are all subscribed.
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
authMethod string
The Authentication Method
clientId string
A client identifier that is unique on the server being connected to
connectionTimeout string
The connection timeout
crt string
CA certificate for TLS connections
httpsHostnameVerificationEnabled booleanstring
Disable ssl verification
mqttVersion string
V5V3V5The MQTT version to use
password string
The password to use for the connection
qos integerstring
1Sets the quality of service for this message
- Quality of Service 0: indicates that a message should be delivered at most once (zero or one times). The message will not be persisted to disk, and will not be acknowledged across the network. This QoS is the fastest, but should only be used for messages which are not valuable - note that if the server cannot process the message (for example, there is an authorization problem). Also known as "fire and forget".
- Quality of Service 1: indicates that a message should be delivered at least once (one or more times). The message can only be delivered safely if it can be persisted, so the application must supply a means of persistence using MqttConnectOptions. If a persistence mechanism is not specified, the message will not be delivered in the event of a client failure. The message will be acknowledged across the network.
- Quality of Service 2: indicates that a message should be delivered once. The message will be persisted to disk, and will be subject to a two-phase acknowledgement across the network. The message can only be delivered safely if it can be persisted, so the application must supply a means of persistence using MqttConnectOptions. If a persistence mechanism is not specified, the message will not be delivered in the event of a client failure. If persistence is not configured, QoS 1 and 2 messages will still be delivered in the event of a network or server problem as the client will hold state in memory. If the MQTT client is shutdown or fails and persistence is not configured then delivery of QoS 1 and 2 messages can not be maintained as client-side state will be lost.
serdeType string
JSONSTRINGJSONBYTESSerializer / Deserializer used for the payload
server string
The address of the server to connect to, specified as a URI
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
username string
The user name to use for the connection
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
correlationData string
The MQTT 5 correlation data, Base64-encoded
Echo it back on the reply so the sender can match it to its request. Null for MQTT 3.1.1 and for a message sent without the property.
id integer
The message identifier
payload object
The message payload
properties array
The MQTT message properties
qos integer
The quality of service level of the message
responseTopic string
The MQTT 5 response topic the sender asked replies to be published to
Null for MQTT 3.1.1 and for a message sent without the property.
retain boolean
Whether the message was retained by the broker
topic string
The topic the message was received on