Transformer
Transformer is the most versatile data-shaping node. You write a template, the expression engine resolves it against the run’s context, and the node emits the result. Use it to compose a new document from multiple sources (upstream output, the flow’s start payload, key-value entries, secrets) in a single step. You find it on the node picker’s Transform & data shelf.


| Field | Type | Default | Description |
|---|---|---|---|
Template (template) | string ✦ (required) | — | A JSON template with embedded expressions that builds this node’s output from upstream data. |
Fields marked ✦ accept expressions.
Try this node — run it once against your own workspace, with your credentials, without building a flow first.
The @json directive
Section titled “The @json directive”The preferred way to write a Transformer template is an @json block. The
block contains valid JSON; quoted "$.path" strings are resolved as JSONPath
queries, and each value keeps its native JSON type (string, number, boolean,
array, object, null).
Scoped to $prev, every path resolves against the upstream node’s output:
@json($prev){ "invoiceId": "$.orderId", "customerEmail": "$.customer.email", "subtotal": "$.total", "firstTag": "$.tags[0]", "taxable": "$.flags.taxable", "customer": "$.customer"}@endjsonWithout an argument, @json exposes every bound variable by its top-level
name, so one document can combine sources:
@json{ "orderId": "$.prev.orderId", "region": "$.start.region", "lastCursor": "$.kv.lastSyncCursor"}@endjsonThe body of an @json block is strict JSON: echo tags and directives inside
it fail to compile. To include a computed value, skip the block and write the
document as raw text instead (next section). See
How-to: Use expressions for the full @json
reference, including spread ("...$.path") and per-item mappers.
Raw templates with echo tags
Section titled “Raw templates with echo tags”When the output is not JSON (a URL, a free-text message), or a value must be computed inline, write the template as raw text with echo tags:
https://api.example.com/v1/orders/{{ $prev->id }}?since={{ $kv->lastSyncCursor }}When raw text builds JSON, emit values with {!! json_encode(...) !!} so
quotes are not HTML-escaped on the way through:
{ "userId": {!! json_encode($prev->id) !!}, "insertedAt": {!! json_encode(now()->toIso8601String()) !!}}Loops and conditions work in raw templates too. The Transformer — @foreach + @if template in the gallery filters and reshapes an item list:
@php $active = array_values(array_filter($prev->items, fn($i) => $i->qty > 0)); @endphp{ "orderId": "{{ $prev->orderId }}", "lineCount": {{ count($active) }}, "lines": [@foreach($active as $item){"sku":"{{ $item->sku }}","subtotal":{{ $item->qty * $item->price }}}@if(! $loop->last),@endif@endforeach]}Output
Section titled “Output”The node emits the resolved template as its output. An @json block produces
the assembled JSON document; a raw template produces the text exactly as it
resolved.
Limitations
Section titled “Limitations”- The resolved template becomes the output verbatim. Nothing checks that a
document you meant as JSON parses as JSON, and one that does not reaches the
next node as plain text, where
$prev->fieldresolves to null. - The body of an
@jsonblock is strict JSON. To compute a value inline, write the document as a raw template instead.
Related
Section titled “Related”- How-to: Use expressions is the full syntax reference.
- Injector emits static JSON with no resolution.
- Mapper handles plain key renames.
- Text Expression emits a single computed value.