Data & Transform Actions
Data actions shape values inside the run: compute and convert with Transform, assemble JSON or XML documents, and add or remove named values in the context.
At a glance
| Action | Use it to |
|---|---|
| Transform | Run one or more operators over a value (math, string, date, array). |
| JSON Create | Build a JSON document from context values. |
| XML Create | Build an XML document from context values. |
| Add to Context | Set named values into the context. |
| Remove from Context | Delete named keys from the context. |
Inputs are value inputs (a constant, a context key, a variable, or an expression); outputs are written to a named context key.
Transform
A Transform action holds an ordered list of transformations. Each transformation takes an Input value, applies an Operator with zero or more Input Arguments, and writes the result to an Output context key. Each transformation also defines a failure reaction and an optional fallback value, so a failed operator can substitute a default instead of stopping the run.
The operators fall into four families:
| Family | Examples |
|---|---|
| Math | Add, Subtract, Multiply, Divide, Round, Abs, Min/Max, Pow, Sqrt. |
| String | Append, Substring, Replace, ToUpper/ToLower, Trim, Split, Join, regex and JSON/XPath extraction. |
| Date/Time | Add days/hours, diff between dates, extract parts, start/end of day/week/month/year. |
| Array | Append, Count, Distinct, Order, Take/Skip, Sum, Average, Contains, Slice. |
The Array operators reshape an array inside an action. To test an array in a condition instead — “sum over 100”, “every item in stock” — use the Aggregate and Quantifier clause modifiers.
JSON Create
Builds a JSON document from a structured definition (the JSON root), pulling in context values where referenced, and writes the serialized document to an Output context key. Use it to assemble a request body or payload before an API action.
XML Create
Builds an XML document from a root element definition and writes it to an Output context key. Use it when an integration target expects XML rather than JSON.
Add to Context
Sets one or more values into the context. Each entry maps a target context key to a value input, so this is how you assign constants, copy a value from one key to another, or capture a variable into a named key for later actions to read. Because a value input can be an expression, an entry can also compute its value on the way in — for example ctx.price * ctx.qty.
Prefer an Add to Context write when the value is a step in a flow that a specific rule produces. Prefer a derived fact when the value is a definition other rules read — defined once and computed on demand.
Remove from Context
Deletes one or more named keys from the context. Use it to clear large intermediate values once they are no longer needed, or to avoid carrying sensitive data further through the run.