Create Circuit in Qntrl | Qntrl | Circuit | Online Help | Create workflows with drag and drop interface

Create and Configure a Circuit

Create a Circuit

  1. Log in to Qntrl. 

  2. Click Circuit from the left pane, then click New Circuit.

  3. Specify a unique Name and add a Description for the Circuit.

  4. Click Save



A sample circuit with the Pass state and name as 'State1' will be created by default, and displayed as a visual workflow in Builder View. You can click on the default state and configure in the builder view.



Similarly, in Code View, an equivalent JSON will be created by default. In the Editor, we can view either the workflow graph alone or both the graph and code view simultaneously.

A Circuit can be created with minimum one state and a maximum of 50 states.                                                                              

Once a circuit is created, a Circuit ID will be created for the Circuit. This ID is used when you nest a circuit using the Circuit state, or when you associate a Batch state to a circuit. The Circuit ID is used to refer to the circuit when working with the SDKs and APIs.

Configure a Circuit

You can configure the Circuit in two different ways.

  • Builder View

  • Code View

Circuits are built with states using the drag-and-drop functionality in Builder View or with simple JSON construction in Code View. For every change made in Builder View, the equivalent JSON text is updated automatically in Code View, and vice versa. This can be observed by changing one view and then checking out the Circuit in the other.

Configuring a Circuit in Builder View  

In Builder View, you can construct your circuit with readily available states in the left pane. States are the building blocks of a circuit that can perform tasks, make decisions, or simply pass the output from one state to another.

Circuit states are categorized as follows:

  • Flow Controls

  • States

To explore more about the States in the Circuit, check out States of Circuit.

Constructing a circuit in Builder View involves two steps:

  1. Add a State

  2. Define a State


Step 1: Add a State in Builder View

  1. Drag and drop them from the left pane onto the visual workflow. This action prompts a pop-up window to appear.

  2. Enter a unique name for the state.

  3. Select the Previous State and Next State between which the new state needs to be added. When you create the first state, the previous state and next state will be 'Start' and 'End' by default.

  4. Click Create. The state will be displayed in the flow diagram.

      


Step 2 : Define a State

  1. Click a state in the visual workflow.
  2. In the right pane, under Configuration, you have the option to edit the state name in the Name field.
  3. By default, the Type field displays the state type based on the state you have dropped in Builder View. You can either retain the created state type or change it in the dropdown list. If the state type is modified in the dropdown list, the previously-saved state definitions, if any, will be reset according to the state selected.
    • For Flow Controls, select the states from the list and configure the related fields to the state.
    • In the case of Functional states, select the name of the Function, Webhook, or Circuit to be associated with the state, and define the error-handling options.
    • Similarly, for Bridge Controls, select the name of the Bridge to be associated with the state to define the error-handling option
      
  1. Under Input / Output, configure the paths and parameters required for input and output processing. Learn more about I/O paths.

      

  1. Click Save.

 Points to ponder
  • Some state types have additional parameters. For example, the Wait state contains Duration, and the Batch state includes Collection Path and Collection Variable. Similarly, Parallel state requires Add Path and Branch state needs Add Condition.
  • All states except Success and Failure have the Next State. The final state of a circuit is defined by having the next state value as 'End'.
  • Dynamic input parameters can be added for Function using Add Parameter and for Webhook using Add Parameter and Add Header.

Configuring a Circuit in Code View   

In Code View, you can define your state machine in a simple JSON-based, structured language. Once a circuit is created, a sample workflow with the Pass state as 'State 1' is created by default. You can click the icon in the top right to view the auto-generated JSON code of the Circuit.

A state name is a JSON object, and its properties are the key-value pairs of that object. Properties like type and next are commonly used for all states. If a state does not mention the next key, it is the last state in the Circuit. If a state is not referred to as next in any other state, it is the first state of the Circuit.

You must follow the standard JSON syntax while coding a circuit.



     Constructing a circuit in code view involves the following steps:

  1. States are made up of attributes. Enter a state name. Define the attributes for the state as key-value pairs.

  2. Define the below common fields of the state

    1. name: All states must have a unique name to identify them within the Circuit. In the above displayed circuit, 'Create User' is the name of the circuit.

    2. type: The actual functionality of the state is referred to by its type.

    3. next: The name of the next state to run after the completion of the current state. In the above Circuit, 'End' is the next state for Create User.

  1. Define the unique fields of the states. Refer to the States of the Circuit to explore the fields for each state.

    1. Provide error handling options using the onError attribute for state types Function, Webhook, and Circuit.

    2. Provide the Bridge ID and configuration details for Bridge controls.

  1. Specify the inputPath, outputPath, and resultPath for Input and Output processing

  2. Click Save.

In the event of an error in JSON definition, a red cross mark [] will be displayed beside the error line. Upon hovering on the mark, the reason for the error will be displayed.

Points to Ponder
  • Every Circuit must have one state with the field value start: true to represent the beginning state.
  • All States except Success and Failure must have a next state. The terminal state must have the next state value as End.
  • You can define the states in any sequence. The order of execution solely depends on the start and next fields.
  • All fields and their values are case-sensitive. Once you define a value, you must provide the exact value throughout the Circuit.
  • All the standard attribute names of the state (name keys represented in black in Code View) like type, next, duration, functionName, and collectionPath are expected in camel case.







displayed.

    • 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 ...
    • 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 ...
    • Step 1: Create Form

      Forms are used to capture requests from users that help you collect the data required to kickstart workflows and perform tasks in Qntrl. There are different departments in an organization providing different solutions. For instance, the finance team ...
    • 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 ...
    • Features of Circuit

      Configure with or without code Circuit provides a platform to build workflow orchestrations with or without code. You can either visually design the Circuit schematics by dragging and dropping its elements in Builder View, or build its JSON code in ...

    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.