Function in Circuit | Circuit | Qntrl | Online Help | Integrate with other tools during a workflow process

Function

A Function is a serverless, simple programming script that can handle a variety of tasks and integrate with other tools to create robust automated workflows. You can write Functions in Python, Node.js, Java, and Zoho Deluge, and perform seamless execution with Circuit without worrying about server management.

 

Prerequisite

Create a standalone function in Qntrl. Functions must be deployed before integrating them into the Circuit. Click here to learn how to create and deploy a function. 

Example Use Case: One of the main steps during employee onboarding involves identifying and allocating the required assets, as well as installing the operating system (OS) and necessary software on designated computers. In this 'Asset Allocation' process, the Function state can be employed to invoke a custom function, which in turn would retrieve the license key from the vault and apply it during the installation of the OS or software. Refer to the 'Employee Asset Allocation' circuit in the figure below, which has been configured specifically for the task of allocating assets to employees and is nested within the employee onboarding process.        

Builder View

In Builder View, to incorporate a function into a circuit:
  1. Drag and drop the Function state from the left pane into your circuit or click the required Function state in your circuit.

  2. Under Configuration, update the common state field attributes.

  3. Type Function is selected by default. Select the Function Name to be added to the circuit from the drop-down list.

  4. Specify the Error Handling options for the state. Learn more about Error Handling.  

     

  1. Under Input / Output on the right pane, you can optionally fill in the following details:

    • Enter the Input Path, Output Path, Result Path, and Result selector; refer to Input & Output Processing. 
    • You can also send additional parameters along with the JSON input sent to the function. Click Add Parameters and enter the parameter name and parameter value. These inputs will be passed to the function during execution. 

       


     6. Click Save and Execute at the bottom of the page.
  1. Specify the test data as Input JSON for your test run, then click Next.
  2. Name your test run for this execution. Click Run.
  3. Check for the data received from the function.
  4. Modify your function settings if failure or data mismatch is encountered.
  5. Repeat this test until you get the required result using your function.

Code View

In Code View, the JSON to incorporate a function into a circuit is given below:
"Licence Key Activation": {
  "type": "function",
  "next": "End",
  "function_id": "function_licence_activation_21",
"parameters": {
  "software_name": "$.software.name",
  "software_version": "$.software.version"
}
}





Next: Webhook state

    • Related Articles

    • Circuit

      Circuit enables you to create automated workflows for IT and business by organizing a sequence of tasks. In certain cases, a process might include complex sub-processes that can be constructed as separate standalone circuits. These circuits can be ...
    • Create and Configure a CodeX Script

      Prerequisite Prior to creating a codex, it is essential to establish a board since the configured codex scripts can be activated within that Board when specific conditions arise. Add a Script To add a new script, follow the below steps: Navigate to ...
    • Script Modules

      Script Modules offers creating reusable, ready-made templates for your business logic compatible with ES6 modules. When you need that specific logic in another script, you don't have to write or copy-paste the code again. You can easily include the ...
    • Custom Function: Create_Job

      This custom function can be used to create a new card in any board. It can also be configured to carry forward necessary field values from the former card to the latter. Business Scenario Helen is the head of Procurement Management in her ...
    • SSH Engine

      SSH Engine state is configured to connect to a client's machine or network and remotely execute commands or scripts on the client's Linux/UNIX operating system. Prerequisite Bridge must be installed and should be active. Learn how to install and ...

    You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.