Custom node helps you add custom logic into the workflow. Adding custom code enables you to add or remove qualities from input data. The custom code is executed in a NodeJS v10 sandbox. Following are the types of custom logic:
- Lambda cost predictor
- Lambda cost detector
- Custom logic which allows the user to write custom code.
Following should be noted while writing a custom function:
- A context object is available in the custom function which contains a collection which is the output of the previous node (input to this node) and the selected region in the action or resource node previous to this node.
- You could transform the data in whatever way you want. Please note that the collection object is read only. Any transformations should be on a copy of it. Finally,
- Call exit with (null, result). If there is an error, you could pass the error as the first parameter to the exit function and the second parameter should be null.
Here is an example of the Custome node with a predefined custom logic: