Kaizen #126 - Circuits in Zoho CRM - Part 1

Kaizen #126 - Circuits in Zoho CRM - Part 1

Hello everyone!
Welcome back to another week of Kaizen!
Today, we will discuss an exciting topic—Circuits in Zoho CRM.

For starters, we will discuss what Circuits are, how beneficial they are for businesses, different views of a Circuit, and the different states and flow controls.

In the next post, we will discuss associating a Circuit to a blueprint, workflow, and a button, testing and execution, and see a Circuit in action with an interesting use case.

What are Circuits in Zoho CRM?

We use different microservices to accomplish our business needs, but most of the time, we are forced to switch over to multiple places.

With Circuits in Zoho CRM, you can integrate multiple microservices in a single platform and create automated workflows, all within your CRM!

For example, consider that you have an e-commerce application that involves multiple processes like tracking inventory, payment processing, fulfilling and tracking orders, generating receipts and reports, etc.
Typically, you would code this entire logic and use it to fulfill your business needs. But, with Functions in Zoho CRM, you can write the logic for each of these individual processes and simply orchestrate them using Circuits.

So, for the above example, you can simply create an automated workflow using Circuits and use the functions in the right order. That's not just it! You can re-use these functions elsewhere, too.

Another simple example of a Circuit is when you want to automating sending SMS alerts to users when an event occurs. How this is different from a workflow is that in this circuit, you can have a function that triggers an SMS alert, and also a function that sends an email to the user when the SMS alert ails. This involves circuit's functional states and a decision making state.
Like this, the use cases of circuits are endless.

Advantages of Circuits

  • Automate your routines
    Convert all your manual routines to automated workflows to save time. Avoid the need to trigger or interrupt applications to control the system flow, as you can create smooth-sailing, smart workflows that control themselves.
  • Scale fast
    Handle any number of requests hassle free as your workflows get executed on cloud. While Zoho Circuit dynamically allocates resources on need, you can focus more on building your applications rather than managing them.
  • Update in minutes
    Building the business logic of your applications in workflows empowers you to update the applications quickly. Swap or reorganize the components easily and build the modified applications in minutes.
  • Low-code
    Create a circuit effortlessly with the visual drag-and-drop interface, which makes it easier for the users with minimum coding knowledge.
  • Developer-friendly
    Circuits help you manage parallel processes, service integrations, spot failures, retry, and view logs, within minutes. Developers can focus on the business logic and not worry about these factors.
  • Orchestrate CRM Functions
    Use various CRM functions on your circuit to integrate multiple third-party apps and Zoho CRM seamlessly. Write functions once, and orchestrate them in circuits to solve different business needs.
  • Automate IT and business processes within CRM
    Create a circuit, associate it with a workflow, blueprint, or button, and automate your entire business process. With high availability, scalability, and fault tolerance, circuits ensure the performance of your workflow remains consistent even with changing states and an increase in frequency.
  • Diagnose errors and view audit logs
    A detailed log of each execution provides the status of each state's task execution, the payload and parameters passed, and the responses and exceptions generated.
  • Use Existing Functions
    From picking functions you've already tried, tested, and are up and running in your CRM account, to using a circuit within another circuit, this flexibility opens up possibilities of handling so much of your out-of-the-box requirements in a single space.

How are Circuits different from Workflow Rules and Blueprints?

Circuits is simply an orchestration of functions with powerful state management capabilities, along with in-built flow controls to automate the business process.

Workflow rules help us automate repetitive tasks and standardize business processes within the CRM system.
Workflow rules are useful in simple automations that the sales person does on a regular basis, like sending an email after record creation.

Builder View and Code View of a Circuit

Builder View


This view offers an easy drag-and-drop interface to build your circuit. The left pane in this view comprises all the states that can be added to a circuit.
The right pane comprises Configuration and Input/Output.

The Configuration tab lets you give a name to the state, choose its type, and select its next state.



The Input/Output tab allows you to control how JSON data must flow from one state to another through Paths.
Paths are strings beginning with $ that identify the components within the JSON. Specific parts of a JSON can be accessed by denoting their attributes in Input Path, Result Path, and Output Path.


This tab contains the following.

1. Input Path
Input path selects parts of the input JSON to pass to the state. You can also pass parameters to the input as a collection of key-value pairs. The values of Parameters can either be static or parts of the input JSON selected as a Path. For example, if your state's input is
{
"Entry1": {...},
"Entry2": {...}
}
then, you can apply the input path as $.Entry2 within the state definition. So, only the data inside the "Entry2" object will be passed as input to the state.

2. Result Path
After the input is processed by the state, Result Path selects what combination of the state result and the actual state input has to be passed to the output.

3. Output Path
Output Path further filters the data from the Result Path to pass it as state output.

Code View of a Circuit


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.

States of a Circuit and Flow Controls

Circuits offer a cascading structure to different states in a business process, allowing you to write functions that each feed their output into the next one, or any other one you pre-define, individually. You can also reroute, pause for a certain period, or feed it in batches to enable just about any sort of action.
Simply put, Circuits have different 'functional states' and 'flow controls' that allow you to automate execute your business process.

Flow Controls

Flow Controls let you control the flow of your circuit. To achieve this, Circuits make use of different states that allow you to make the execution, 'Wait' for another state, 'Pass' the input of a state to another, use 'Success' and 'Failure' to stop the execution of the Circuit.



The different states available are:
  • 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 on states, refer to this article.

Zoho CRM

Zoho CRM states help you execute business logic in circuits with respect to the data available in CRM.



You can write functions in the built-in editor or orchestrate existing ones, get the details of a record as an input to other the states, get the details of your org, user, CRM variables and use them in your Circuit.
You can also trigger another Circuit within a Circuit using the 'Circuit' flow control.

'Function' State
Use this state in your Circuit to use an existing function in CRM. Depending on your need, you can configure the input and output, and control data flow in your circuit. Only the functions that are REST API-enabled are shown here.



'Circuit' State
You can use another Circuit in one of the states and configure the flow accordingly.



'Record' State
This state fetches 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.
Depending on where the Circuit is associated(Blueprint, Workflow, Button - Create/Clone/Details/Edit View pages, individual record, mass action), the response of the Record State differs.

'Org' State
This state gives you the details of your CRM org that you can use in your circuit.

'User' State
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.

Error Handling

When you use any of the Zoho CRM states, you can also perform error handling as these functional states tend to have runtime errors.

On TimeOut

When a functional state runs longer than the expected time, timeout errors occur. For handling timeout errors in code view, the field value "errorType": "Error.TimeOut" will be added.

On Execution Failure

When a state's execution fails due to some exception that cannot be processed, it can be handled using execution failure. In code view, key-value "errorType": "Error.ExecutionFailure" is appended.

Custom Error

You can also have custom error handling for your states.
Configure Exception Type and Exception Value to set the error handling options based on the error code or error message delivered by the state's output.
Retry the function in case of failure or timeout, set the Attempt (number of retries) and Delay (wait time after failure for every retry attempt).
In case of failure, if the retries fail to fix the error, the State will Fallback the error output to the Next state in the Result field.

We hope you found this post useful. Stay tuned for part 2!
Let us know if you have any questions or suggestions.


Cheers!
Shylaja S




      • Sticky Posts

      • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

        We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
      • Kaizen #261 : Using Zoho CRM Skill to generate complex COQL queries

        Hello everyone, In the previous Kaizen posts, we introduced the zoho-crm SKILL.md and discussed how it can help you when you are working with Zoho CRM APIs and Client Script. In this Kaizen, we will focus on using the Zoho CRM `SKILL.md` with GitHub Copilot
      • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

        Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
      • Kaizen #198: Using Client Script for Custom Validation in Blueprint

        Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
      • Kaizen #226: Using ZRC in Client Script

        Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this

        • Recent Topics

        • Enhanced audit trail in Zoho Creator

          Hello everyone, We're pleased to announce that the Audit Trail feature has been significantly enhanced by expanding its scope to give you a more complete picture of activity across your applications. What was once a simple record-and-report log is now
        • Allocating inventory to specific SO's

          Is there a way that allocate inventory to a specific sales order? For example, let's say we have 90 items in stock. Customer 1 orders 100 items. This allocates all 90 items to their order, and they have a back order for the remaining 10 items which could
        • Zoho Sheet as KB Document

          It would be nice if Zia Agents could take Zoho Sheets as part of the knowledge base. The use case here is that it's infinitely easier for humans to maintain a spreadsheet table than any .md / TAML / JSON document. For situations where humans are responsible
        • Introducing native agents: Configure your CRM with natural language

          Hello all, Configuring your CRM just got a lot faster. We're introducing native agents into Zoho CRM that configure your settings using natural language. Instead of navigating multiple screens, describe what you need and the agent builds it for you. What's
        • Transferring CRM Templates

          I have two different scenarios for transferring the CRM template and would like to know if it is possible to do for either.   1.  When designing my CRM template, I created all the fields in the Leads module.  I have not duplicated all of the fields (or their positions on the page) in other modules like the Contacts, Potentials, Accounts, etc.  Once I get my Leads template designed the way I want, I would like to copy the fields and their page positions to the other modules.  Is it possible to do
        • Is it possible to clone my Lead module layout to Customer and Potential layouts?

          I've customized all fields and their order for Leads module and I would like to know if I'm able to clone those fields into another modules, only to avoid repeated work. Awaiting.
        • URGENT: Stalled DC Migration >72 Hours - Records Locked [Ticket #: 167813877

          The DC migration was started on 1st October at 6 pm and we were informed migration period as 48 hours but even after more than 72 hours, the migration seems still in progress. We sent two emails to check the status but no responses. We need the migration
        • Error AS101 when adding new email alias

          Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
        • Account not Active For any support or queries, kindly contact support@zohomail.com

          HI! I am trying to sign up to Zoho Mail which is not working. All I can see is the following error message, " Please help me. Account not Active For any support or queries, kindly contact support@zohomail.com"
        • How can I add a Custom Field (or Customer_name) to a picklist?

          Our workflow is Shopify-->SO -->Picklist-->Package-->Shipment. We would like to have the Picklist template to include a custom field "Customer_Notes" (we have created this field already). This way we get alerted when a customer has notes on their account.
        • Introducing Zoho Commerce 2.0 — It's more than just selling!

          Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
        • Zoho Thrive connection to off-line purchases

          Is it possible for Zoho thrive to connect to subscriptions or Books and pull purchase data from clients who purchase off-line or maybe through a different sales department where items are not listed on a website for sale? Say I have a customer that signed
        • Kiosk / CRM Timezone Oddity

          I grant you this is much easier to see than to explain, and snapshots here won't help much and I don't want to snapshot my record anyway in a forum, so bear with me... Effectively... As there had been discussions on times coming through in different timezones
        • Payroll Options

          Would like to see a payroll service implemented; Maybe not a true payroll but at least the ability of tracking payments to employees without making them a vendor. please help. Thanks. I didn't find the right solution from the internet. References: https://zohofinance.uservoice.com/forums/283818-zoho-books
        • Esta dirección de correo electrónico ya se encuentra en uso en otra organización... agregar usuarios

          Buenos dias , tengo este problema a la hora de agregar usuarios mi dominio es implementos.com.pe
        • How to setup noreply@ example.com

          How do I setup noreply@example.com so the mail never gets delivered. I currently have a catchall setup aswell.
        • How do you associate multiple contacts to a deal in the mobile app?

          When opening a deal in the mobile app, only one customer shows as the contact. How can we add multiple contacts on our mobile device?
        • Zoho Books Support

          Dear Team, Zoho Books offers a demo before you purchase zoho books. But after that when he actually purchases the product he has to rely on toll free number or help documents. But this might get frustrated in the initial period. Specially in initial period.
        • Linking Multi-UOM Barcodes to Products in Zoho Books

          Greetings, I'm using Zoho Books for retail shop and I'm running into a bit of a challenge with products that have multiple Units of Measurement (UOMs) and corresponding barcodes. For example, I sell cigarettes both as individual packets and in cartons
        • Best practices for importing phone numbers

          I've recently found a problem with my phone provider, integrated with Zoho CRM, where a phone number that starts with 00 instead of + won't work. The problem has no solution: they tell me to replace all 00 with + I've always preferred using 00 instead
        • Has anybody managed to do ANYTHING with Zoho CRM Zia Agents?

          I have 'hired' a few agents from the 'store', and also built the super simplest Agent I could think of (retrieve the email address for a given Contact), and none of them work. I get errors like "LLM Inference failed" even from the store Agents (e.g. "Search
        • custom function

          I want to send a request following the webhook pattern with Endpoint Type Intranet, I received a Zoho access response from Daniel. Please advise on how to implement invokeUrl with Endpoint Type Intranet and a probe
        • ERROR CODE :554 - Your access to this mail system has been rejected due to poor reputation of a domain used in message transfer

          This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. *****, ERROR CODE :554 - Your access to this mail system has been rejected due
        • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

          We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
        • Function #46: Auto generate list of lapsed customers using Custom Button

          Hello everyone, and welcome back to our series! Customer retention is one of the key factors that impact the long-term success and sustainability of a business. High customer retention rates indicate satisfied customers, quality products or services,
        • Lookups and Custom Modules

          I created a Custom Module that I'm calling "Item Purchasing Group". This module will store information for groups of Items that must be purchased together (including minimum overall quantities and/or values, etc.). This will have a one-to-many relationship
        • Zoho Writer for Android - Headings

          Hello Zoho team, I have created structured doc with headings in writer web version on pc. Then I have opened it in my phone. Write is crashing while used function: menu "three dots", Document Navigation, Headings. Zoho Writer for Android 6.1.4 Samsung
        • Can't connect to POP and SMTP over VPN

          I use Thunderbird to access Zoho Mail via POP and SMTP. I have configured an app-specific password for Thunderbird to use. Everything is properly configured and works correctly — until I enable my VPN. I'm using a paid commercial VPN service (Mullvad).
        • Ask the Experts: Five-hour live Q&A session with Zoho WorkDrive product experts

          Have questions about WorkDrive 5.0? Let’s talk! We recently launched Zoho WorkDrive 5.0, packed with powerful updates to help your team work smarter, stay secure, and get more value from your business content. From content-centric workflows and AI-powered
        • Possible to reorder Pipelines position?

          I have multiple Pipelines and want to reorder their positions, so that in the Deals module record for the Pipeline field, I have them ordered in a certain way. Is there a way to reorder the position of the Pipelines without deleting existing Pipelines
        • Pleas unblock E-Mail-Adress service@montana-energie.de / kontakt@montana-energie.de

          Dear Zoho Support, Could you please unblock service@montana-energie.de / kontakt@montana-energie.de which belongs to a regular customer with whom we are having frequent business-related conversations. Thank you very much in advance, Erdem Kar homewise
        • Unable to preview attachments using Apple Safari on Mac

          When attempting to preview an image attachment in Zoho desk the image will fail to load and present a "missing" icon in the middle of the display.  This is using Safari 14.0.3 on macOS Big Sur 11.2.3.
        • Kaizen #262 - Using Zoho CRM Skill to build Queries

          Hello everyone! Welcome back to another edition of the Kaizen series, where we uncover powerful ways to extend and customize Zoho CRM. In the previous Kaizens, we explored how the zoho-crm skill can help developers work with Zoho CRM APIs, Client Scripts
        • 【10/30福岡】他社はZoho CRM×AIをどう使う? 営業に役立つ実践デモ&事例解説|10〜12月のイベント予定も!

          ユーザーの皆様、こんにちは! ゾーホージャパンの中野です。 10月30日(金)の福岡ユーザー交流会では、CRM×AIのデモ / 事例紹介と、 Zoho社員によるAIエージェントの解説を通じて、自社での活用を考えるヒントをお届けします。 ■ 福岡で学べる・話せる3つのこと ① CRM×AIで、営業の仕事はどう変わる? 株式会社etikaの宮村佳祐さんが、具体的な連携デモをご紹介します。 ・提案中の商談に、参考になる過去の類似受注案件を表示 ・打ち合わせの文字起こしをCRMに自動連携し、項目を更新 ・取引先のニュースを集約し、営業担当者へお知らせ
        • #10 India Specifics: GST, GSTIN And E-way Bills

          Meera's new client sent a purchase order, a vendor form, and one line that changed the whole invoice: "Invoices without a valid GSTIN and correct place of supply will be returned unpaid." She had entered her own GST details. The customer's details were
        • Invoke a Widget buttons not opening in Bigin web – open_in missing from response

          Hi, I’m seeing an issue with Invoke a Widget custom buttons in Bigin web. In the Bigin Developer Sandbox, the button works correctly and the custom button response includes: "open_in": "new_tab" However, once the topping is installed in a normal Bigin
        • [Zoho Desk] Follow-up: Show Full Recipient Email Address Display Improvement ?

          Hi Zoho Desk Team, I would like to follow up regarding the recipient display behavior when replying to tickets in Zoho Desk. Currently, when we reply to a ticket, the To, CC, and BCC fields are combined into a single “Recipients” field. In addition, when
        • How to record refund of expenses in zoho books

          Hi, i bought a air ticket and recorded the expense in money out. The ticket was cancelled and the fare (after deducting cancellation charges) was credited back to my bank account directly. How can i record the the above transaction?
        • Multiple subscription plan line items in Zoho Billing quotes

          I run an IT company and sell a lot of licences. A client might have multiple subscription plans including software licences in different categories. A client might have Microsoft licences, antivirus licences, web hosting and maintenance package services.
        • Invoicing multiple expense items as a single line item

                My client would like me to invoice them for multiple expense items on a single line item on an invoice.  Can this be done?  I know I can import billable expenses to an invoice, but I don't know how to show them as a single line item or have them
        • Next Page