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 receives the full execution context (trigger data, previous step outputs, database records) as input. Your prompt tells the AI what to do with that input. 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:
From the input API response, extract each article's id, title, and
author name. Return an array of objects with the keys: articleId, title, authorName.
Input (from a previous API Request step):
{
  "data": [
    { "id": 1, "title": "First Post", "author": { "name": "Alice" }, "tags": ["news"] },
    { "id": 2, "title": "Second Post", "author": { "name": "Bob" }, "tags": ["tech"] }
  ]
}
Output (result):
[
  { "articleId": 1, "title": "First Post", "authorName": "Alice" },
  { "articleId": 2, "title": "Second Post", "authorName": "Bob" }
]

Configuration

FieldDescription
PromptNatural language instructions describing the transformation to apply. Use template variables to reference specific data from previous steps.

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

FieldTypeDescription
resultanyThe transformed data as JSON
errorbooleanWhether an error occurred
error_messagestringError description if failed
Downstream steps access the result via {{step.your-step-name.output.result}}. If the result is an array, you can feed it into a Loop step to process each item.