Circuits

Circuits is a platform that allows you to build nested tasks, create workflows with low or no code, and automate them. Workflows created in Circuits are state machines that can trigger and track each step automatically, and retry when there are errors.

ServiceDesk Plus Cloud executes circuits as custom actions in automation rules such as Request Triggers, Change Triggers, Service Request Workflows, Incident Workflows and Change Workflows when certain conditions are met.

Roles Required: SDAdmins

Quick Links

Benefits of using Circuits in ServiceDesk Plus Cloud

States of Circuit

Create a Circuit

Configure a Circuit

Test and Execute a Circuit

Execution Logs

Benefits of using Circuits in ServiceDesk Plus Cloud 

States of Circuit

States are building blocks of a circuit that can perform tasks, make decisions, or simply pass the output from one state to another. You can build circuits with states using the drag and drop functionality in Builder View, or with simple JSON construction in Code View.

Circuit states are categorized as follows:

More information on States in the circuit is available here.

Create a Circuit

  1. Go to Setup > Zoho Circuit > Circuits.

  2. Click New Circuit.

  3. Provide a name and short description.

  4. Click Save.

 

 

A circuit will be created and you will be directed to the circuit builder page. A sample circuit with 'Pass' state and Name as 'State1' will be created by default, and displayed as a visual workflow in Builder View. Similarly, in Code View an equivalent JSON will be created by default.

Configure a Circuit 

You can configure Circuit in two ways:

Builder View

In Builder View, you can construct the circuit as a visual workflow by dragging and dropping readily available states from the left pane. States are building blocks of a circuit that can perform tasks, make decisions, or simply pass the output from one state to another.
The left pane contains all the states that you can add to a circuit and is divided into Flow Controls and Zoho CRM.

Define a Circuit

To define a circuit in Builder View, you must

  1. Add a state

  2. Define a state

Add a State

 

 

Define a State

 

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 Paths' and 'Branch state' needs 'Add Condition'. To know more, explore Flow Controls.
All states except 'Success' and 'Failure' have 'Next State'. The value 'End' for 'Next State' indicates that it is the final state of the circuit.
You can add dynamic input parameters for 'Functions' using "Add Parameter".

 

Error Handling

The error handling feature is supported only for functional states. Runtime errors are classified into the following four scenarios:

To handle errors when the function does not execute within the set time, you can choose to retry or have a fallback in place.

 

 

More information on error handling is available here.

Code View 

In code view, you can directly code a circuit in the JSON format.
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 as next in any other states, it is the first state of the circuit.

Follow the standard JSON syntax while coding a circuit.

Define a Circuit

Follow the steps given below to define a circuit in code view:

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

  2. Define the common fields of the state: Name, type, and next.

    1. name: All the states must have a unique name to identify them within the circuit.

    2. type: The actual functionality of the state is referred by its type. The supported types are pass, branch, parallel, wait, batch, success, failure, function, webhook, and circuit. Visit here for more details on States.

    3. next: The name of the next state to run after the completion of the current state. In the above example, 'Send Email' is the next state of "Get Lead Info", while the next state of "Send Email" is End.

  3. Define the unique fields of the states. Refer to Flow Controls to explore the fields for each state.

  4. Provide error handling options using the onError attribute for state types Functions, Webhooks, and Circuits.

  5. Specify the inputPath, outputPath, and resultPath for input and output processing.

  6. Click Save.

 

Bridge Controls 

Bridge Controls allow you to perform certain operations in an application or a database or a computer in a private network. Some of the tasks in these controls require Bridge agent to be deployed and active in the end user's network. Following are the advanced controls:

States share many common features:     
Each state must have a Type field indicating what type of state it is.  
Each state (except Success or Failure state) requires a Next field or, alternatively, can become a terminal state by specifying an End field.

Test and Execute a Circuit

After configuring a circuit,

  1. Click Save or Save and Execute.

  2. When you click Save and Execute, a pop-up will appear with predefined input. You can either select a value from the existing request or provide the JSON input for the circuit as key-value pairs and click Next.

 

    

 

  1. Set or modify the values passed to test the circuit.

 

    

 

  1. Click Test Run. You can view the execution in progress.

 

 

  1. In the event of failure or data mismatch, you can repeat the execution by clicking Run Again.

Each circuit can have multiple simultaneous executions.

Execution Logs

Execution Logs record all the executions in Circuits. You can view the execution logs specific to Request or Change. From execution logs, you can select and re-run a specific execution anytime.

To view all the executions,

  1. Click Execution Logs on the top of the circuit's page. This opens a list of all the executions of the circuit, along with the Circuit Name, Request ID, Invoked Time, Status, and other details.

 

   

 

  1. Under Circuit Name, click a name to view its complete execution details. The executions page consists of the following tabs:

View Graph

You can view the live execution of the circuit.

  1. Once the circuit has been executed, you can visually observe the Execution Details such as the input, output, and the duration of the execution, from the right panel.

  2. If the execution takes more than the expected time or seems to run in a loop, you can click Stop Execution to terminate it anytime.

  3. You can view the paths that were traversed in the circuit, the status of each state represented by a color code mentioned at the top, and the overall status of the circuit execution as well.

 

 

When you click a particular state, a pop-up box displays the detailed information of that state's execution.

 

 

View Code

View Code allows you to navigate to the Circuit's Code View from the execution page. This helps to instantly modify the Circuit's code after you observe the execution.

 

 

View Logs

The logs provide details of the task execution in each state. The detailed log enables you to assess failures effectively and detect bugs in each state's execution in a circuit.

 

 

The following details are displayed in the logs:

Timeline: The date and time of a particular event in a state, along with icons to indicate the event type.

State: The name of the state in which a particular event is executed.

Event: Refers to event that occurred in the state like State Entered, State Exited, Input Processing, Result Processing, State Machine Triggered, State Machine Executed, etc.

Payload: Refers to the JSON input that was passed to that state of the circuit.

Parameter: Refers to the additional parameters that are provided by the user to the states' input function and batch states.

Response: Refers to the response or the output generated by the state after its execution.

Exception: Tracks down the errors or any exceptions that occurred while executing that state with error traces.

Supported Data Centers

Zoho Circuits is now supported in the following data centers: