Script Invocation

Script Invocation

To ensure optimal performance at runtime, the JavaScript engine prepares the global execution context when the script is first deployed. This one-time initialization involves scanning the code to identify all variable and function declarations and executing any script code that is not enclosed within a function. While this upfront process may add a slight delay, it prevents the engine from needing to perform these operations during the first trigger, leading to a faster and more efficient script execution from the start.
The
onResults
function executes new arguments at the end of each job iteration. If there are any errors in the script, a standard JavaScript exception is thrown and propagated to Aurora Focus with no outputs set.
For more information, refer to Debugging.
All other forms of result formatting are disabled when JavaScript is enabled.