Skip to main content

Script

Routes the flow on what a script returns. Reach for it only when the logic cannot be expressed with an Expression condition—a computed comparison, a check across several fields at once. Routes to true when the script returns a truthy value, otherwise to false.

Fields​

FieldDescription
ScriptWhere the script comes from: Inline, Saved, or Runtime—the same three sources as the Script action.
LanguageFor an Inline script, the language it is written in. Choosing JavaScript reveals its Script field, holding the source.
Script (source code)For an Inline script, the source. Checked for syntax errors as you type.

As with the Script action, the source is needed to run, not to save: left empty, the step shows a needs-attention note rather than blocking the save—see Building automations. At run time, an empty script fails the step.

As with the Script action, Esca can write an Inline script in place. Its starters differ here: an empty field offers Continue when set in place of Pull out fields and Suggest tags, and a filled one has no Warn on missing values starter, since a condition has no fields of its own to pass along.

What the script can read​

The same two values as the Script action:

  • payload—the output of the step immediately before this one.
  • input—the values you mapped into the step on its Input tab.

A returned value of null, false, zero, an empty string, or an empty collection routes to false. Anything else routes to true.

What later steps see​

The incoming payload, passed through unchanged on whichever path was chosen. A script condition decides a route; it does not contribute a value of its own.

Limits​

The same sandbox and the same ceilings as the Script action.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.