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

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.

Run Code input

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

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.

Run Code output

Action limits

To allow the correct performance of the action, observe the following limits:

Limit Value Description
Maximum allowed depth of recursion 100 This means that recursive scripts will only be allowed to execute 100 levels of depth.
Script execution 600s (10 min) Otherwise, the execution will fail with a timed-out result.
Maximum size allowed for arrays 10M elements
Maximum number of statements 500M This includes variable declarations, conditional blocks, loops, function calls and such.
Maximum memory allocation ~280Gb This means that a script has up to 280Gb of memory to execute.