Transform Data
Transforms the input payload using powerful JSONata expressions.
Evaluates a JSONata expression against the incoming payload; the result replaces the payload.
This is the primary tool for data mapping and structural transformation logic within the workflow. It allows you to reshape, filter, and mathematically compute new values from the input JSON.
Features:
- Full JSONata syntax support.
- Access to the entire workflow context.
- Capability to query and aggregate data.
Use Cases:
- Mapping an API response to an internal model.
- Filtering items from a list (e.g.,
items[price > 50]). - Calculating totals (e.g.,
$sum(items.price)).
How it works
- Resolves the config:
{{ }}blocks insideexprare evaluated first by the Expression Engine; plain JSONata text is left untouched. - Fails when
expris empty. - If
exprresolved to an object or array (a whole-value{{ }}returning data), that value is the result and JSONata is skipped. - Otherwise compiles the string as JSONata 2 and evaluates it with the payload as root:
order.total,$sum(items.price),{ "id": order_id, "lines": $count(items) }. - Returns the result as the new payload through
out.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-shape-order",
"label": "Shape order",
"operator_slug": "data.transform",
"operator_version": "1.0.0",
"config": {
"expr": "{ \"id\": order_id, \"total\": $sum(items.price), \"lines\": $count(items) }"
}
}{
"ok": true,
"data": {
"id": "ord_123",
"total": 42.5,
"lines": 2
},
"port": "out"
}Configuration
-
exprstring Required Accepts expressions -
The JSONata expression to evaluate. The result becomes the output payload.
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
expr - Expression Engine variables are not bound inside JSONata:
$json.totalevaluates to undefined. Use payload paths and JSONata built-ins ($now(),$sum,$map), or embed engine values with{{ }}in mixed text, which inserts their string form:{ "run": "{{ $execution.id }}", "total": $sum(items.price) }. A failing{{ }}in mixed text becomes[ERROR: <message>]inside the expression.
Output ports
out default The expression was evaluated.
{
"id": "ord_123",
"total": 42.5,
"lines": 2
}error expr is empty or JSONata failed.
{
"ok": false,
"errors": [
"Transform Error: Unexpected end of expression"
],
"port": "error"
}In expressions
What a later node can read from this node's output with $("Transform Data").item.json.<path> (write your node's label instead of Transform Data). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Transform Data").item.json.result | — | |
$("Transform Data").item.json.id | — | |
$("Transform Data").item.json.total | — | |
$("Transform Data").item.json.lines | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
Transformation expression is required | error | expr is missing, or its {{ }} resolved to an empty value. |
Transform Error: <JSONata message> | error | JSONata syntax or runtime error, for example Unexpected end of expression. |
Transform Error: path.charAt is not a function | error | A whole-value {{ }} returned a number or boolean, which is neither JSONata text nor data. |
Input contract
-
payloadobject Optional
Output contract
-
resultobject Optional
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "data.transform",
"name": "Transform Data",
"category": "data",
"version": "1.0.0",
"description": "Transforms the input payload using powerful JSONata expressions.\n\n This is the primary tool for data mapping and structural transformation logic within the workflow. It allows you to reshape, filter, and mathematically compute new values from the input JSON.\n\n **Features:**\n - Full JSONata syntax support.\n - Access to the entire workflow context.\n - Capability to query and aggregate data.\n\n **Use Cases:**\n - Mapping an API response to an internal model.\n - Filtering items from a list (e.g., `items[price > 50]`).\n - Calculating totals (e.g., `$sum(items.price)`).",
"capabilities": [
"transform",
"jsonata",
"mapping",
"utils"
],
"config_schema": {
"type": "object",
"required": [
"expr"
],
"properties": {
"expr": {
"type": "string",
"title": "Transformation Expression",
"format": "expression",
"description": "The JSONata expression to evaluate. The result becomes the output payload."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"description": "Any JSON payload.",
"properties": {
"payload": {
"type": "object"
}
}
},
"output_contract_schema": {
"type": "object",
"description": "The result of the JSONata evaluation.",
"properties": {
"result": {
"type": "object"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Output",
"is_default": true,
"description": "Transformation result"
},
{
"port_id": "error",
"label": "Error",
"description": "Expression failed"
}
],
"execution_mode": "sync",
"tags": [
"transform",
"jsonata",
"map"
],
"is_stateful": false,
"publisher": {
"identity": "org_link_loom",
"profile": {
"name": "Link Loom",
"verified": true,
"url": "https://me.veripass.com/link-loom",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"expr"
],
"properties": {
"expr": {
"type": "string",
"title": "Transformation Expression",
"format": "expression",
"description": "The JSONata expression to evaluate. The result becomes the output payload."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"description": "Any JSON payload.",
"properties": {
"payload": {
"type": "object"
}
}
}{
"type": "object",
"description": "The result of the JSONata evaluation.",
"properties": {
"result": {
"type": "object"
}
}
}[
{
"port_id": "out",
"label": "Output",
"is_default": true,
"description": "Transformation result"
},
{
"port_id": "error",
"label": "Error",
"description": "Expression failed"
}
]Execution
- Execution
sync- Stateful
- No
- Retries (
retryOnFail) - No
- Capabilities
transformjsonatamappingutils- Tags
transformjsonatamap
Notes and limits
- If the result is undefined (a path that matches nothing) or falsy, the engine stores the whole envelope
{ ok, port }as the output instead of the result. - The previous payload is replaced; reference earlier data with
{{ $("Node").item.json.field }}in mixed text. - When the envelope has no
data(ordatais falsy), the engine stores the whole envelope as the node output: onerrorthe next node receives{ ok: false, errors: [...], port: "error" }as its payload.
Reviewed against the orchestrator code · 31e874b · 2026-11-26