Skip to content

transform

Pure data shaping. No I/O — reshape between nodes via gotemplate / jsonpath / jq.

Sourceinternal/agents/workflow/nodes/transform.go
When to useReshape data between nodes without spending an LLM turn.

Schema

FieldTypeRequiredNotes
enginedropdowngotemplate (default) / jsonpath / jq.
expressiontemplateTransform expression rendered against the run's render context.
inputtemplateOptional input expression. Defaults to the full render context.

Output

FieldTypeWhat
resultstringRendered output.

Example

json
{
  "id": "build",
  "type": "transform",
  "engine": "gotemplate",
  "expression": "{{index .Event.Payload \"text\" | upper}}"
}

Engines

EngineStatusNotes
gotemplateDefault. Same template engine + helpers as every other templated field.
jsonpath⚠️ placeholderMinimal walker. Useful for trivial extractions; not full JSONPath.
jqFull jq via gojq. The expression is a jq program.

For anything beyond a one-line reshape, reach for go_script instead — it gives you real Go with full stdlib.

jq engine

Set engine: jq and put a jq program in expression. The program runs against the JSON parsed from input — or, when input is blank, against the full render context marshalled to JSON.

json
{
  "id": "shape",
  "type": "transform",
  "engine": "jq",
  "input": "{{.Node.fetch.body}}",
  "expression": "{items: [.data[] | {id, name}]}"
}
json
{
  "id": "active_only",
  "type": "transform",
  "engine": "jq",
  "input": "{{.Node.list.body}}",
  "expression": ".[] | select(.status == \"active\") | {id, name}"
}

Output rules:

  • One resultresult holds that value bare.
  • Multiple results (a stream, like the active_only example above) → result is an array of them.
  • No resultresult is null.

A jq compile error, non-JSON input, or a runtime error fails the node — the message names the offending program or input.

Pair with

Built with ❤️ by a developer, for developers.