When to use Data Transformers
- Format external data (e.g. strip symbols from phone numbers or rewrite salutations) before you reference it inside prompts.
- Enforce guard rails by comparing values or routing between true/false outputs.
- Share the same transformation across multiple agents, pre-call actions, or flow nodes and keep everything in sync.
Open the workspace view
Create or edit a transformer
- Click New Transformer (or use the menu beside an existing item and choose Edit).
- Provide a Name and optional Description so team-members understand what the transformer does.
- Build the Expression Pipeline:
- Each block (e.g.
expr1,expr2) represents one transformation step. - Choose the Transformation type and select the Input source:
Original Inputruns against whatever text you paste into the top Input field.- Any
expr#feed lets you chain from a previous block’s output.
- Fill out the parameters that appear for the selected type (see the table below).
- Add more blocks with Add expression or remove a block with the ✕ icon (except the first one).
- Each block (e.g.
- Click Evaluate to run the full chain against the sample input. The drawer shows intermediate outputs for each block plus the final output so you can verify the logic.
- Press Save. Your transformer is instantly available anywhere variables are inserted.
Supported expression types
| Transformation | Typical use cases | Key parameters |
|---|---|---|
| Find & Replace | Swap keywords, scrub PII, convert newlines to HTML, etc. | searchValue, replaceValue, caseSensitive, optional regex flags. |
| Compare | Turn comparisons into explicit true/false answers (e.g. numeric thresholds, matching strings). | comparisonOperator (==, !=, <, >, <=, >=), rightOperand, caseSensitive. |
| Conditions | Combine two boolean inputs with AND or OR. Ideal for pre-call/action gating. | logicalOperator and a secondary input (expr#) to compare. |
| Ternary Operator | Return a custom message depending on whether the incoming value is truthy/falsy. | trueOutput, falseOutput. |
Tips for complex pipelines
- Use descriptive descriptions so future editors understand why a pipeline exists.
- When chaining expressions, double-check the Input selector;
expr2defaults to the previous block, but you can point it at any earlier result. - Evaluating often helps you catch whitespace or case-sensitivity issues before anyone attaches the transformer to production prompts.
Apply a transformer to variables
Wherever the variable popover appears (Guidelines, Initial Message, flows, etc.), you can apply a transformer in-line:- Type
{{to open the variable popper and select a variable as usual. - Enable Apply data transformation at the bottom of the popper.
- Pick the transformer by name — the popper auto-completes transformer names and shows a preview of the expression chain so you can verify the pipeline before inserting. The inserted snippet renders as
[TransformerName({{variableName}})], and the stored value includes the transformer ID so the backend can execute the pipeline automatically.
Manage safely
- Usage-aware deletion – clicking Delete runs a usage check first. If the transformer is referenced by any agent, action, or flow node you will see a detailed report and deletion is blocked until you remove those references.
- Workspace-wide search – the list view fetches every transformer in the workspace so you can filter locally without pagination round trips.
- Exports & clones – AI Agent exports/imports and duplicates automatically carry along any referenced transformers and rebuild usage links in the target workspace.
Related pages
AI Agents
Inject transformed values into greetings, guidelines, and agent settings.
Pre-Call Actions
Combine transformers with API responses before a call starts.