Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SOP Fan-In: MQTT

MQTT messages can start SOP runs. The MQTT listener subscribes to the broker, builds a SOP event per message, and dispatches it to the engine. This path is gated by the channel-mqtt build feature.

The transport side (broker URL, credentials, TLS, QoS) is configured on the MQTT channel. This page covers the trigger.

Trigger

MQTT message arrival. Live: delivered by the MQTT listener.

fieldtypedefaultmeaning
conditionstring?nullOptional expression evaluated against the message payload; the run
topic*stringTopic filter. + matches one level, # matches the remaining levels.

Load and verify the SOP:

Define

Author the SOP as described in Syntax, with a mqtt trigger. The trigger fields above are the supported keys; the page walks the full file.

Validate

zeroclaw sop validate

Inspect

zeroclaw sop list
zeroclaw sop show <name>

Matching

Topic patterns support + (single level) and # (multi level) wildcards. The MQTT payload is forwarded into the SOP event payload, available to an optional trigger condition; step context receives the capped, sanitized, framed form. A JSON-path condition such as $.value > 85 requires the publisher to send a JSON body.

Fire it

With a SOP loaded and the MQTT channel subscribed, publish a message to a topic the trigger pattern matches (for example with mosquitto_pub, or any broker client). The listener builds an event from the topic and payload and dispatches it. A run starts for every loaded SOP whose topic pattern matches and whose condition (if any) holds against the payload.

If nothing starts, confirm the topic matches the trigger pattern, the broker subscription is live, and the condition matches the payload. See the fan-in overview troubleshooting table.

Approve and observe

Runs that hit a checkpoint pause as WaitingApproval. Clear or inspect them with the CLI (zeroclaw sop list, zeroclaw sop approve) or out-of-band over the gateway API approval endpoints (GET /admin/sop/pending, POST /admin/sop/approve, POST /admin/sop/deny).

See also