JSON Path
Use this node to extract a portion of the message data using a JSONPath expression and replace the entire message data with the result — for example, pulling just the telemetry sub-object from a deeply nested payload, or filtering an array of sensor readings to only those matching a condition.
Configuration
Section titled “Configuration”- JSONPath — required. The JSONPath expression to apply to the incoming message data. The expression result becomes the new message data. Default value
$selects the entire document (pass-through).
Message processing algorithm
Section titled “Message processing algorithm”- Apply the configured JSONPath expression to the incoming message data.
- If the message data is not valid JSON, route via
Failure. - If the expression matches one or more elements, replace the message data with the query result and route via
Success. - If the expression finds no match (path not found), route via
Failure.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
Success | JSONPath expression evaluated successfully; message data replaced with result. |
Failure | Message data is not valid JSON, path not found, or an unexpected error occurred. |
Examples
Section titled “Examples”Example 1 — Extract a nested object
Section titled “Example 1 — Extract a nested object”Incoming data: { "device": { "name": "Thermostat A1" }, "telemetry": { "temperature": 23.5, "humidity": 55 } }
{ "jsonPath": "$.telemetry" }Outgoing data: { "temperature": 23.5, "humidity": 55 } — the telemetry sub-object becomes the new payload.
Example 2 — Extract an array element
Section titled “Example 2 — Extract an array element”Incoming data: { "device_profiles": [{ "name": "default", "isDefault": true }, { "name": "low_power", "isDefault": false }] }
{ "jsonPath": "$.device_profiles[1].name" }Outgoing data: "low_power" — scalar string becomes the new message data.
Example 3 — Path not found → Failure
Section titled “Example 3 — Path not found → Failure”Incoming data: { "temperature": 25.1 }
{ "jsonPath": "$.humidity" }Result: humidity does not exist — routes via Failure.
Example 4 — Filter array with predicate
Section titled “Example 4 — Filter array with predicate”Incoming data: { "readings": [{ "type": "temperature", "value": 19 }, { "type": "humidity", "value": 78 }, { "type": "temperature", "value": 21 }] }
{ "jsonPath": "$.readings[?(@.type == 'temperature')]" }Outgoing data: [{ "type": "temperature", "value": 19 }, { "type": "temperature", "value": 21 }] — array filtered to temperature readings only.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbJsonPathNodeConfiguration", "type": "object", "required": ["jsonPath"], "additionalProperties": false, "properties": { "jsonPath": { "type": "string", "description": "JSONPath expression to apply to the message data." } }}