Run code

The Run code action allows you to execute a JavaScript script. Most of the operations are allowed to perform complex operations and data transformations in a simple way.

Note: Importing libraries, dealing with files, blobs and proxies, using constructor, fetch or eval and doing HTTP requests is not allowed.

The Run code action can also be used for specific cryptography requirements by using tools from the Forge library. For more details, see Run Code action using Forge cryptography library.

Action input

Run Code input

The following table describes the fields in the Run code action input:

Field Description Required
Inputs Provide data by using the Add button to provide as many Id and Value properties as needed. Use the Minus icon button to delete added pairs. No
ID Enter a name for the variable. Yes
Value Enter or select from the Suggestions drop-down a value for the variable. You can use Liquid. Yes
Code Enter the JavaScript script you want to run. Yes

Note: Inputs are declared as global variables and they can be overridden in the code.

Test action

To test the action without triggering the complete flow, follow these steps:

Run Code test action input

Run Code test action output

Action output

Run Code output

The following table describes the properties in the Run code action output:

Property Description
Logs Shows any logged elements in the code.
DurationInMs Shows how many milliseconds the code took to execute.
MemoryConsumedMb Shows the memory consumed.
Result Shows the returned value.

Action limits

See Service limits for details about the limits that apply to the Run code action.