json-template (Transform Node)
The JSON Template node takes a single JSON input and an object-shaped template. Each string value in the template is treated as a JMESPath expression and evaluated against the input; the results are combined into a new JSON object. Non-string values (numbers, booleans, null, nested objects and arrays) are copied as-is.
Use this node to reshape or extract data from upstream JSON (e.g. from a previous transform or from a dashboard payload) into a structure required by a downstream node or dashboard.
Configuration Schema
| Property | Type | Required | Description |
|---|---|---|---|
inputMode | "all" | "latest" | No | Input selection policy. all enumerates all available parent outputs (can duplicate work if parents emit cumulative snapshots). latest uses only the most recent parent output. Defaults to all. |
template | object | Yes | Object tree whose string leaves are JMESPath expressions. Nested objects and arrays are allowed; only string values are evaluated as expressions. |
strict | boolean | No | If true, the node fails when any JMESPath expression errors. If false, failing expressions yield null and the node continues. Defaults to true. |
How it works
- Input selection (
inputMode):\n - Default (all): the node enumerates all available upstream outputs and selects the first payload in that enumeration.\n -latest: the node uses only the latest upstream output.\n - When to uselatest: when the parent node outputs cumulative snapshots over time (for example, repeated hydrate runs where later outputs contain all earlier events). Usinglatestavoids templating the same records multiple times.\n+ - Note on multi-output parents:
inputMode: "all"enumerates outputs and some runtime paths return a list of payloads for a single parent (one per upstream output). In that case, this node selects the first payload in that list. - The node parses the upstream payload as JSON.
- It walks the
templaterecursively. For every string value it finds, it compiles and runs that string as a JMESPath expression against the input JSON and replaces the string with the result. - For object and array values in the template, it recurses and applies the same rule to their children.
- For numbers, booleans, and null in the template, it copies them unchanged to the output.
To output a literal string in the template, use JMESPath string literal syntax: "'Your literal string'".
Example
Input JSON:
{
"tables": {
"with_timestamps": {
"rows": [
{ "captured_at": "2025-01-01T00:00:00Z", "speed": "10" },
{ "captured_at": "2025-01-01T00:00:01Z", "speed": "12" }
]
}
}
}Template:
{
"template": {
"chartTitle": "'Timeline'",
"points": "tables.with_timestamps.rows[].{Data: speed, DateTime: captured_at}"
},
"strict": true
}Output:
{
"chartTitle": "Timeline",
"points": [
{"Data": "10", "DateTime": "2025-01-01T00:00:00Z"},
{"Data": "12", "DateTime": "2025-01-01T00:00:01Z"}
]
}Example configuration
{
"template": {
"summary": "stats.summary",
"count": "length(items)",
"firstItem": "items[0]"
},
"strict": true
}Integration in a session template
- Place a
json-templatenode after any node that emits JSON (e.g. tabular-query, json-filter, or another transform). - Define the
templateobject so that string leaves are JMESPath expressions over that input. - Set
stricttotrueto fail on expression errors, orfalseto substitutenulland continue. - Connect downstream nodes to consume the rendered JSON.
Related concepts
- Core Utils Runner
- Node Templates
- JSON Flatten Node (to flatten the result to CSV/TSV)