Skip to content

JSON Transform

Overview

The JSON Transform node applies a jq-style or template expression to reshape, filter, or extract fields from an incoming JSON object. Use it to normalize data between workflow steps, project only the fields a downstream node expects, or construct new objects from existing values. If the expression is invalid or the input does not match the expected shape, execution routes to the error output rather than halting the workflow. No external credentials are required.

Configuration

FieldTypeRequiredDescription
expressionstringYesA jq-style or template expression applied to the input object. Examples: .results[0].score, {id: .battle_id, score: .metrics.score}.
expressionLanguageenumNoSelects the expression dialect. Options: jq (default) or template. Use template for simple string interpolation; use jq for full structural transforms.
outputKeystringNoWhen set, wraps the transform result under this key in the output object instead of replacing the root. Useful when merging results into the existing context.
strictbooleanNoWhen true, routes to the error output if the expression yields null or undefined. Defaults to false, which passes null through the output port.

Inputs

PortTypeDescription
inputobjectThe JSON object to transform. Any valid JSON object from a prior workflow step.

Outputs

PortTypeDescription
outputobjectThe transformed JSON object produced by the expression.
errorobjectEmitted when the expression fails to parse, throws at runtime, or strict mode is enabled and the result is null. Contains message and expression fields.

Example

json
{
  "nodeType": "json_transform",
  "config": {
    "expression": "{battleId: .battle_id, winner: .result.winner, finalScore: .result.scores.total}",
    "expressionLanguage": "jq",
    "outputKey": "summary",
    "strict": true
  }
}