Skip to main content

Overview

The Transformer step takes the output from previous steps and reshapes it using AI. Instead of writing code to parse, map, and restructure data, you write a natural language prompt describing the transformation you want — and the AI produces the result as structured JSON. This is useful when you need to:
  • Extract specific fields from a large API response
  • Rename and restructure data to match a target format
  • Merge or flatten nested objects
  • Filter an array down to matching items
  • Convert between data formats (e.g. CSV-style rows to nested JSON)

How It Works

At runtime, the Transformer step resolves any template variables in your prompt before sending it to the AI. Data from previous steps, trigger payloads, variables, and databases must be explicitly referenced in the prompt using {{...}} syntax — the AI only sees what you include. The AI returns the result as a JSON object in the result output field, which downstream steps can reference. Because the output is always JSON, the Transformer works best when your prompt is specific about the structure you expect back.
Prompt:
Output (result):

Configuration

Writing Good Prompts

  • Be specific about output structure — tell the AI exactly what keys and shape you expect back
  • Reference input paths explicitly — e.g. “from the body.data array” rather than “from the data”
  • Keep it focused — one transformation per step is easier to debug than a complex multi-part prompt

Using Libraries

The prompt editor has built-in library integration. Click Library above the editor to load a saved prompt, or click Save to store the current prompt as a reusable library item. This is useful when the same transformation logic is shared across multiple automations.

Output Schema

The Output Schema builder lets you define the exact structure you expect back from the Transformer, rather than relying solely on the prompt to describe it. When a schema is defined, it is compiled into a strict Zod schema at runtime and passed to the model — constraining its response to the shape you specify. This removes the need to describe the output format in the prompt itself and makes it easier to access nested fields in downstream steps, because all defined paths appear automatically in the template picker.

Adding Fields

In the Output schema section of the Transformer panel, click Add field to add a top-level field to the result object. Each field has:

Supported Field Types

Nested Types

  • Objects — add child fields inside the object field row to define the nested structure.
  • Arrays of objects — set the item type to object, then add child fields to define each item’s shape.
  • Arrays of enums — set the item type to enum and enter the allowed values.
Schema definition:
  • tracks (array, item type: object)
    • title (string)
    • status (enum: active, inactive, pending)
    • plays (number)
The model will return:
Downstream steps can reference {{step.transform.output.result.tracks}} or individual fields like {{step.transform.output.result.tracks[0].title}}.
If no schema is defined, the Transformer falls back to open-ended JSON output — the model returns whatever structure the prompt describes. Defining a schema is optional but recommended when the result feeds into downstream steps that depend on specific field paths.

Output

The Transformer returns only result. If the AI call fails, the step throws and is marked errored in the run logs — there are no error or error_message output fields to branch on.
Downstream steps access the result via {{step.your-step-name.output.result}}. If you defined an Output Schema, all nested field paths (e.g. result.tracks, result.tracks[0].title) appear automatically in the template picker. If the result is an array, you can feed it into a Loop step to process each item.