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

    • 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 ...
    • Custom Function: Computing_Field_Values

      This custom function can be used to add two values and save the return value in a custom field. The sum will be dynamically updated in the custom field after this function is executed. Business Scenario Helen is the head of Procurement Management at ...
    • Custom Function: Create_Ticket_in_Zoho_Desk

      Zoho Desk is customer service software which allows you to address customer concerns. This custom function can be used to post a card as a ticket in Zoho Desk. Prerequisites Sign up for Zoho Desk and create a department. The ticket will be created in ...
    • Custom Function: Move_Job_to_other_Stage

      This custom function can be used to move a card to any stage in the blueprint automatically. Cards can be moved to previous stages or upcoming stages. Business Scenario Mark, the head of Marketing, reviews all the marketing articles in his ...
    • Custom Function: Move_Job_to_other_Blueprint

      This custom function can be used to move a card to any blueprint created using the same board, automatically. Business Scenario In a food processing business, once the food items are packed and ready to be shipped in the Manufacturing Blueprint, the ...

    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.