Input and Output Processing | Online Help | Qntrl | Circuit

Input and Output processing

To design and implement effective workflows in Circuit, you should understand how Circuit processes input and output as the data passes through its States.

 

When an execution is initiated, the input to the Circuit is provided as key value pairs in JSON format and then it is passed to the first state of the Circuit. Each state receives JSON as input and passes the output mostly in JSON format.

 

Input and output data can be filtered, controlled and manipulated using the below fields when the data flows from one state to another.

  • Input Path

  • Output Path

  • Result path

  • Parameters

      

Path 

In Circuit, Path is a string beginning with $ that identifies components within JSON text. Specific parts of a JSON can be accessed by denoting their attributes in Input Path, Output Path, and Result Path.  

 

Let us take the following JSON input:

  1. {
  2. "num": 12345,
  3. "names": ["a", "b", "c"], 
  4. "Users" :  [User1, User2, User3, User4]
  5. "solution":{
  6.    "right": true
  7. }
  8. }

If you apply the following paths you will get the return as given below:

  1. $.num   --> 12345
  2. $.names --> ["a", "b", "c"]
  3. $.Users[0:2] --> [User1, User2]
  4. $.solution.right --> true

Input Path    

Input path allows you to filter and control the actual input passed to the state. You can select a portion of the JSON input and pass it to the state for processing. The received JSON input is filtered using JsonPath notation.

 

Let the following JSON be the state input:

  1. {
  2. "User1":{
  3. "Name" : "Angelina",
  4. "Id" : "357",
  5. "location" : "CA"
  6. },
  7. "User2":{
  8.       "Name" : "Martin",
  9.       "Id" : "543",
  10.       "location" : "CA"
  11.       }
  12. }
The Input Path is applied as given below within the state definition:
  1.   "inputPath": "$.User2",
Then the input JSON passed to the state after applying Input Path will be:

  1. {
  2.   "Name" : "Martin",
  3.   "Id" : "543",
  4.   "location" : "CA"
  5.   }

Parameters  

Parameters allow you to modify the input by inserting a collection of key-value pairs to the input. The values of Parameters can either be static or parts of the JSON input selected as a Path. 

 

For example, you are providing the following JSON input:

  1. {
  2. "EmployeeDetails": {
  3. "employee1": {
  4. "Name": "Sam",
  5. "empID": "127",
  6. "location": "CA",
  7. },
  8. "employee2": {
  9. "Name": "John",
  10. "empID": "721",
  11. "location": "LA",
  12. }
  13. }
  14. }
If you want to select some information from the above input, you can define these parameters as given below:

  1. "Parameters": {
  2. "teamDetails":{
  3. "member1": "$.EmployeeDetails.employee1.Name",
  4. "member2": "$.EmployeeDetails.employee2.Name",
  5. "TeamName": "Product Management"
  6.  }
  7. },

The JSON input that is passed to the state when we give the above parameter is:

  1. {
  2. "teamDetails":{
  3. "member1": "Sam",
  4. "member2": "John",
  5. "TeamName": "Product Management"
  6. }
  7. },  

Result Path     

Result Path allows you to manipulate the output of a state. In result path, you can define the output of a state as the state's input or the state's result or a combination of both. In other words, you can append the state's result to the JSON input provided to the state and modify it. You can then pass this modified JSON as the state's output to the next state for processing.

 

Result Path can be defined to generate an output for the following state types.

  • Pass

  • Parallel

  • Batch

  • Function

  • Webhook

  • Circuit 

By default, if Result Path is not defined, the output of the previous state will be completely passed as the input of the new state.

For example, let the following JSON be the state input for your execution:

  1. {
  2.  "TicketName" : "AddNameFailure",
  3. "TicketId" : "12",
  4.  "Priority" : 2
  5. }
Let the state result received be the following:

  1. "Resolve within 24 hours"

To keep the state input intact and to append the state result to it, set resultPath to $.TimeLimit:

  1. "resultPath" : "$.TimeLimit"

This includes the state result with the actual input:

  1. {
  2. "TicketName" : "AddNameFailure",
  3. "TicketId" : "12",
  4. "Priority" : 2,
  5. "TimeLimit" : "Resolve within 24 hours"
  6. }

Output Path   

Output Path allows you to select a portion of the state's output and pass it to the next state for processing by removing the unwanted objects from JSON output. If Output Path is not specified, then the entire JSON node (determined by the state input, state result and Result Path) will be sent as the state output to the next state.

 

For example, let the below JSON is received as state's output from Result path:

  1. {
  2. "EmployeeInfo": {
  3. "empName":  "Angelina",
  4. "empId": "357",
  5. "DOB": "12Nov1990"
  6. },
  7. "AddedInfo": {
  8. "Gender": "Female",
  9. "location": "CA"
  10. }
  11. }
You can select only the values of EmployeeInfo from the output to pass to the next state by defining in output path as below:

  1. "outputPath" : "$.EmloyeeInfo"

Then the output JSON of the state will be:

  1. {
  2.  "empName":  "Angelina",
  3.  "empId": "357",
  4.  "DOB": "12Nov1990"
  5. },


    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION









                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Sample Use Case - Configuring Input and Output Processing in Circuit console

                                                                                                                Let's explore Input/Output Processing further by building a circuit using the example of an Employee Onboarding process. We initiate the process with the following state input which contains information about the employee details for employee ...
                                                                                                              • Output Path

                                                                                                                Output Path enables you to select a portion of the state's output and transfer it to the next state for processing, eliminating any unecessary objects from the JSON output. If the Output Path isn't specified, the entire JSON node (determined by the ...
                                                                                                              • Input Path

                                                                                                                Input Path enables you to filter and control the actual input passed to the state. By defining an Input Path (either in Builder View or Code View), using JSONPath notation, you can select a portion of the JSON input and use it for processing within ...
                                                                                                              • Overview

                                                                                                                Any system is defined by the data it receives as input, the way it processes that data, and the output it generates. In a Circuit execution, the input to the circuit is provided as JSON key-value pairs. This JSON is passed as input to the initial ...
                                                                                                              • Pass

                                                                                                                The Pass state in the circuit merely forwards the data to the next defined state. It allows you to pass the input data as-is or include supplementary information if needed during the process. To put it differently, with this state, you can insert new ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources