When to use it
When a filter cannot express what you mean, or a message needs a number the event does not carry — a ratio, a running total, a threshold that depends on two fields.
At a glance
| Integration | Code |
|---|---|
| Credits | 2 |
| Connection | None |
Settings
scriptRequired- JavaScript. Reads input.event and input.actions, and returns a value.
Read input, return output
Use input.event for the triggering event and input.actions for earlier outputs on this path. Return a JSON-compatible value, usually an object with named fields.
Write JavaScript directly; do not insert {{ }} templates into the script. The script cannot make network requests or access files and has one second to finish. Keep its returned output below 64 KB.
Each run starts fresh. There is no persistent state for a running total across different events; calculations are limited to the event and earlier outputs supplied to this run.
Example
This creates a concise summary while preserving amounts as text. It does not convert large token values to JavaScript numbers, which could lose precision.
return {
summary: `${input.event.value_decimal} ${input.event.token_symbol} transferred`,
link: input.event.explorer_tx_url
};Use and test the result
A later message can read {{ actions.transform_1.summary }} and {{ actions.transform_1.link }}. The output key is shown in the inspector.
Transform executes during Validate run, so you can inspect its actual result. A script error, excessive runtime, or oversized output fails the action and stops the path unless Continue on error is enabled.
What it hands on
Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.transform_1 }} — the action’s key, then which one it is if you use more than one of the same kind.
(whatever you return)- The value your script returns, read by the steps below as actions.transform_1. Return an object and its keys are reachable with a dotted path.
One second, and no network
Scripts run in a sandbox with no way to reach anything outside the event, and are stopped after a second. What it returns is what the steps below it read.