A Custom Code node is used to solve any data-related issues that required coding in the workflows. If the same code was needed at multiple places, the users need to use a Custom code node with the same code in different workflows.

If you want to learn more about Custom Code Node, refer here.

To reduct this repetitive process, the solution is the Functions node. Using this, you can create reusable functions at the global level for your Cobalt account, which can then be used inside workflows.

Create your Functions

You can create your own functions to be used in the node by providing three things:

  • Code for the function
  • Input fields
  • Output fields.

To create your own function, follow these steps:

1

Navigate

In the Cobalt dashboard, navigate to Functions under Advanced in the side menu.

2

Create function

Click on + Create Function button and provide its Name.

3

Write function

Write your function and also define the input and output parameters that you require. Once done, click on Create.

Once a function is created, you can also edit it as required by selecting that function from Functions.

Pre-defined Library functions

You can also use some pre-defined functions, also known as Library functions offered by Cobalt. These functions show up in the Functions node by default and can’t be edited.

Few of the library functions are:

  • Find element in array,
  • Encrypt string,
  • Get current date; & many more.

Once you select a function, simply provide the required inputs to perform it.