Kaizen 254 - Building a Temporal Lead Score Decay System in Zoho CRM

Kaizen 254 - Building a Temporal Lead Score Decay System in Zoho CRM



Hello, CRM Wizards!

Welcome to a fresh week of Kaizen. 

In this post, we will build a temporal lead score decay system that works alongside your existing scoring rules by introducing percentage-based score decay driven solely by customer inactivity

By the end of this tutorial, you will have a Current Intent Score that reflects both customer engagement and its recency, enabling your sales team to prioritize leads with the strongest current buying intent.

Business Problem

Scoring rules evaluate customer activities against configured criteria and adjust scores whenever those conditions are met.

However, once a score is awarded, it generally remains until another qualifying activity changes it or the scoring conditions are evaluated again. This means the score does not naturally lose value simply because the customer has been inactive.

As a result, a lead that accumulated a high engagement score several days ago may continue to appear more valuable than a lead with more recent engagement, even though its current buying intent has declined.

Solution Overview

To address this, we will introduce a percentage-based temporal decay model that gradually reduces a lead’s score based solely on the customer’s inactivity period.
The solution separates engagement scoring from intent scoring.
  1. The Engagement Score continues to represent the customer’s latest engagement based on your configured scoring criteria.
  2. The Current Intent Score is derived from the Engagement Score and gradually decreases over time according to a the decay model whenever no new customer activity occurs.
It consists of four components:

Engagement Score

A custom field, updated by the scoring rule whenever a qualifying customer activity occurs. This represents the customer’s latest engagement score and serves as the base score for calculating temporal decay.

Current Intent Score

A custom field, that stores the score after applying percentage-based temporal decay. This is the score that sales representatives should always use to prioritize leads, as it reflects both the customer’s engagement and the time elapsed since the last qualifying activity.

Workflow 

Whenever the Engagement Score is updated, the workflow immediately copies its value to the Current Intent Score, ensuring that new customer activity instantly refreshes the lead’s current intent. 
It also records the timestamp in the Last Engagement Time custom field, which the scheduled function later uses to calculate the inactivity period for score decay.

Scheduled Function

Runs once every day to identify inactive leads, calculate the inactivity period, apply the quadratic decay formula, and update the Current Intent Score.
The Engagement Score serves as the source score maintained by the scoring rule, while the Current Intent Score serves as the operational score used by the sales team for lead prioritization.

Prerequisites

I. Create the Required Custom Fields

Create the following two custom fields in the Leads module using the Working with Custom Fields help page. 

Field
Data Type
Current Intent Score

String
Last Engagement Time

Date & Time



Make a Get Fields Metadata API to get the API names of these fields or go to Setup > Developer Hub > APIs and SDKs > CRM API > Leads to get the valid API names. 

Store the API names, it will be used later in the scheduled function. 

Notes
Note

The Engagement Score custom field can be created during the scoring rule configuration. This ensures that the field remains non-editable for users and cannot be modified through other actions.

II. Create a Connection

Refer to the Working with Connections help page for a step-by-step guide. 

Go to Setup > Developer Hub > Connections and create a connection for Zoho CRM service with the following two oauth scopes:
  1. ZohoCRM.modules.ALL
  2. ZohoCRM.coql.READ

Step 1 - Configure the Scoring Rule

Create a scoring rule that reflects your business requirements. For detailed instructions, refer to the Configuring Scoring Rules help page.

For this demonstration, we will create a scoring rule with a maximum score of 100.

Navigate to Setup > Automation > Scoring Rules and click the New Scoring Rule button.


Configure the scoring criteria based on your business requirements. 

For this example, we will use customer engagement activities supported by Zoho CRM, including:
  1. Emails: Opens, clicks, replies, and bounces.
  2. Calls: Incoming and outgoing call activities.
  3. Campaigns: Customer interactions with marketing campaigns.
  4. SalesIQ: Website visitor activities and engagement signals.
  5.  Any other customer engagement signals relevant to your sales process.

During the configuration, you will see the following option:
Would you like to add score fields to the records?
Click Yes, proceed.
Enter Engagement Score as the field name and choose Score from the adjacent dropdown.


Step 2 - Configure the Workflow

Next, create a workflow rule that executes whenever the Record Score is updated in the Leads module.

Refer to the Configuring Workflow Rules help page and Setting Field Updates help page for a step-by-step guidance. 

Go to Setup > Automation > Workflow Rules.
Create a workflow for the Leads module and apply it to all records. Under Instant Actions, add two Field Update actions.

Field Update 1: Last Engagement Time

Configure the first field update as follows:
  1. Field: Last Engagement Time
  2. Value to be updated: Static
  3. Select Execution Day from the calendar picker.
This stores the date and time when the Engagement Score was last updated due to customer activity.

Field Update 2: Current Intent Score

Create another field update and configure it as follows:
  1. Field: Current Intent Score
  2. Value to be updated: Reference
  3. Reference Field: Engagement Score
Whenever the Engagement Score changes, the workflow immediately copies its value to the Current Intent Score.


Since sales representatives always use the Current Intent Score to prioritize leads, this ensures that any new customer activity is reflected immediately instead of waiting for the next scheduled execution.
Save the workflow rule.

Step 3 - Create the Scheduled Function

The final step is to create a scheduled function that introduces percentage-based score decay during periods of inactivity.

For detailed instructions, refer to the Creating Schedules in Automation help page. 

Go to Setup > Automation > Schedules and click Create New Schedule

Configure the schedule to run once every day


The scheduled function performs the following operations.

Fetch the Eligible Leads

Execute a COQL query via invokeUrl task to retrieve the following fields such as Lead ID, Engagement Score, Current Intent Score and Last Engagement Time. 

Filter the records using the following criteria:
  1. Last Engagement Time is older than one day.
  2. Current Intent Score is greater than 0.
whereFilter = "Last_Engagement_Time < '" + cutoffDateTimeStr + "' AND (Current_Intent_Score is null OR Current_Intent_Score != '0')";
coqlQuery = "SELECT id, Engagement_Score, Current_Intent_Score, Last_Engagement_Time FROM Leads WHERE (" + whereFilter + ") LIMIT " + pageOffset.toString() + ", 2000";
coqlBody = Map();
coqlBody.put("select_query",coqlQuery);
info coqlBody.toString();
coqlResponse = invokeurl
[
type :POST
parameters:coqlBody.toString()
connection:"zylker_oauth_connection"
];
info coqlResponse;

Since the score decay operates only during inactivity, leads that have already reached a Current Intent Score of 0 do not require further processing. If a qualifying customer activity occurs later, the workflow immediately refreshes the Current Intent Score, making the lead eligible for future decay calculations.

If your organization contains more than 2000 records, paginate through the COQL response until all eligible records have been processed. In Deluge, this can be achieved using the leftpad() string function and pageOffsets.add() method (add()) on a list object together to process large number of records without writing nested loops. 

pageLoopList = "".leftPad(6).replaceAll(" ",",").toList().subList(0,6);
pageOffset = 0;
updateBatch = List();
for each el in pageLoopList
{
//Your code here
}

Info
For more details, find the complete working code in the CRM Kaizen Git Repository.

Calculate the Inactivity Period

For every lead returned by the COQL query, calculate the number of inactive days using the current date and time and the Last Engagement Time field.
You can use the built-in zoho.currentdate system variable to determine the current date.

Apply Percentage-Based Temporal Decay

The score decay is applied solely based on inactivity. No additional customer activity is required for the score to change.

For the demo, we will use a quadratic percentage decay model so that buyer intent decreases rapidly immediately after the last engagement and then tapers off over time.
The remaining score is calculated as:

Quote
remainingFactor = (1 - (inactiveDays / 5))²
Current Intent Score = max(0, Engagement Score × remainingFactor)

Where, inactiveDays is capped at 5 and the score reaches 0 after 5 inactive days.

For an engagement score of 100, the score progression would look like this:

Inactive Days

Remaining Factor

Current Intent Score

0
1.00
100
1
0.64
64
2
0.36
36
3
0.16
16
4
0.04
4
5
0.00
0

Update the Current Intent Score

After calculating the decayed score, use the Update Records API Deluge task to update the Current Intent Score for each lead. 

Notice that the Engagement Score remains untouched. It continues to represent the customer’s latest engagement, while the Current Intent Score represents the customer’s current buying intent after accounting for inactivity.

Let's Test!

Assume a customer performs a qualifying activity that results in an Engagement Score of 60 and triggered the workflow rule.

If no further qualifying activity occurs for the next two days, the scheduled function identifies the lead as inactive, calculates the inactivity period, applies the percentage-based temporal decay model, and updates the Current Intent Score to 22.


If the customer performs another qualifying activity before the next scheduled execution, the workflow immediately synchronizes the Current Intent Score with the latest Engagement Score, and the inactivity-based decay cycle starts again from the new Last Engagement Time.

The Current Intent Score complements your existing engagement scoring by introducing percentage-based temporal decay during periods of inactivity. This provides sales representatives with a score that reflects not only customer engagement, but also how recently that engagement occurred.

Although this example uses a five-day quadratic decay model, you can customize both the decay period and the decay formula to suit your business requirements.

Further Enhancements

The temporal score decay model presented in this demo uses a fixed decay curve for every lead. Depending on your business requirements, you can make the model more dynamic by introducing a decay factor into the calculation.

For example, the remaining factor can be calculated as:
Quote
remainingFactor = (1 - (inactiveDays / 5))² × decayFactor
This decay factor allows you to influence how quickly a lead’s Current Intent Score decays based on additional business context like territory, customer tier, product interest etc,. 

Scenario 1: Prioritize High-Value Leads

You can derive the weight factor from the Annual Revenue field to slow down or accelerate the decay for different categories of leads. For example, 

Annual Revenue

Decay Factor

Result
Less than $100K

0.8
Faster decay

$100K - $500K

1.0
Standard decay

Greater than $500K

1.2
Slower decay

Scenario 2: Decay Based on Lead Status

The Lead Status field can also influence the decay rate. For example, 

Lead Status
Decay Factor
Result
Attempted to Contact

0.8
Faster decay

Not Qualified

0.6
Much faster decay

Contacted
1.0
Standard decay

Pre-qualified

1.2
Slower decay


This enables your sales process to align score decay with the maturity of each lead. Leads that are already progressing through the sales funnel retain their intent score longer, while inactive or lower-priority leads gradually lose priority more quickly.

We hope you find this kaizen helpful.

Have questions or suggestions? Drop them in the comments or write to us at support@zohocrm.com.

On to Better Building!

----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
    • 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 #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
    • 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
      • Recent Topics

      • Caso de Éxito: Cómo Toyota Financial Services unificó la atención al cliente con Zoho

        "Después de seis meses con el CRM en producción estamos encantados." Miriam Cárdenas, Responsable Departamento ATC Toyota Financial Services es la división financiera de Toyota encargada de gestionar la financiación de vehículos y, junto con KINTO España,
      • 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é
      • Automatically remove commas

        Team, Please be consistent in Zoho Books. In Payments, you have commas here: But when we copy and paste the amount in the Payments Made field, it does not accept it because the default setting is no commas. Please have Zoho Books remove commas autom
      • Zoho ERP | Product updates | July 2026

        Hello users, We're back with another round of updates to help you streamline your operations. This month's release brings new features and enhancements designed to help you work more efficiently. Read on to discover everything that's new in Zoho ERP this
      • Zoho CRM

        Cuándo voy a adjuntar un archivo .pdf en un registro en el campo Archivo obtengo el siguiente error:
      • Zoho Campaigns EU Topics API returns HTTP 200 with empty topicDetails

        Hello, Our Zoho Campaigns EU organisation has two custom topics visible in the Campaigns UI, and contacts are subscribed to them. However, an OAuth request with ZohoCampaigns.contact.READ to https://campaigns.zoho.eu/api/v1.1/topics returns HTTP 200 with
      • Can I hide some products from a particular customer

        HI I want ot give a customer access to the portal but I need to hide some products from them that are not available for them to buy- is this possible ?
      • Dashboard/Component filter by probability

        Hi all Can I request the ability to add a Component or Dashboard filter for Deal Probability? Would be useful to be able to see data of deals more than 60% probable. Olly
      • Admin Logging in as another User

        How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
      • OpenAI Is Moving to the Responses API: Here's What It Means for SalesIQ

        OpenAI has deprecated its Assistants API and is moving to the Responses API. If you're using OpenAI Assistants with SalesIQ, you may be wondering if you need to make any changes to your existing setup. You don't. SalesIQ has already taken care of the
      • Free webinar: Zoho Sign for Microsoft apps

        Hello, Did you know Zoho Sign works right inside the Microsoft apps you already use? A signature request shouldn't mean leaving Teams for another tab, or downloading an Outlook attachment just to sign it. Zoho Sign integrates with Microsoft 365, Teams,
      • Billing Status and WO Status Field Colors -

        Hello Team, I noticed that the colors of the Billing Status and WO Status fields in the WO module have been changed. (Org ID:170000078905) This is not urgent to correct, but I wanted to bring it to your attention so you can check whether this is a system
      • Introducing throw statements in Deluge

        Hello everyone, We're introducing a powerful addition to Deluge that gives you more precise control over error handling in your scripts. Whether you're calling an external API, validating user input, or enforcing a business rule, there are moments when
      • Zoho Notebook、実はこんなところから使えます

        ユーザーの皆様、こんにちは。ゾーホージャパンの田村です。 前回に続き、今回もZoho Notebookをご紹介します。 関連情報 メモの保存場所、見直しませんか?― Zoho Notebookで始める情報管理 仕事中、「この内容、メモに残してあとで見返したいな」と思う瞬間はありませんか? 会議中の一言、お客様とのやり取り、CRMで見つけた気づき、 ほんの数秒で終わる内容だからこそ、「あとで書こう」と思って、そのまま忘れてしまうこともあります。 そこで今回は、PCやスマートフォンはもちろん、普段お使いのZoho製品からもすぐにアクセスできるノートアプリ「Zoho
      • I have been looking for CVID to get segmate list where & how can fnd it?

        I am trying to get segment details from the Zoho API. The API documentation says that the CVID is a mandatory parameter, but I cannot find the CVID in the "getmailinglists" API. Can you tell me where to find the CVID?
      • How do I increase the email attachment size in Zoho CRM ?

        It looks like I'm limited to 10MB when sending an attachment using the email widget on a record in Zoho CRM. Is there a way to increase the size? Or can I use some other tool? From what I'm reading online, I'm maxed out at 10MB. Any insight would be greatly
      • Introducing Incentives for Zoho CRM: Build, automate, and track sales commissions

        Dear Customers, We are here with an amazing news! We built a direct solution to help manage your commission provisioning activity in your business. From creating commission plans to issuing payouts, this application leverages your sales reps’ performance
      • Subforms and automation

        If a user updates a field how do we create an automation etc. We have a field for returned parts and i want to get an email when that field is ticked. How please as Zoho tells me no automation on subforms. The Reason- Why having waited for ever for FSM
      • Cannot format "start date" field in Zoho Flow

        I am trying to recreate a flow that connects Inventory package creation to Zoho projects (where a task is created in a defined project). I've been able to troubleshoot everything EXCEPT the date fields; specifically the "start date" - which is quite important
      • Dynamic Signature - Record owner

        Hi everyone, I’m using Zoho Writer merge templates from Zoho CRM and have two questions: Owner signature: How can I automatically insert the CRM record owner’s signature in the merged document? I’m not sure where this signature is stored or how to reference
      • Add ZeptoMail to Zoho One

        Hi Zoho Team, I would like to request that ZeptoMail be added as a fully included application within Zoho One. Why this is important Zoho One is positioned as a unified business operating system that brings the applications an organization needs under
      • GETTING THERE THANKS

        So we are still testing thanks to the great Zoho team for firstly getting pricelists working (essential) and writing some code to hide delivery and pickup options. Brilliant. So price lists are a definite mainly because of VAT. We run our Zoho books with
      • Time Zone is incorrect

        Time zone is not working properly...I've checked it twice. I'm eastern U.S. time it's currently 12:22 pm EST. CRM shows 3:22 pm EST.
      • CRM wants to access other apps and services on this device (Documents area)

        Did anyone else see this today? It only seemed to popup in the Documents area. Blocking it did not stop the ability to upload files there... Why is this coming up and what apps/services is it requesting in the background? Also, is it applicable elsewhere
      • Custom module - change from autonumber to name

        I fear I know the answer to this already, but thought I'd ask the question. I created a custom module and instead of having a name as being the primary field, I changed it to an auto-number. I didn't realise that all searches would only show this reference.
      • How can I populate dropdown data with information from another source or app?

        I want to maintain a list of items in another app (say in excel or another database) and sync those as items in a drop down menu, instead of copy pasting to import. Is this kind of a feature available?
      • Dynamic Field Folders in OneDrive

        Hi, With the 2 options today we have either a Dynamic Parent Folder and lots of attachments all in that one folder with only the ability to set the file name (Which is also not incremented so if I upload 5 photos to one field they are all named the same
      • Zoho Tables is now available in Zoho One!

        Hello Zoho One users, We’re excited to announce that Zoho Tables is now included as a part of Zoho One suite! As teams grow, managing projects, approvals, inventories, campaign trackers, and operational workflows across multiple spreadsheets become difficult.
      • Getting there -thanks

        So we are still testing thanks to the great Zoho team for firstly getting pricelists working (essential) and writing some code to hide delivery and pickup options. Brilliant. So price lists are a definite mainly because of VAT. We run our Zoho books with
      • #3 Making it look like my business

        Day 3: Meera had created her first invoice. The numbers were right, but something still felt unfinished. Her studio name was there, but the address did not look the way she wanted. Her logo was missing, and the invoice did not really feel like it came
      • Scan & Fill with double quote key/value pairs

        Hi, An old Ticket moved to a Topic/Idea: I love the idea of the new Scan & Fill as it nearly covers my previous request for a QR Scanner to read a multi-part QR Code. My QR Codes are hard-coded as below: {"key1":"value1","key2":"value2","key3":"value3"}
      • Increase the "Maximum Saved Entries per User" Options Limit

        Hi, You can create lots of saved entries, yet the Limit when you apply one is 25, we may often expect 32 to be in draft, and therefore want to enforce that, can we increase the limit of this field from 25 to 100 (As you can just turn it off and have more
      • HEIC File Type Viewer

        Hi, It would be nice to be able to click on the images in the All Entries/Reports Tables which are HEIC the same as JPG, PNG, etc. so they open in a viewer from Zoho or the Attachment Service, today HEIC requires you to download each image and open it
      • Map Dependency Upgrades in Zoho CRM

        Map Dependency Fields enhancements are now available across all DCs. Hello everyone, We’ve introduced a set of enhancements to Map Dependency Fields to make setup simpler, faster, and more intuitive. Map Dependency helps control how values appear across
      • Specific ListView Canvas on Canvas Home Page Always Loads Most Recent ListView, Not the One Specified

        I had mentioned this to ZOHO, but I mainly wanted to see if others in the Community are also facing this problem. I created a Canvas ListView for a Custom Module, and then created a Canvas Home page (technically on a tab item, but I'm not sure if that
      • Programmatic Itemized Expenses?

        It does not appear that it is possible to create itemized expenses programmatically (via the API)? Is this correct, or am I misunderstanding the situation?
      • Zoho Forms Submission URL

        Hi Zoho, It would be great to have a URL which can take us to specific form entries. For example: https://forms.zoho.eu/ACCOUNTNAME/report/FORMNAME/records/UNIQUE-REF I currently have a use case where I want to use Zoho Flow to create a module entry in
      • Optional Parameter in Deluge Sendmail function to link email to record

        I love sendmail - it offers flexibility (and, with standalone functions, commonality with minimal maintenance) over the years the templates hadn't offered. I understand the templates have come a long way, but I still prefer sendmail most days. That said...
      • Zoho CRM Functions: Redesigned Interface, Rich Analytics, and Multi-Language Support

        Hello everyone! We have given Functions in Zoho CRM a major overhaul with a new interface that makes it easier to build, organize, monitor, and troubleshoot your functions throughout their lifecycle. As part of this revamp, we have also introduced a unified
      • 📣 And the Bigin Customer Award winners are...

        50+ entries. Customers from across the globe. So many great Bigin stories. And now, it's time to celebrate the people who stood out. We launched the Bigin Customer Awards to see how businesses are using Bigin in their own unique ways, and you did not
      • Next Page