Module imports can be performed using CommonJS require('module') syntax only. The list of currently allowed modules can be found below:
Use the return keyword to set the output value. You can return either Single Values or List Values, not both at same time.
Timeout: → Integer representing execution time limit(when timeout limit is reached, the action will throw an error) Single result: → Output that will be set for single value outputs. List result: → Output that will be set for list value outputs. Error: → String representing errors resulted from the execution of the script (the output is set only when an error occurs, otherwise it’s null)
Something to consider before trying to use the Node action to automate your use cases is that it does not support working with files.
- Create a process and name it.
- Drag the Node action to the canvas and link it to the other actions.
3. Create the variables needed for the configuration of the action, and then add them to the configuration panel.
5. Configure the output variables which will store the results.
6. Save, Validate and run.
7. Click Checked Instance to view the results. You will see that the outcome of the interpreted code is saved in the result variable. The script ran without errors so the value of the errorMessage variable is null.
Obs: If you set the Timeout to 5 seconds, the action will throw an error at runtime.
2. Scripts with Single outputs.
Json / DataModel
Obs: These should only set the Single output. Should work for all types.
3. Scripts with List outputs.
Obs: These should only set the List output. Should work for all types, just like single values. 4. Basic module usage
If the module does not support CommonJS require, we can’t use it
5. Syntax errors
Obs: Syntax errors will only set the Error field. 6. Throw behavior
Obs: Exception messages thrown using throw “message“ syntax will show up on the Error field. Only Error will be set after execution. 7. Async / Await