Kaizen 241 - Automating Deal Risk Escalation Using Workflow APIs, Connected Workflows, and Functions

Kaizen 241 - Automating Deal Risk Escalation Using Workflow APIs, Connected Workflows, and Functions


Hello everyone!

Welcome to another Kaizen week.

In many organizations, sales teams work in Zoho CRM, finance teams manage invoices in Zoho Books, and support teams handle customer issues in Zoho Desk. Now consider this scenario:

A sales representative is working on a high-value upsell opportunity for an existing customer. The deal has reached the final negotiation stage and is ready to move forward. From the sales team’s perspective, everything looks fine. However, the finance team may know that the customer has unpaid invoices, while the support team may already be handling unresolved tickets for the same customer.

Sales teams typically do not verify these details manually every time a deal progresses, which can lead to risky business decisions.

In this post, we will build a cross-app risk validation flow for high-value deals in Zoho CRM. When a deal enters the Negotiation/Review stage, the automation checks for unpaid invoices in Zoho Books and open support tickets in Zoho Desk, updates risk fields in CRM, escalates risky deals into a connected review process, and resumes deal progression only after approval.

To implement this, we will use a combination of:

 Prerequisites 

Before implementing this flow, make sure the following are already available:

  • Zoho CRM with access to Workflows, Custom Functions, and Connected Workflows.

  • Zoho Books and Zoho Desk configured for the same business context, and integrated with Zoho CRM. Check these links for more details : CRM - Books integration help, CRM - Desk integration help.

  • Active connections from Zoho CRM to Zoho Books and Zoho Desk.

  • The Deals module in CRM.

  • A custom module called Risk Reviews.

 

NOTE: This implementation assumes that the Zoho Books and Zoho Desk integrations are already configured and CRM connections are available for use inside Deluge invokeurl calls. In the sample function, these are referenced as books_connection and desk_connection.

The connections must include the scopes required by the APIs used in the custom function:

  • the Zoho Books connection should include scope(s) to read invoices

  • the Zoho Desk connection should include scope(s) to read contacts and tickets

If these scopes are missing, the invokeurl calls in the custom function will fail even if the workflow and Deluge logic are configured correctly.

 CRM Setup   

 Fields to Add 

Add three fields to the Deals module:

  • Approval_Status : Tracks the validation/approval state (Picklist field : Pending Validation, Approved, Escalation Required)

  • Invoice_Risk_Count : Number of problematic invoices found (Number field)

  • Open_Ticket_Count : Number of open support tickets found (Number field)

 Risk Reviews Module 

Create a custom module called Risk Reviews to store escalation records for Deals. Each Risk Review record remains connected to the originating Deal so that the review process is traceable and the original Deal can be updated automatically after approval.

Include the following fields in the Risk Reviews module:

  • Review_Status (Picklist: Pending, Approved, Rejected, Needs Clarification)

  • Risk_Type (Multiselect Picklist: Invoice Risk, Support Risk, Both)

  • Deal (Lookup to Deals module)

  • Account (Lookup to Accounts module)

  • Deal_Amount (Currency)

  • Reviewer (User field)

  • Comments (Long Text)

  • Escalated_On (DateTime - auto-populated when created)

  • Reviewed_On (DateTime - populated when review is completed)

 Step 1: Create the workflow rule   

Whenever a deal enters the final negotiation stage, we want the system to validate whether the customer has any financial or support-related risks before allowing the deal to move forward.

Workflow Trigger Conditions:

  • Stage = Negotiation/Review

  • Deal Amount > threshold value. In this example, we use ₹250000 as the high-value threshold.

This ensures that only high-value deals go through this validation process.Create this using the Create Workflow Rule API. The workflow contains a single instant action: execute a custom function.

Find the Workflow Rule API input JSON here.


 Solution flow


Custom Function 

Once triggered, the workflow executes a custom function.  The function accepts a single input parameter, dealId, from the workflow context and performs the validation logic in five steps.

 1. Fetch deal details from Zoho CRM   

It first fetches the deal record and extracts:

  • Deal stage

  • Deal amount

  • Current approval status

  • Account details

  • Contact details

These values are used both for qualification checks and for matching records across Zoho CRM, Zoho Books, and Zoho Desk.

 2. Check whether the deal qualifies for validation   

We do not want every deal to go through this process. The function exits if:

  • the deal is not in the Negotiation/Review stage

  • the deal amount is below ₹250000

This avoids unnecessary API calls and keeps the validation logic focused only on high-value deals. In a production implementation, this threshold can be moved into a configurable setting instead of being hard-coded in the function.

 3. Check invoice risk in Zoho Books   

The function fetches invoices using the configured Books connector and Zoho Books APIs. It then loops through the returned invoices and counts records where:

  • customer_name matches the CRM Account name

  • status is one of:

    • unpaid

    • overdue

    • draft

The count is stored in Invoice_Risk_Count.

In the current implementation, the CRM Account is matched to Zoho Books using the account display name. This works for simple cases, but according to your implementation,  it is better to match using a stable customer identifier instead of relying only on account names.

 

 4. Check support risk in Zoho Desk   

The function validates support risk in two stages.

First, it fetches Desk contacts using the configured desk_connection and identifies the matching contact by comparing the Desk contact email with the CRM Contact email.

Once a match is found, the function fetches Desk tickets and counts records where:

  • contactId matches the identified Desk contact

  • status = Open

The final count is stored in Open_Ticket_Count.

 5. Determine approval status   

Once both validations are complete, the function determines the new approval state:

  • if Invoice_Risk_Count > 0 or Open_Ticket_Count > 0, set Approval_Status to Escalation Required

  • otherwise, set Approval_Status to Approved

The function always refreshes:

  • Invoice_Risk_Count

  • Open_Ticket_Count

It updates Approval_Status only if the new value is different from the current one. This avoids unnecessary status updates while still keeping the numeric risk fields current.

Find the full Deluge function code here.

To make this automation safer in implementations, it is also a good idea to prevent duplicate escalations. For example, before creating or triggering a new review cycle, you can check whether an open Risk Review record already exists for the same Deal.  

Note: If you have high invoice volumes or large contact bases, extend this implementation with pagination, server-side filtering, and error handling.

Step 2: Create the Connected Workflow  

At this stage, the function has already identified whether the deal is risky.

If no risks are found, the Deal is approved and moves forward.

If risks are found, the process needs to do more: create a review record, notify stakeholders, wait for a human decision, and then update the original Deal once that decision is made. This kind of multi-record, multi-stage flow can technically be assembled using a combination of separate workflow rules and custom functions, each reacting to field changes across modules. But that means you are manually maintaining the relationships between those rules, keeping track of which record triggered what, and ensuring updates flow back correctly to the originating Deal.

Connected Workflows are built specifically for this pattern. They let you define the entire cross-record process in one place, where each stage is explicitly linked to the record that triggered it. The Risk Review stays connected to the Deal it came from, so when a reviewer approves it, the platform knows exactly which Deal to update, without you wiring that logic together separately.

This keeps the process traceable, reduces the number of moving parts you need to maintain, and makes the flow easier to extend later if you add outcomes like Rejected or Needs Clarification.

The first step is to create a Connected Workflow using the Create a Connected Workflow API, where you define the root node, name and description. After that, you can add rules using the Add a Rule to a Connected Workflow API.

Download the input JSON to create a Connected Workflow for Deals module here.

 First Connected Workflow Rule: Deal > Risk Review   

The first connected workflow rule runs when the Deal record gets updated by the function.

Trigger: Approval_Status = Escalation Required

When this happens, the rule performs two actions.

 Action 1: Create a connected record  

A connected Risk Review record gets created automatically.

Fields such as Deal name, Account, Deal amount, and risk-related details are mapped from the Deal. Additional fields such as Review_Status and Risk_Type are also populated so that reviewers can immediately understand why the Deal was escalated.

Action 2: Send escalation email  

Once the review record is created, an email notification is sent to the relevant stakeholders to inform them that the deal requires review before progressing further. This action is created using the Email Notifications API. Click here for the input JSON to create Email Notification Action request.


To download the input JSON for adding this rule to the Connected Workflow, click here.

 Second Connected Workflow Rule: Risk Review > Deal   

Once reviewers complete their review, the process should move back to the original Deal. This is handled by the second connected workflow rule.

Trigger: Review_Status = Approved

When the Risk Review record is updated to Approved, the rule performs two actions.

 Action 1: Update the Deal record   

The related Deal record gets automatically updated using a field update action. The Approval_Status will be updated to Approved, allowing the sales team to continue progressing the Deal. 

This action is created using the Create Field Update Action API. Click here to download the input JSON for this request.

 Action 2: Send approval email   

Once the Deal is approved, another email notification is sent.

This informs stakeholders that the review is complete, risks were addressed and the deal can now move forward. This action is created using the Create Email Notification API.

You can also extend this flow by defining additional outcomes such as Rejected or Needs Clarification, depending on your review process.

Attached files:

 

By combining Zoho CRM workflows, custom functions, Connected Workflows, and action APIs, we can turn a manual risk checkpoint into a structured and traceable approval process.

This pattern is useful whenever CRM decisions depend on data spread across multiple Zoho applications. By combining workflows, custom functions, and Connected Workflows, businesses can enforce validations, reduce manual checks, and create more reliable approval processes.

For production use, you can extend this implementation further by:

  • making the threshold configurable

  • storing stable cross-app identifiers for more reliable matching

  • preventing duplicate review creation

  • adding rejection or revalidation paths

  • logging integration failures for easier troubleshooting.

If your business process depends on data spread across multiple Zoho applications, this is a practical way to orchestrate that logic inside CRM.

You can find all the sample files used in this implementation, including the workflow JSONs, Connected Workflow configurations, email actions, field update actions, and Deluge function code here: Project files

We hope you found this useful. If you have any questions, feel free to leave a comment below or reach out to us at support@zohocrm.com




      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • 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
          • Kaizen #222 - Client Script Support for Notes Related List

            Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
          • Kaizen #217 - Actions APIs : Tasks

            Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
          • Kaizen #216 - Actions APIs : Email Notifications

            Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ





                                ご検討中の方

                                  • Recent Topics

                                  • Cloning Item With Images Or The Option With Images

                                    Hello, when I clone an item, I expect the images to carry over to the cloned item, however this is not the case in Inventory. Please make it possible for the images to get cloned or at least can we get a pop up asking if we want to clone the images as
                                  • Cliq iOS can't see shared screen

                                    Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                  • Zoho Books | Product updates | May 2026

                                    Hello users, We're back with the latest updates and enhancements we've rolled out in Zoho Books. From sales tax automation to scanning receipts for free, explore the updates designed to upgrade your bookkeeping experience. Sales Tax Automation [US & Canada
                                  • Blueprint Not Triggering When Lead Status Is Updated by Workflow (IndiaMART Integration)

                                    I have set up a blueprint that triggers when a lead’s status is “New Lead.” Our CRM is integrated with IndiaMART, and when leads are created from IndiaMART, their Lead Status is initially set to None. To handle this, I created a workflow that automatically
                                  • Zoho Books | Product updates | June 2026

                                    Hello users, Welcome to this month's roundup of what's new in Zoho Books! We have an exciting line-up this time. The highlight is the launch of the all-new France Edition with full ISCA compliance. We're also introducing features such as Layout Rules
                                  • Cloning a View

                                    When I clone a View, it doesn't make a copy; it only creates a new copy with the same default fields as if I were creating a new view. What is the purpose of cloning if it doesn't bring in the same fields? Thanks Rudy
                                  • Does Zoho Learn integrate with Zoho Connect,People,Workdrive,Project,Desk?

                                    Can we propose Zoho LEarn as a centralised Knowledge Portal tool that can get synched with the other Zoho products and serve as a central Knowledge repository?
                                  • Request to Update Billing Information and Payment Method

                                    Hello, I’m using Zoho and I would like to update the billing information and change the payment card to our company card. Could you please let me know how I can do this? Thank you in advance for your help.
                                  • Zoho Analytics "Esc" key problem

                                    I frequently use the Escape (Esc) key while building dashboards, reports, and writing SQL queries. Since the recent updates to Zoho Analytics, the Esc key no longer behaves as expected. When writing SQL queries, pressing Esc to dismiss a suggestion now
                                  • Zoho Analytics Filter Bug

                                    I encountered a bug where typing the letter "A" in the drop-down filter of a table or query table causes the drop-down to close unexpectedly. For example, when typing "Today", the drop-down list closes as soon as "a" is entered. I tested this on another
                                  • Zoho CRM Kiosk question – Passing Screen Fields to a Function

                                    I am building a Kiosk in Zoho CRM to create new Supplier (Vendors) records. Current setup: Screen 1 contains user input fields: Supplier Name (Vendor_Name) First Name (First_Name) I created a Deluge function: createSupplier(vendor_name, first_name) The
                                  • Using Email Triggers on Zoho Flow

                                    Hello, I'm sending the email to create the variables as this article says: https://help.zoho.com/portal/en/kb/flow/user-guide/create-a-flow/articles/email-trigger#How_email_trigger_works But the collection of the variables only seems to work when the
                                  • Number of Reopn

                                    Hi Zoho, Is there any appropriate API call for This URL "http://support.zoho.com/api/v1/dashboards/reopenedTickets?...." what I thought is the resulting output of this call has data for number of reopen... "https://desk.zoho.com/api/v1/tickets/" + Ticket_ID
                                  • How to customize the "Placeholder Text" separately from the "Field Label" on the Booking Form?

                                    Hi, I am currently customizing the Booking Form for one of my Workspaces in Zoho Bookings, and I need some help adjusting a custom text field. Right now, when I create a custom text field, the gray "placeholder text" inside the text box automatically
                                  • What's New in Zoho Inventory | April & May 2026

                                    Hello users, We're excited to roll out the latest Zoho Inventory updates for April and May 2026. These enhancements are designed to make your daily operations smoother and more efficient, from advanced inventory management and flexible pricing to automated
                                  • Introducing Spotlight Forms

                                    Hey form builders! If someone opens your form, sees the wall of fields ahead, and quietly closes the tab. It may not be because the questions were hard. It could be because the experience felt like too much. Which is why we have now introduced a new form
                                  • Workflow Assistance in Zoho CRM

                                    Our client's sales team visits customers on-site and currently fills a physical paper form to capture customer details, and then separately re-enters the same data into Zoho CRM via the mobile app — resulting in double data entry. We want the salesperson
                                  • Related products & AI product recommendations through commerce API.

                                    Hello Zoho team I’m looking to add related products and AI product recommendations to my Zoho Commerce webshop with custom storefront. Is this supported through the API? And if not, is this on your roadmap? Thanks in advance David
                                  • Why don't Zia agents support file uploads?

                                    I am trying to build a Zia Agent that allows uploading of a PDF file and uses the GLM5 model to process it and extract information. But agents.zoho.com has no way to enable file uploads on the agent. Additionally, GLM5 based agents keep outputting their
                                  • Pasting Images in Zoho Desk ignores cursor location

                                    My team has reported an issue which started recently where when we paste an image into a new or existing reply or comment, the pasted image seems to ignore the current cursor location instead paste itself at the last character present in the reply/comment,
                                  • 'Pinned' notes feature of a pipeline record

                                    Hi team, Could you please implement a feature which will allow users to pin different notes so that they will appear at the very top of the notes tab in a pipeline record. Sometimes we have a wide range of notes on a record which means more important
                                  • Canvas Detail View Related List Sorting

                                    Hello, I am having an issue finding a way to sort a related list within a canvas detail view. I have sorted the related list on the page layout associated with the canvas view, but that does not transfer to the canvas view. What am I missing?
                                  • Announcing new features in Trident for Mac (1.37.0)

                                    Hello everyone! We’re excited to introduce the latest updates to Trident, which are designed to take workplace communication to the next level. Let’s dive into the details. Import EML archives directly into Trident. You can now import EML archives into
                                  • Zia Agent activation in Zoho Desk forces new Organization creation instead of deploying to existing one

                                    While attempting to complete the deployment and activation sequence of a new Zia Agent within our existing Zoho Desk environment, the activation process failed on the user interface, throwing a generic error (see print). However, despite the activation
                                  • #10 Bill While You Sleep

                                    A consultant is reviewing last month's work. Client meetings? Done. Deliverables? Sent. Support requests? Resolved. Then they realize something. "I have completed the work... but I haven't billed the client yet." The work was completed. The client was
                                  • Team Module Issues?

                                    We are testing Team Licenses for use by our Customer Service staff. I created a Teamspace called CSR and only assigned two users to this space: Administrator (me) and “Team License Test.” Team License Test is assigned to the Team User profile, with a
                                  • Access images from form submission in power automate

                                    Images from form submission show up as links in power automate. How do I access the image data?
                                  • Forms cannot be accessed.

                                    https://forms.zoho.com/ is not available, please help to fix
                                  • Associate records via the Multi-select lookup RELATED LIST via API

                                    In the REST API, is there a way to associate records for a multi-select lookup related list other than via the linking module? There are two methods for the lookup: 1. via insert records API 2. via the linking module ...as described in https://help.zoho.com/portal/en/community/topic/kaizen-125-manipulating-multi-select-lookup-fields-mxn-using-zoho-crm-apis
                                  • Problem with CRM Connection not Refreshing Token

                                    I've setup a connection with Zoom in the CRM. I'm using this connection to automate some registrations, so my team doesn't have to manually create them in both the CRM and Zoom. Connection works great in my function until the token expires. It does not refresh and I have to manually revoke the connection and connect it again. I've chatted with Zoho about this and after emailing me that it couldn't be done I asked for specifics on why and they responded. "The connection is CRM is not a feature to
                                  • How do I post a new question in Zoho Community forums?

                                    Hi everyone, I’m new to the Zoho Community and I’m trying to figure out how to properly create and publish a new topic in the forum. When I visit the community page, I can’t clearly find the option like “Add Topic” or “Post Question.” Could someone guide
                                  • Kaizen #245 - Real Time Signal Alerts for High-Value Abandoned Checkouts

                                    Howdy, Tech Wizards! Welcome back to another week of Kaizen. In this post, we will build a real-time abandoned checkout notification system using Stripe, Zoho CRM Functions, Sales Signals, and Widgets. When a customer abandons a high-value purchase, Zoho
                                  • Unable to attach Fillable File Upload field to Merge Template ever since UI update

                                    Ever since the new UI update, the field for Attachments for sending document for Signing in Writer has had an issue where trying to add a Fillable item in the Attachment field ends up always becoming a "Choose a File From Drive" option instead. No matter
                                  • Latest updates in Zoho Meeting | An improved Analytics tab and user interface, an invite pop-up revamp, an enhanced Zoho Meeting iOS app, a recording feature in the Android app, and more

                                    Hello everyone, We’re excited to share a few updates and enhancements in Zoho Meeting. Here's what we've been working on lately: Improved analytics for meetings, an invite pop-up revamp, a multi-video feed interface in the iOS app, a recording feature
                                  • Inquiry Regarding Automated Assignment of Zoho TeamInbox Messages using Zoho Flow and Deluge

                                    Hello, Our company is currently using Zoho TeamInbox, and we are interested in automating the assignment of responsible parties using tools such as ZOHO Flow and Deluge. Is it possible to achieve this? Allow me to provide more details. Currently, when
                                  • Kaizen #125 Manipulating Multi-Select Lookup fields (MxN) using Zoho CRM APIs

                                    Hello everyone! Welcome back to another week of Kaizen. In last week's post in the Kaizen series, we discussed how subforms work in Zoho CRM and how to manipulate subform data using Zoho CRM APIs. In this post, we will discuss how to manipulate a multi-select
                                  • [Bug] WebAuthn passkey registration blocked on rpIds with TLDs longer than 6 characters (.accountant, .technology, etc.) — isValidDomain regex too strict

                                    Hi, Filing on behalf of an enterprise customer where Zoho Vault is deployed across the company. The Chrome extension blocks WebAuthn passkey registration on legitimate sites whose Relying Party ID (rpId) has a TLD longer than 6 letters. This affects every
                                  • Celebrating the businesses behind Bigin: Customer Awards 2026

                                    Hello Biginners, We're excited to announce the very first Bigin Customer Awards! If Bigin has played a role in your organization's journey, we'd love to hear about it. Share your story for a chance to be recognized among the best Bigin users across industries.
                                  • Client Script Button in Related List become invalid

                                    Hi, I am the admin of our organization. And I setup a client script button in related list to raise payment refund request While this button become non selectable recently. I believe there is something wrong from zoho as this button had run for a year.
                                  • Send Email Directly to Channel

                                    Hi, We are coming from Slack. In Slack each channel has a unique Email address that you can send emails too. I currently forward a specific type of email from my Gmail InBox directly do this channel for Verification Codes so my team doesn't have to ask
                                  • Next Page