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



    • 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

    Nederlandse Hulpbronnen


      • Recent Topics

      • Importing Tasks

        Few suggestions that would make creating project templates more efficient.   1. Having the ability to import tasks from a spreadsheet within the Project Template Task section.  You can do this when creating a "new project." 2. When importing Tasks from a spreadsheet, to be able to associate a milestone to a tasklist, just as I can associate a tasklist to a task.  This would alleviate a very tedious, time consuming process. 3. Another feature that would be very helpful is rather than a start and end
      • GSTIN Public Search API

        Does zohobooks have an api using which i can search GST numbers and get their details?
      • Zoho Books | Product updates | April 2026

        Hello users, Welcome to our April 2026 product updates roundup! Highlights include profit margin for sales transactions, insights in reports, recording deposits from undeposited funds in banking, and faster production workflows with improved assembly
      • Deleted User Emails

        I need to delete a user as I need to re-use their license, but I'd like to keep all their emails that are attached to various contacts in the CRM. Their emails are hosted externally on an M365 license. Anyone any idea how best to engineer this? TIA
      • Spell Check Red Underlines Keep Appearing Even After Disabling

        Hello Zoho Support, I'm facing an issue in Zoho Writer where red spell-check underlines keep appearing even after I disable Spell Check. I have already: Turned OFF Spelling Errors Turned OFF Grammar Turned OFF Writing Quality Turned OFF browser spell
      • Its 2022, can our customers log into CRM on their mobiles? Zoho Response: Maybe Later

        I am a long time Zoho CRM user. I have just started using the client portal feature. On the plus side I have found it very fast and very easy (for someone used to the CRM config) to set up a subset of module views that make a potentially extremely useful
      • Truco del mes: Zoho Desk - Cómo mostrar tarjetas de producto en tu chatbot

        ¡Hola a todos! Si utilizas Conversaciones Guiadas (Guided Conversations) en Zoho Desk para ayudar a los clientes a encontrar productos, probablemente te hayas encontrado con este problema: el bot ofrece una lista de opciones, pero los clientes siguen
      • 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
      • Retail Payment Receipt

        Hi, So "payment receipts" have a "Retail" template for thermal printers, but the template is configured at A4 paper size!!! How is this retail guys? On the other hand, Invoices have 3 Retail templates which have 3 and 4 inch paper size, perfectly fitting
      • Assign default Location + warehouse to Customer / Vendor

        Hello there. With the introduction of Locations I'm having to enter the warehouse for every single transaction which is getting really tiring and causes errors (easy to fix, but still). Does anybody know if there's a way to assign a default Location and
      • SalesIQ : Allow Operators to Manually Set Company Names in Visitor Info

        Hi SalesIQ Team. We have identified an issue where the Company name displayed in Visitor Info is sometimes incorrect or not displayed at all. Currently, there is no way for operators to manually edit or specify the company a visitor belongs to. I understand
      • How to charge Convenience fee OR payment gateway charges to the end client who is paying the invoice?

        Hello, I am creating this topic after having discussions with various sets of users and have understood that with people moving more and more to digital payments, it is important for the client to enable the "Convenience fee" kind of scenario. I have
      • 404 error at checkout

        Our customers are getting a 404 error at checkout. Anyone else with the same problem?
      • Enhancement in Zoho CRM: Introducing New Return Types for String Fields Based on Character Length

        Dear Customers, We hope you’re well! In Zoho CRM, formula field with string return type is used in various scenarios where text is involved like concatenating customers’ first and last names, trimming characters from texts, performing find and replace
      • BUG and HANGUP - Add Row with Fields DOUBLES the amount of rows instead of Adding Just 1 Row

        As it says in the title, there is a bug with forms generated with Zoho Writer where the Add Row With Fields ends up DOUBLING the amount of rows instead of Adding just 1 row.
      • Import and Export of website.

        Hi, i have raised this ticket regarding challenges i am facing while importing a website on zoho sites. I have created my website on Squarespace and now i want to move it to zoho sites so i want to know what i am supposed to do whats the correct step
      • 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
      • Client Script | Update - Client Script Support For Custom Buttons

        Hello everyone! We are excited to announce one of the most requested features - Client Script support for Custom Buttons. This enhancement lets you run custom logic on button actions, giving you greater flexibility and control over your user interactions.
      • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

        Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
      • Error when subscribing to any iCal feed in Group Calendar

        When I try to add any iCal URL via Settings → Calendar → Calendars → Group Calendars → Manage → Subscribed by Group, Zoho pops up an ‘Internal Server Error’ and nothing is added in the ‘Subscribed by Group’ list. But - the feed then appears under my personal
      • Record Limit on Report

        I have set up a report that I'm putting on a "page". I have filters set up to only show the records with deadlines in the next 45 days. But I only want the report to show the first 3 records (and if possible have a pagination option at the bottom to access
      • Re-Apply SLA When Ticket Reopened from Closed Status?

        If you have an SLA applied, timers are deactivated when going to "On Hold" status type and reactivated when going back to an Open status type. What we discovered is when a customer replies to a closed case and it reopens, the SLA is not applied and timers
      • Check printing alignments always changes

        Hello, We have a frustrating problem with printing checks. We use Quickbooks voucher checks, which works okay for us. The problem is the printing alignment for the check's "Date, Pay to the Order of, Amount, and Amount in Words" changes every time we
      • Problem with the blueprint flow.

        Scenario: 3 departments in a single environment: A-B-C agents from department 1 D-E-F agents from department 2 G-H agents from department 3 Since we've been using Zohodesk (2023), agents can assign tickets to the correct department using the blueprint
      • Zoho ERP | Product updates | June 2026

        Hello users, We launched Zoho ERP on January 23, and since then, our goal has been to help businesses streamline and manage their operations with greater efficiency, flexibility, and control. Since the launch, we've continued to enhance the platform every
      • 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
      • Zoho CRM upload files error

        Since today, we have been experiencing issues with uploading photos to opportunities. The message indicates that the storage is full, but as far as I can see, there is still plenty of space available. Could there be an issue or a bug?
      • "Make online" not clearing previously downloaded files from disk

        I downloaded a large folder via "Make offline" so I could copy it to another location. This worked. When I was done I hoped that "Make online" would restore it to the previous state where those files are not stored locally in TrueSync. This did not work—Finder
      • Please Make Zoho CRM Cadences Flexible: Allow Inserting and Reordering Follow-Up Steps

        Sales processes are not static. We test, learn, and adapt as customers respond differently than expected. Right now, Zoho Cadences do not support inserting a new step between existing follow-ups or changing the type of an existing primary step. If I realize
      • WhatsApp Calling Integration via Zoho Desk

        Dear Zoho Desk Team, I would like to request a feature that allows users to call WhatsApp numbers directly via Zoho Desk. This integration would enable sending and receiving calls to and from WhatsApp numbers over the internet, without the need for traditional
      • Introducing Custom Columns in Forecasts in Zoho CRM

        Hello all, Forecasts in Zoho CRM help sales representatives, managers, and business stakeholders evaluate performance and plan future sales activities. While standard metrics such as Target, Achieved Amount, and Pipeline Amount provide a baseline view,
      • Zoho Books - France

        L’équipe de Zoho France reçoit régulièrement des questions sur la conformité de ses applications de finances (Zoho Books/ Zoho Invoice) pour le marché français. Voici quelques points pour clarifier la question : Zoho Books est un logiciel de comptabilité
      • Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks

        Let's bring Manufacturing Resource Planning (MRP), Material Requirement Planning (MRP), and Production Planning/Management module / feature in Zohobooks
      • Will I see emails sent via campaigns in CRM?

        It would be useful for people to be able to see emails sent via campagins in Zoho CRM is that possible?
      • Zoho Forms - Failed CRM Sync Improvement

        I'd like to suggest an enhancement to the Zoho Forms and Zoho CRM integration. Currently, once a form entry has been submitted, there is no simple way to push that individual entry to CRM again if needed. Before anyone mentions it, I am aware that the
      • Zoho ZUGs Meetups 2026 en España: Descubriendo nuevas posibilidades con Zoho

        ¡Hola, Español Zoho Community! Hemos celebrado una nueva edición de los Zoho User Groups (ZUGs) en España (Madrid, Barcelona & Valencia), una excelente oportunidad para reunirnos, formarnos y descubrir nuevas formas de sacar más partido a nuestras herramientas
      • What is MCP and How Does It Connect to Zoho Invoice?

        If you've ever wished you could just tell your invoicing software what to do, without clicking through menus, pulling up reports manually, or switching tabs every five minutes, that's exactly what the Zoho MCP server is built for. MCP stands for Model
      • DYK 7 - Set dependency from Gantt and List view

        Did you know task dependencies in Zoho Projects can be managed across different task views? In a project, multiple teams work together towards the same goal but team members prefer accessing data with different perspectives depending on their responsibilities.
      • Goods In Transit

        Hi I was wondering if anyone had any tips or work-around to show goods in transit as a liability? We raise a PO with our supplier in China and when the goods are shipped and are invoiced, hence they are a liability of the business. However I can't convert
      • Accounts Payable and receivable

        I'm currently creating my accounts and noticed that I cannot create any more accounts payable or receivable. Is there any way to create more of this accounts and associate them to the default one available?
      • Next Page