Troubleshooting in Creator #3: Deluge execution limit optimization

Troubleshooting in Creator #3: Deluge execution limit optimization



Dear developers,

A Deluge statement execution corresponds to each line of code executed within a certain script. The total number of lines executed to complete a certain task on an action like on success is associated with a Deluge execution limit in Creator. To ensure good performance and usability, the number of lines of code executed at a time should be optimized.

Apart from each line of code written under an action, Deluge executions depends on factors such as the use of certain tasks, loops, and functions.

For example, if you're running a for each statement for a form which has 100 records in it, and you have 5 lines of code within the for each, the total number of Deluge statements executed will be 500.

If you have a function call inside the workflow, the number of lines of code in the function will also add up to the Deluge execution limit.

In this post, we'll discuss some simple scripting practices and ways to optimize code executions in Deluge:

Case 1: Using for each tasks
Case 2: Reducing variable definition to store fetched data
Case 3: Avoiding multiple IF statements and using ELSE IF
Case 4: Using built-in functions instead of counter variables



Ways to optimize execution

Case 1: Using for each task

While using for each tasks, we can utilize criteria to control the records through which it iterates.

Example:
  1. for each rec in Form_Name[ID!=0 ] // this will iterate all the records in the form
  2. {
  3. ....
  4. }

Instead, try the below script:

  1. for each rec in Form_Name[field_name=value && field_name2=value2] // this will only be executed for records that satisfy the given criteria
  2. {
  3. ....
  4. }

To iterate through records within a specified range, which meet a criteria, follow the below syntax:
  1. for each rec in Form_Name[<criteria>] range from <start_index> to <end_index>;


Case 2: Reducing variable definition to store fetched data

In some cases, we assign fetched values to a variable and use that variable within the script. If this assignment is done within a for each task, it can increase the Deluge execution. Therefore, instead of this assignment, we can directly use the fetched data in the workflow.

For example:

  1. fet=form[criteria];
  2. a=fet.field1;
  3. b=fet.field2;
  4. input.total=a+b;

Instead, try:

  1. fet=form[criteria];
  2. input.total=fet.field1+fet.field2;




Case 3: Avoiding multiple IF statements and using ELSE IF

When you need to execute a task based on multiple conditional statements, using else if statements can help avoid extra lines of code execution.


For example:

  1. if(a==1)
  2. {
  3. ...
  4. ....
  5. }
  6. if(a==2)
  7. {
  8. ..
  9. ...
  10. }
  11. if(a==3)
  12. {
  13. ..
  14. ...
  15. }

Instead, use:

  1. if(a==1)
  2. {
  3. ..
  4. ...
  5. }
  6. else if(a==2)
  7. {
  8. ..
  9. }
  10. else
  11. {
  12. ..
  13. ...
  14. }


Case 4: Using built-in functions instead of counter variables

Suppose we need to get a sum/count of data for a particular field for a set of records. It's usually done by using a counter variable, as shown below:

  1. ctr=0;
  2. for each rec in Form_name[criteria]
  3. {
  4. ctr=ctr+1;
  5. }
  6. info ctr;


Instead of the above script, we can use our built-in function, count(), as shown below:
  1. 1.fet=form_name[criteria].count(ID);info fet;


Note: The count function in the aggregate records Deluge task returns the count of values (including empty strings) a specified field holds, from records fetched using a criteria.

Now imagine we have to use the record count inside an if statement to execute a particular task, then usually the script used would look something like this:

  1. var=Formname[x=y && z=t];
  2. Var2=var.count(ID);
  3. if(var2>0)
  4. {
  5. ..
  6. ...
  7. }

This can be optimized to:

  1. If (Formname[x=y && z=t].count(ID)>0)
  2. {
  3. ..
  4. ...
  5. }

And we hope that helped! You can find more information about our built-in functions in this help article.


Please let us know how you like this article in the comments below, as well as any other topics you'd like to see us work on. Contact support@zohocreator.com for any further questions.

    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.







                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator Resources



                                                                                        Zoho CRM Resources

                                                                                        • CRM Community Learning Series

                                                                                          CRM Community Learning Series


                                                                                        • Kaizen

                                                                                          Kaizen

                                                                                        • Functions

                                                                                          Functions

                                                                                        • Meetups

                                                                                          Meetups

                                                                                        • Kbase

                                                                                          Kbase

                                                                                        • Resources

                                                                                          Resources

                                                                                        • Digest

                                                                                          Digest

                                                                                        • CRM Marketplace

                                                                                          CRM Marketplace

                                                                                        • MVP Corner

                                                                                          MVP Corner









                                                                                            Design. Discuss. Deliver.

                                                                                            Create visually engaging stories with Zoho Show.

                                                                                            Get Started Now


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

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

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方




                                                                                                                • Recent Topics

                                                                                                                • Join Zoho Meeting only via Web browser and not with Zoho Meeting App

                                                                                                                  Dear Zoho team, according to the documentation [1], Zoho Meeting only offers web view for Chrome and Firefox on a desktop. For other browsers and devices, participants can only join a Zoho Meaning with the Zoho Meeting App installed. This is a big hurdle
                                                                                                                • CRM gets location smart with the all new Map View: visualize records, locate records within any radius, and more

                                                                                                                  Hello all, We've introduced a new way to work with location data in Zoho CRM: the Map View. Instead of scrolling through endless lists, your records now appear as pins on a map. Built on top of the all-new address field and powered by Mappls (MapMyIndia),
                                                                                                                • Move email between inboxes?

                                                                                                                  Is it possible to move emails from one team inbox to another? We would like to be able to have a single "catch-all" inbox for incoming requests, and then move the email to the appropriate department inbox. I was hoping we would be able to accomplish this
                                                                                                                • Updating records through Zoho Sheets View doesn't update timeline or trigger workflow rules

                                                                                                                  I have noticed that when i update a series of record with the zoho sheets view (see here http://d.pr/i/ahnR) it doesn't update timeline history or trigger workflow rules. I am using it in the Deals module. Looking forward for some more info. Denis
                                                                                                                • Manage control over Microsoft Office 365 integrations with profile-based sync permissions

                                                                                                                  Greetings all, Previously, all users in Zoho CRM had access to enable Microsoft integrations (Calendar, Contacts, and Tasks) in their accounts, regardless of their profile type. Users with administrator profiles can now manage profile-based permissions
                                                                                                                • inability to use different primary address on invoice per location

                                                                                                                  my company operates in two different locations with different email address. The problems then is the inability to edit the primary to suite the invoice for the second location.
                                                                                                                • AI Search and Record Retrieval Inside Zoho Creator – Is This Possible?

                                                                                                                  Is it possible to integrate an AI assistant into Zoho Creator that can intelligently search, retrieve, and analyze records within the application’s forms and reports? Can AI access and query existing Creator data securely using Deluge or APIs to provide
                                                                                                                • Rename Service Report

                                                                                                                  Some of our customers are requesting the name of the service report PDF to be in a specific format, for example, instead of REP-001.PDF some are requesting to include their name like customername.pdf. is that possible?
                                                                                                                • Smarter holiday planning with yearly-specific Holiday Lists

                                                                                                                  Hello everyone! Managing holidays and business hours is now easier and more efficient. Holiday Lists now support holidays that fall on different dates every year, while business hours now supports more than one holiday list. This helps businesses manage
                                                                                                                • AI Search and Record Retrieval Inside Zoho Creator – Is This Possible?

                                                                                                                  Is it possible to integrate an AI assistant into Zoho Creator that can intelligently search, retrieve, and analyze records within the application’s forms and reports? Can AI access and query existing Creator data securely using Deluge or APIs to provide
                                                                                                                • Scheduled AU Data Center Database Version Upgrade for Zoho Forms

                                                                                                                  Dear Zoho Forms' users, We would like to update you on a scheduled AU Data Center database version upgrade for Zoho Forms. Find the schedule below: Migration window: Sunday, 22nd February 2026 12.00 AM to 12.30 AM AEDT This migration is a part of our
                                                                                                                • Cannot get code to work with v2.mergeAndStore!

                                                                                                                  Please can someone help me pass subform items into a repeating mail merge table row using v2.mergeAndStore? I have a mail merge template created in Writer and stored in Workdrive. This template is referenced by a custom CRM function which merges all of
                                                                                                                • Hotmail is blocking the zoho mail IP

                                                                                                                  Greetings, Since last Tuesday (5 days ago today) I wrote to Zoho support and I still haven't received a single response (Ticket ID: 2056917). Is this how you treat people who pay for your email service? I am making this public so that those who want to
                                                                                                                • Zoho Bookings and Survey Integration through Flow

                                                                                                                  I am trying to set up flows where once an appointment is marked as completed in Zoho Bookings, the applicable survey form would be sent to the customer. Problem is, I cannot customise flows wherein if Consultation A is completed, Survey Form A would be
                                                                                                                • Zoho CRM Community Digest - December 2025 | Part 2

                                                                                                                  Hello Everyone! During the final weeks of December, Zoho CRM introduced updates that not only enhanced product capabilities but also offered deeper guidance through Kaizen posts. This section highlights what was released and shared in the last two weeks
                                                                                                                • CRUD actions for Resources via API

                                                                                                                  Hello, is it possible to perform CRUD actions through the API for Resources? We want to create a sync from Zoho CRM Car record to Bookings resources to create availabilities for Car bookings. For Test drives, not only the sales person needs to be available,
                                                                                                                • Kaizen #186 : Client Script Support for Subforms

                                                                                                                  Hello everyone! Welcome back to another exciting Kaizen post on Client Script! In this edition, we’re taking a closer look at Client Script Support for Subforms with the help of the following scenario. " Zylker, a manufacturing company, uses the "Orders"
                                                                                                                • Unable to Assign Multiple Categories to a Single Product in Zoho Commerce

                                                                                                                  Hello Zoho Commerce Support Team, I am facing an issue while assigning categories to products in Zoho Commerce. I want to assign multiple categories to a single product, but in the Item edit page, the Category field allows selecting only one category
                                                                                                                • オンライン勉強会のお知らせ Zoho ワークアウト (2/19 参加無料)

                                                                                                                  ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 2月開催のZoho ワークアウトについてお知らせします。 今回はZoomにて、オンライン開催します。 ▶︎参加登録はこちら(無料) https://us02web.zoom.us/meeting/register/6AyVUxp6QDmMQiDGXGkxPA ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目指すイベント「Zoho
                                                                                                                • doubts about customer happiness in zoho desk

                                                                                                                  Good afternoon, Desk community. The reason for my message is that I have a question regarding the customer satisfaction surveys we can ask our clients to rate our service. I know that in Desk, you can activate Customer Happiness to send a survey to the
                                                                                                                • COQL API in JS Widget only pulling 200 records

                                                                                                                  Hello! We've been building a custom homepage widget using the Zoho JS SDK, and it seems that this https://help.zwidgets.com/help/latest/ZOHO.CRM.API.html#.coql only allows 200 records. I thought the limit was 2000 for COQL queries, but am I mistaken?
                                                                                                                • Standard Description Field - Can I change label or add dd tooltip

                                                                                                                  Is there a way fo you guys to allow the customer to change the label name for the description field in the customer portal when submitting tickets. Or at least allow us to add a tooltip to clarify what description we need from them. I know I can create my own separate multi line description field but if I do that, it doesn't have the nice toolbar with Bold, Italic, Underline, color, font, indent, etc. Can you please allow us to add a tooltip to the zoho standard description field?
                                                                                                                • Introducing parent-child ticketing in Zoho Desk [Early access]

                                                                                                                  Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
                                                                                                                • Ability to CC on a mass email

                                                                                                                  Ability to CC someone on a mass email.
                                                                                                                • Different Task Layouts for Subtasks

                                                                                                                  I was wondering how it would be possible for a subtask to have a different task layout to the parent task.
                                                                                                                • Compensation | Salary Packages - Hourly Wage Needed

                                                                                                                  The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
                                                                                                                • Customizing Helpcenter texts

                                                                                                                  I’m customizing the Zoho Desk Help Center and I’d like to change the wording of the standard widgets – for example, the text in the “Submit Ticket” banner that appears in the footer, or other built-in widget labels and messages. So far, I haven’t found
                                                                                                                • Ability to Edit Ticket Subject when Splitting a Ticket

                                                                                                                  Often someone will make an additional or new request within an existing ticket that requires we split the ticket. The annoying part is that the new ticket maintains the subject of the original ticket after the split so when the new ticket email notification
                                                                                                                • Automatically Update Form Attachment Service with Newly added Fields

                                                                                                                  Hi, When I have a Form Setup and connected to a 3rd Party Service such as OneDrive for Form Attachments, when I later add a new Upload Field I have to remove and redo the entire 3rd Party Setup from scratch. This needs to be improved, such as when new
                                                                                                                • 🚀 WorkDrive 6.0 (Phase 1): Empowering Teams with Content Intelligence, Automation, Accessibility, and Control

                                                                                                                  Hello, everyone! WorkDrive continues to evolve from a robust file management solution into an intelligent, secure, and connected content collaboration platform for modern businesses. Our goal remains unchanged: to simplify teamwork, strengthen data security,
                                                                                                                • Reopen ticket on specific date/time

                                                                                                                  Is there a way that we can close a ticket and setup a reopen of that ticket on a specific date and time? (without using the "on hold" ticket option)
                                                                                                                • Column letter from number

                                                                                                                  Hello, I am trying to select a cell and i have the column number. How do i do this or is there a way of getting the letter from the number? Thank you
                                                                                                                • API credit COQL COUNT

                                                                                                                  The docs describe API credits in COQL from the LIMIT perspective: https://www.zoho.com/crm/developer/docs/api/v8/COQL-Overview.html When using aggregate functions such as `COUNT` or `SUM`, is that billed as 1 API credit?
                                                                                                                • Weekly Tips : Save Time with Saved Search

                                                                                                                  Let's assume your work requires you to regularly check emails from important clients that have attachments and were sent within a specific time period. Instead of entering the same conditions every time—like sender, date range, and attachments included—you
                                                                                                                • Remove 'This is an automated mail from Zoho Sign' in footer

                                                                                                                  Hi there, Is it possible to remove or change the text under the e-mail templates? I can't figure out how to do that: Would love to hear from you. Kind regards, Tristan
                                                                                                                • Organize and manage PDFs with Zoho PDF Editor's dashboard

                                                                                                                  Hello users, Zoho PDF Editor's dashboard is a one-stop place to upload, sort, share PDF files, and more. This article will explore the various capabilities that Zoho PDF Editor's dashboard offers. A few highlights of Zoho PDF Editor's dashboard: Upload
                                                                                                                • Custom function return type

                                                                                                                  Hi, How do I create a custom deluge function in Zoho CRM that returns a string? e.g. Setup->Workflow->Custom Functions->Configure->Write own During create or edit of the function I don't see a way to change the default 'void' to anything else. Adding
                                                                                                                • Passing Info from Function to Client Script

                                                                                                                  Hello, I have recently started making use of client script for buttons, allowing me to give the user information or warnings before they proceed. This is great. However, I have never quite managed to pass back any extra information from the function to
                                                                                                                • Drag 'n' Drop Fields to a Sub-Form and "Move Field To" Option

                                                                                                                  Hi, I would like to be able to move fields from the Main Page to a Sub-Form or from a Sub-Form to either the Main Page or another Sub-Form. Today if you change the design you have to delete and recreate every field, not just move them. Would be nice to
                                                                                                                • Zoho Payroll for Canada

                                                                                                                  Is anyone else having problems getting setup for Canada?
                                                                                                                • Next Page