--- title: "Create and configure a Circuit" url: https://docs.catalyst.zoho.com/en/tutorials/museum-finder/create-and-configure-circuit/ description: "Build a Museum Finder web application using Catalyst Functions that helps you find museums based on ratings and traveller type criteria, and automate its workflow using Catalyst Circuits." last_updated: 2026-08-17T12:16:04Z service: All Services type: tutorial related_links: - name: "Circuits" url: /en/serverless/help/circuits/introduction/ --- # Create and Configure the Circuit The circuit automates the executions of all the functions based on the workflow we design. Therefore, after the user provides the input in the client application, the functions we configured will execute in a specific order and the email will be sent to the user with the results they require. To create a circuit from the console: 1. Navigate to **Circuits** from **Serverless** and click **Create Circuit**. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_create_circuit_1.webp) 2. Enter a name for the circuit and click **Create**. You can enter any name. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_create_circuit_2.webp) The circuit will be created and the _Builder View_ will open. You can learn about Circuits in detail from the [Circuits help page](https://docs.catalyst.zoho.com/en/serverless/help/circuits/introduction). ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_created.webp) Before we configure the circuit, perform the following action: 1. Click on the **arrow** next to the circuit name on the top-left corner to navigate to the _Circuits_ page. Copy the **Circuit ID** displayed in the page. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_id.webp) 2. Now, navigate to **Functions** and click the `circuit` function. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_functions.webp) 3. Click the **Code** tab and open `index.js` by clicking it. Paste the Circuit ID that you copied on line 14 and click **Save**. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_function.webp) #### Configure the Circuit Now let's go back to configuring the circuit. 1. Navigate to **Circuits** and open the circuit that you created. We will first create a [parallel state](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#parallel) to execute the `RatingProcessor` and `TravellerTypeRatingProcessor` functions in parallel. > **Note:** Ensure that you enter all the values for the circuit's states and configurations as described in this section. 2. Drag the **Parallel** state from the left panel onto the builder view and drop it anywhere. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_left_panel.webp) This will open a pop-up box. 3. Enter the parallel state's name as "**Dataset Processing**". Set its previous state to "**Start**" and next state to the default "**State1**". Click **Create**. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_1.webp) 4. Now in the Dataset Processing state's configuration, click **Add Path** and enter path's name as "**rating\_list**". This will automatically assign the path to a new state called _New State 1_. Similarly, add another path and enter its name as "**traveller\_type\_rating\_list**". This will assign the path to _New State 2_. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_2.webp) > **Note:** We will configure the Input/Output of all the states in the end. 5. Now click on **New State 1** in the builder. Enter the state's name as "**Rating Processor**". Assign its type as a [Function state](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#function) and associate it with the `RatingProcessor` function from the drop down-lists. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_3.webp) 6. Similarly, click on **New State 2** in the builder. Enter the state's name as "**Traveller Type Rating Processor**". Assign its type as **Function** and associate it with the `TravellerTypeRatingProcessor` function. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_4.webp) Both these functions will now execute in parallel every time the circuit is triggered. 7. Now click on **State1** in the builder. Enter the state's name as "**Merge Dataset**" and associate it with the `MergeDataSet` function. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_5.webp) 8. Let's add another function state. Drag and drop a function state from the left panel, and provide the following values. Click **Create**. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_6.webp) Associate this state with the `Mailer` function in the configuration. 9. Let's now add a [branch state](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#branch) before the Mailer state to branch the circuit's processing. Drag and drop a branch state and provide the following values. Click **Create**. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_7.webp) > **Note:** We are adding the branch state after the Mailer state has been created to avoid creating a default branch. 10. In the Check Result state's configuration, click **Add Condition** and enter the condition as "**$.result.museum\_list.size() == 0**". This will automatically assign it to a New State 1. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_8.webp) 11. Now click on **New State 1** from the builder and associate it with a [Failure state](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#failure). Name the state as "**Failure**". ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_9.webp) Now if there are no results matching the criteria of the user's input, the circuit will traverse this branch and end in the failure state. Since a failure state is an end state, there will be no next state associated with it. If there are results matching the user's criteria, the circuit will traverse the other branch and execute the `Mailer` function that emails the results to the user. Your final circuit should look like this. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_10.webp) Let's now configure the [input paths, result paths, and parameters](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#input-output-and-result) of some states. * **Dataset Processing:** Click on the **Dataset Processing** state from the builder and click the **Input/Output** tab for it. Enter the value for its result path as "**$.dataset\_results**". This will assign the results obtained from processing the `RatingProcessor` and `TravellerTypeRatingProcessor` functions to the variable dataset\_results. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_10.webp) * **Rating Processor:** Enter the following values for the Input/Output of the **Rating Processor** state. This selects the results obtained by the `RatingProcessor` function's execution and assigns it to the variable `result`. That value is then added to the [input JSON of the circuit](https://docs.catalyst.zoho.com/en/serverless/help/circuits/key-concepts/#input-output-and-result). Add two parameters named "**type**" and "**count**" to pass the `rating` and `count` input values from the user to the function respectively. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_11.webp) * **Traveller Type Rating Processor:** Enter the following values for the Input/Output of the **Traveller Type Rating Processor** state. These are the same as the previous one, except that the parameter "type" is assigned to the `traveller` input value. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_12.webp) * **Merge Dataset:** Enter the following values for the Input/Output of the **Merge Dataset** state. The result previously assigned as `dataset\_results` by the parallel processing, is passed as the input to this function, and the function's output is assigned to the `result` variable again. We will not be passing any parameters here. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_13.webp) * **Mailer:** Enter the following values for the Input/Output of the **Mailer** state. The final list (`result.museum\_list`) obtained from the `MergeDataSet` function is passed as the `content` parameter and the user's email address is passed as `mail\_id`. The museum list is also passed as the circuit's output by adding it as the result path in this state. ![](https://catalyst-docs-development.zohostratus.in/images/tutorials/museum-finder/catalyst_museumfinder_circuit_configure_14.webp) The circuit is now completely configured. Click **Save** to save it. > **Note:** You can also view the JSON code of the circuit to understand it better by clicking the **Code View** tab in the builder page.