India+91 96296 27092USA+1 659 777 0392
Flowpeak ConsultingFlowpeak Logo Mark

Zoho Creator

Deluge Statement Execution Limit Exceeded: Why It Happens and How to Fix It

Harikrishnan, founder of Flowpeak ConsultingBy Harikrishnan (The Zoho Mechanic), Founder & Chief Zoho Consultant, Flowpeak · 10+ years in Zoho · Published · Last updated

Zoho's Deluge documentation sets a limit of 5,000 executed statements for a function. The count is of statements that run, not lines written, so every line inside a loop counts again on each pass. A loop over 700 records with eight statements inside is already past the limit. The fix is to do less inside the loop, fetch only the records you need, and move large jobs to scheduled batches.

Zoho CRM setup from USD 500Fixed price in writing. Every service has a published price.

  • Registered Zoho partner
  • Calls in your business hours
  • 30 days of free fixes

A script that worked in testing fails in production with a message that the number of Deluge statement executions exceeded the maximum limit. Nothing in the code changed. What changed is the amount of data. This guide explains how the counting works, lists the other Deluge limits that fail in the same way, and shows the restructuring that fixes it.

How Deluge counts statements

Zoho's limits page says a function may execute 5,000 statements, and that executed statements are counted rather than the statements written. A script of 40 lines can therefore fail while a script of 400 lines runs, because what matters is how many times each line runs.

Loops are where the count grows. Each pass through a for each loop adds every statement inside it to the total. Ten statements inside a loop over 500 records is 5,000 executions before anything else in the function has run.

The Deluge limits to know

These are the figures on Zoho's Deluge limitations page. Zoho notes on that page that the limits may be revised, so treat them as a guide and check the page for your service.

LimitFigure
Statements executed in one function5,000
Function calls within one function75
Webhook tasks such as invokeUrl, getUrl and postUrl2,000 per user per day
Integration tasks2,000 per user per day
Emails through sendmail500 per user per day, with attachments up to 15 MB
Response size for invokeUrl5 MB

Ways to bring the count down

  • Filter before you loop. Fetch records with criteria so the loop only sees the rows that need work, instead of fetching everything and testing each row with an if statement.
  • Take work out of the loop. A value that is the same for every record should be read once before the loop starts.
  • Collect, then write once. Build a list or map inside the loop and make one update after it, where the service supports a bulk update.
  • Use built-in list and aggregate functions for totals, counts and distinct values instead of adding them up one record at a time.
  • Remove info statements and debugging lines left inside loops. They count as well.
  • Combine steps. Three assignments that build one value can often be a single statement.

When the data is simply too large

Tidying a loop buys room, but a job that must touch several thousand records will not fit in one run however carefully it is written. The reliable pattern is to process in batches.

Mark each record when it has been processed, using a checkbox or a status field. A scheduled function picks up the next batch of unmarked records, processes them, marks them and stops. It runs again on its schedule until none are left. The job takes longer, but it never fails halfway and it can be restarted safely.

Be careful with one common suggestion, which is to split the script into several functions that call each other. Zoho limits function calls within a function to 75, and how nested calls count toward the statement total is not spelled out on the limits page. Test with realistic volumes before you rely on it.

Test with production volumes

Nearly every case we see passed testing with twenty records and failed with two thousand. Before go-live, load a copy of real data into a test environment and run each script against it. Count the statements inside your largest loop and multiply by the largest number of records you expect in two years, not today. If the answer is anywhere near 5,000, build the batch version now.

How we work with you

Flowpeak Consulting is a registered Zoho partner with Zoho-certified consultants, based in Chennai and working remotely with businesses worldwide. If this error keeps coming back, it usually points to a setup problem behind it, and that is the part we fix. You get a written scope and a fixed price before work starts, the Zoho account stays in your name, and every go-live includes 30 days of free fixes.

What this usually costs and how long it takes

Zoho CRM setup
from USD 500, GBP 400, EUR 450, CAD 700, AUD 760 or AED 1,850. In India we quote after a free call.
Moving your data into Zoho
from USD 380
Connecting Zoho to another tool
from USD 270
How long it takes
most CRM setups go live in about two weeks

You get a fixed price in writing before any work starts. Zoho licences are billed by Zoho separately.

What clients say

“Working with FlowPeak Consulting was a really good experience for us...”
Team EON Group
Zoho CRM, Books and Inventory implementation
“Working with Flowpeak Consulting on our Zoho implementation was a really positive experience...”
MD, Southern Industries
Zoho One implementation
“We had a good experience working with Flowpeak Consulting for our Zoho implementation at Almapuro...”
Almapuro Agri Private Limited
Zoho implementation

Free · 60 seconds

Get your Zoho plan

Four quick questions. See which Zoho apps fit, how long it takes and what it costs to start.

Step 1 of 4

What kind of business do you run?

Free, no obligation

Looking for a Zoho implementation partner?

Tell us which Zoho app you need help with and where your business is. Hari, our founder, replies within one business day with clear next steps.

Not sure what you need yet? Answer a few plain questions and see your scope and timeline.

Which Zoho app?
What do you need?

We work with clients worldwide over video, and travel to meet you in person when the project needs it.

Get a free Zoho audit

30 minutes with a senior Zoho consultant. No obligation.

  • Fixed price in writing
  • Paid by milestone
  • 30 days of free fixes after go-live
  • Registered Zoho partner

Frequently asked questions

What is the Deluge statement execution limit?

Zoho's Deluge limitations page gives 5,000 executed statements for a function. Statements inside loops count once for every pass.

Why did my script start failing without any code change?

Your data grew. The same loop now runs over more records, so more statements execute and the function crosses the limit.

Can Zoho increase the limit for my account?

The limits page does not describe a way to raise it. Plan to restructure the script or process the records in scheduled batches.

Do info statements count toward the limit?

Every executed statement counts, so debugging lines left inside a loop add to the total. Remove them once the script works.

How do I process thousands of records in Deluge?

Use a scheduled function that handles a batch at a time and marks each record as done, so the next run continues where the last one stopped.

Related

Book a free 30-minute call
Book a free callWhatsApp