Skip to main content

Function

Executes a custom Javascript function in the flow context. The function should always return a message object or an array of message objects.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Options

  • Function - Custom JavaScript function to execute.
  • Outputs - Number of expected outputs from the function.
  • Script Timeout - Maximum time in seconds before the script times out.

Local Variables

Defines local variables which can be used in the function.

Example

Return example of a single output Function node.

msg.count = 0;
return msg;

Return example of a multiple output Function node.

if (msg.price > 50) {
return [msg, null];
} else {
return [null, msg];
}