Function Node

It is often required to transform variables/form fields, as per the requirement of the flow.

For example, the saved date field is in the format: DD-MM-YYYY but requirement is to transform it in MMM-DD-YY format, as expected in the integration with Successfactors.

To implement such a use case, we can use Function node to make such data transformations.

How to implement/configure a function node

  1. Drag and drop the function node on the workflow designer canvas.
  2. While configuring a function node, you can see the following options to create a javascript function:
    1. Manually:
      1. You can write the complete function manually.

      2. Any javascript function should be wrapped up in execute() function only.

      3. After writing the function, you can pass arguments separately, under a separate section.

    2. Create via GPT:
      1. You can leverage GPT to create functions.

      2. An additional input field opens to capture the prompt.

      3. Basis the prompt shared, a valid javascript function is created, along with required expected arguments that you need to pass.

    3. Pre-defined functions:
      1. You can select pre-defined functions from the drop-down list.

      2. Functions such as converting JSON to XML, Calculating length etc, can be leveraged.

      3. Once a pre-defined function is selected, the list of expected arguments is rendered.

Adding arguments

  1. After a function has been created, the next step is to add arguments.

  2. You can choose to add a static value as an input or render Data Center by adding double curly braces and then selecting a key from the Data Center.

Testing Function

  1. You can add static arguments to test the function.

  2. After adding static arguments, you can click on 'Test' to render the output.

  3. The output schema keys can be saved to Data Center, if its as per the expectations. Save to Data Center, allows you to either overwrite the existing saved keys (against the function node), or add new keys (different from the last saved ones), to the collection of saved keys against the created function node.