Transform Step
Use AI to reshape data from earlier steps into new, typed fields. Describe what you want in a plain-language prompt, define the output fields, and map the results into any later step.
The Transform step uses AI to turn data collected earlier in a workflow into new values that later steps can use. You write a prompt that describes the transformation, reference the fields you want to work with using mapping placeholders, and define the output fields the step should produce. For example, you can classify the sentiment of a comment, split a full name into first and last name, or pull a due date and amount out of a free-text request.
The Transform step runs automatically—no one needs to interact with it during a session. It cannot be the first step in a workflow, because it needs data from at least one earlier step.
You can configure a Transform step entirely through the API, but you must activate it in the Streamline workflow builder before it returns transformed values. See Activating the step.
Top-level properties
| name | type | required | constraints | description |
|---|---|---|---|---|
spec | object | yes | See Spec | Describes how the transformation is performed, including the prompt. |
outputFields | array | yes | items: OutputField; at least one | The fields the step produces. Each output field is available for mapping in later steps. |
methodId | string | no | Set by Streamline | Identifies the tested and activated version of this transform. Streamline sets this value when you activate the step in the workflow builder; do not set it yourself. |
Spec
| name | type | required | constraints | description |
|---|---|---|---|---|
mode | string | yes | enum: llm | How the transformation is performed. Use llm to have AI produce the output fields from your prompt. |
prompt | string | yes | max 10,000 characters | Plain-language instructions for the transformation. Reference input data with mapping placeholders, such as {{Intake Form.comments}}. |
Mode
llm— AI reads your prompt, along with the values of any mapped fields, and returns a value for each output field.
Referencing input data
The Transform step does not have a separate list of inputs. Instead, every mapping placeholder you include in the prompt becomes an input. When the session runs, each placeholder is replaced with the value from that earlier step before the AI processes the prompt.
Placeholders use the same syntax as everywhere else in Streamline: the step name and field id, each wrapped in backticks. See Mapping for details.
File fields cannot be used as inputs to a Transform step. Map text, number, boolean, date, or list fields instead.
OutputField
| name | type | required | constraints | description |
|---|---|---|---|---|
id | string | yes | non-empty; unique within the step | Identifier for the output field. Later steps reference this value in mapping placeholders, for example {{Classify Comment.sentiment}}. |
type | string | yes | enum: see Output field types | The type of value the step produces for this field. |
label | string | no | Human-readable name for the field. The AI uses the label to understand what to produce, so choose a clear, descriptive label. Defaults to the id. |
Output field types
string— Text.int— A whole number.float— A number that can include decimals.boolean—trueorfalse.date— A calendar date, without a time.time— A time of day.datetime— A date and time.array— A list of text values.
int and float fields are mapped into later steps as numbers. date, time, and datetime fields are mapped into later steps as dates.
Validation rules
outputFieldsmust contain at least one output field.- Every output field must have a non-empty
idand a supportedtype. spec.modemust bellm.spec.promptmust not be empty and must be 10,000 characters or fewer.- The step cannot be the first step in the workflow.
Activating the step
You can create and configure every part of a Transform step through the API, including the prompt and output fields. Activation is the one exception: it is done manually in the Streamline workflow builder. Open the workflow, select the Transform step, enter sample values for the mapped inputs, and run a test. When the test succeeds, Streamline activates the step and sets its methodId.
Creating or updating the step through the API does not activate it, and methodId is never set automatically.
An inactive Transform step does not cause the session to fail. The step still runs, but each output field returns an empty default value instead of a transformed one. Later steps receive these empty values, so activate the step before you start sessions that depend on it.
Until the step is activated, each output field returns the following default value:
| type | default value |
|---|---|
string | "" |
int, float | 0 |
boolean | false |
array | [] |
date, time, datetime | 1970-01-01T00:00:00.000Z |
Whenever you change the prompt or the output fields through the API, test the step again in the workflow builder so sessions use your latest configuration.
Runtime behavior
- When the session reaches the Transform step, it sends the prompt and the current values of the mapped fields to the AI and waits for the result.
- If the transformation does not complete within 45 seconds, or the AI returns an error, the step fails and the session stops at this step.
- Each output field's value is stored on the session and can be mapped into any later step.
Examples
The smallest valid configuration has one output field and a prompt that references one field from an earlier step. This example classifies the sentiment of a comment collected in a form named Intake Form.
{
"spec": {
"mode": "llm",
"prompt": "Classify the sentiment of the following customer comment as Positive, Neutral, or Negative. Return only the classification.\n\nComment: {{`Intake Form`.`comments`}}"
},
"outputFields": [
{
"id": "sentiment",
"label": "Sentiment",
"type": "string"
}
]
}A Transform step can produce several fields of different types from a single prompt. The example below reads a free-text service request and a requester name from the same form, and extracts structured details from them.
{
"spec": {
"mode": "llm",
"prompt": "Read the service request below and extract the requested details.\n\nRequester: {{`Intake Form`.`requesterName`}}\nRequest: {{`Intake Form`.`requestDetails`}}\n\nReturn the requester's first and last name, the type of request (one of: Repair, Installation, Inspection), the requested completion date, the estimated budget in US dollars, whether the request is marked urgent, and a list of any equipment mentioned."
},
"outputFields": [
{
"id": "firstName",
"label": "Requester first name",
"type": "string"
},
{
"id": "lastName",
"label": "Requester last name",
"type": "string"
},
{
"id": "requestType",
"label": "Request type",
"type": "string"
},
{
"id": "dueDate",
"label": "Requested completion date",
"type": "date"
},
{
"id": "estimatedBudget",
"label": "Estimated budget (USD)",
"type": "float"
},
{
"id": "isUrgent",
"label": "Is urgent",
"type": "boolean"
},
{
"id": "equipment",
"label": "Equipment mentioned",
"type": "array"
}
]
}A few things to note:
- Each placeholder in the prompt, such as
{{Intake Form.requestDetails}}, becomes an input to the transformation. - Descriptive labels like
Estimated budget (USD)help the AI return the right value for each field. - Listing the allowed values in the prompt (for example,
Repair, Installation, Inspection) keeps text outputs consistent.
Using output fields in later steps
Once the step runs, map its output fields into any later step using the Transform step's name and the output field id. Building on the first example, if the Transform step is named Classify Comment, a later Notification step can include the result in its message.
{
"message": "A new comment was submitted with a {{`Classify Comment`.`sentiment`}} sentiment."
}Updated about 8 hours ago
