Configuring a Circuit in Builder View
With Builder View, you can construct your 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.
Flow Controls
Flow Controls allow you to control the flow of your circuit. For example, the state 'Pass' allows you to pass your input from one state to another, while the state 'Success' stops the execution of your circuit.
The following are the seven states under Flow Control.
Pass: Transfers the input from one state to another
Branch: Decides between branches of execution based on input
Parallel: Performs simultaneous executions
Wait: Inserts a delay for a specific time. The maximum wait time is 30 days.
Batch: Implements multiple group executions. You can have a maximum of 10 jobs per batch.
Success: Terminates an execution returning 'Success'
Failure: Terminates an execution returning 'Failure'
For more details about the states, go to States in Zoho Circuit.
Zoho CRM
While configuring a circuit, you may need details of a record, org, user, or any of the CRM variables as an input to one of the circuit's states. Instead of writing code or using integration tasks to fetch these data, you can use some of the readily available states. You can also associate an existing circuit in your current one or use a function available in your CRM org to perform your business logic in the circuit.
The following are the different states pertaining to the operations in Zoho CRM that you can use in your circuit.
Function
Circuit
Record
Org
User
Org Variable
Function
Use this state to use a function in your CRM org in your circuit. When you include this state in your circuit, Function Name under Configuration displays the list of available functions in your CRM org. You can select one of these functions and use it in one of your states. Only the functions that are REST API-enabled are shown here.
Circuit
You can use the circuits created in other integrated services in a circuit in Zoho CRM.
Record
This state gives you the details of a particular record in a module in CRM. You can choose to pass a portion or all of this state's result as an input to the next state in the circuit. Note that the information displayed will be based on the scope provided to the user.
Org
This state gives you the details of your CRM org that you can use in your circuit.
User
Use this state in your circuit to get the details of the current user in your org and process this information in other states.
Org Variable
This state gives you the details of all CRM Variables in your org.
Constructing a Circuit
To construct a circuit in Builder View, you must
Add a state
Define a state
Add a State
Drag and drop the state from the left pane to the visual workflow.
Enter a unique name for the state.
Select the Previous State and the Next State between which the new state has to be added.
Click Create.
Define a State
Click a state in the visual workflow.
On the right pane, under Configuration, you can optionally edit the state's Name.
The state's Type is displayed based on your selection by default. You can still change it in the drop-down, but the previously saved definitions, if any, will be reset.
In the case of functional states, select the name of the Function or Circuit to be associated with the state and define the error handling options.
Under Input/Output, enter the Input Path, Output Path, and Result Path. To know more about I/O paths, click here.
Click Save in the top-left menu bar.
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
You can configure error handling for each state while building a circuit.
You can handle errors On TimeOut or On Execution Failure.
To handle errors when the function does not execute within the set time, you can choose to retry or have a fallback in place.
Retry allows the function to execute again after a failure. You can set the number of attempts the function can retry execution, the time delay between every retry, and the step delay.
Fallback allows the function to pass the error output to the next state when the function retries still result in an error.
Custom Error
You can also have custom error handling for your circuit. You can handle the exceptions in your function through an error code or an error message besides the Retry and Fallback options.
Click the Add Custom Error option under Error Handling to specify the value of the error code and the error message.