Documentation Index
Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Most MQTT payloads in IoT systems are JSON — from devices, HTTP webhooks, industrial gateways, and partner APIs. In Actions you read fields withGET JSON and write structured output with PUBLISH MODEL. Use raw PAYLOAD AS DOUBLE only when the message is a single value with no structure.
For when to choose scalar topics, JSON ingress, or Models at the architecture level, see Choosing data formats on the data layer page.
For the full GET JSON syntax table and edge cases in the operations reference, see Operations — GET JSON.
When to Use This
Any time an incoming MQTT message is a JSON object. Typical sources:- Sensors and PLCs publishing JSON over MQTT
- REST or webhook Routes that forward JSON bodies to topics
- Cloud or SCADA integrations bridged into the broker
Reading JSON Fields
GET JSON takes a field name (or a dotted path), the source (almost always PAYLOAD), and a target type. It works inside any expression that needs a value:
STRING, DOUBLE, INT, and BOOL. The conversion happens at extraction time, so by the time the value is in your variable it is already typed correctly for comparisons and math.
Nested Paths
For nested objects, use dot notation. For arrays, use bracket notation. Mix them freely:{temp} becomes 23.5, {first_reading} becomes 100, {second_id} becomes "S2".
Handling Missing Fields
If a field is absent,GET JSON returns a type-appropriate default: empty string for STRING, 0 for numeric types, FALSE for BOOL. For optional fields, check explicitly with EMPTY:
End-to-End: Extract JSON and Publish a Model
To publish structured JSON without hand-building strings, define a COLLAPSED Model with typed fields and usePUBLISH MODEL ... TO ... WITH from an Action. The broker assembles the JSON for you.
| Step | What Happens |
|---|---|
| 1 | Action triggers when any sensor publishes JSON to sensors/+/json_data |
| 2 | GET JSON extracts each field with the correct type |
| 3 | PUBLISH MODEL builds a clean JSON object and publishes it to the processed topic |
Next Steps
Designing your data layer
Topic trees, scalar vs JSON payloads, and when to use Models.
Operations — GET JSON
Full syntax reference for GET JSON and related operations.

