Quick summary
- Identify whether the job exhausted time, daily capacity, or a short-term service limit.
- Read and write rectangular ranges in batches.
- Advance the checkpoint only after the destination confirms the batch.
When a Google Apps Script quota exceeded error stops a spreadsheet job, identify the named service and limit before restarting it. For merchants and analysts maintaining operational reports, recover from the first unconfirmed record, batch the remaining writes, and keep the last complete report available while the repair runs.
Diagnose a Google Apps Script quota exceeded error
Open the Apps Script project and select Executions. Find the run by start time and function, then copy the exception text into the job log with the elapsed time and executing account. Identify the last successful operation. A stopped report with a half-filled tab tells you where to investigate but cannot tell you which limit stopped it.
Separate execution timeout from a daily allowance
The Google quota table lists six minutes per ordinary script execution for both consumer and Google Workspace accounts. Total trigger runtime is a separate allowance of 90 minutes per day for consumer accounts and six hours per day for Workspace. A single run can exhaust its own time while substantial daily capacity remains.
Google describes daily service quotas as per-user allowances that reset 24 hours after the first request. Record which account owns the relevant trigger and what other jobs use that service under the same account. A midnight retry based on the store’s local time may arrive before capacity becomes available.
| Observed failure | Evidence to collect | Next decision |
|---|---|---|
| Maximum execution time | Elapsed time and last completed batch | Shorten the unit of work |
| Daily service allowance exhausted | Named service and executing user | Defer until capacity returns |
| Too many calls in a short time | Request rate and overlapping runs | Reduce bursts and retry with a bounded delay |
Find the service calls hidden inside the row loop
Sketch one trip through the job as input retrieval, lookup, transformation, sheet write, and notification. Count service operations for each stage and record typical elapsed time on a representative input. A function that looks simple in the editor can cross the network repeatedly because it fetches a single cell for each lookup.
Separate remote service limits from spreadsheet work. Fetching a page from an external order service and writing that page to Sheets consume different resources. Reducing sheet calls will not replenish an exhausted external API allowance. If the source paginates, preserve the request interval and page token so the next attempt can retrieve the intended slice.
Give an empty source page an explicit meaning. It may represent a quiet trading day, the end of pagination, or a failed fetch that a catch block converted to an empty array. Verify the service response and requested date range before treating it as a completed interval. Record a confirmed zero separately from an unresolved page that still needs retrieval.
Reduce calls with rectangular reads and batched writes
Follow Google’s performance guidance and read a bounded range into memory with getValues(). Build a lookup map from the required columns, transform rows in memory, and write one rectangular array with setValues(). Check that every row has the expected column count and skip the write cleanly when the input contains no records.
Choose the batch from measured execution time
Select enough rows to make each service call worthwhile while leaving time to verify the destination and save progress. Measure a batch that includes slow records, such as an order with many line items. Stop starting new batches when the time budget gets tight. A graceful stop leaves a clear resumption point.
Google’s quota table lists 20,000 URL Fetch calls per day for a consumer account and 100,000 for a Workspace account. Batching sheet updates does not combine those fetches. Where the upstream service supports a list request, fetch one page and index the records locally. Respect the source service’s separate limits and pagination rules.
Preserve a record of rejected rows with their source keys. If a single record contains a new currency code, shrinking the batch will eventually isolate it but cannot decide how to interpret it. Route that record for review, and make the job’s completion policy explicit about whether the report can be published with an unresolved exception.
Define a checkpoint that survives sorting and edits
A job checkpoint is a small durable record identifying the source slice and the last confirmed destination write. The Google Properties Service guide describes three property stores and string-based key-value storage. Script properties work for a shared job cursor. Include the job name, input version, and destination identifier in its scope.
A row number is reliable only while the input order remains fixed. If staff can sort or insert rows, freeze a working copy or use an ordered stable record key with a fixed cutoff. For a multi-line shipment export, the order ID alone may identify several different rows. Add the line reference when that is the grain of the output.
Preserve the report your team is using
Write rebuilt data to a staging tab, verify its period and count, and publish only after the job completes. Keep the prior completed period visible with a timestamp. A blank dashboard can prompt staff to investigate lost sales while the actual issue is an unfinished refresh.
Resume from the first unconfirmed write
Use Google Lock Service to coordinate competing runs of the same script. Acquire a script lock before reading a shared cursor and changing the destination. If another invocation holds it, leave that invocation responsible for the batch. Release the lock after pending sheet writes are flushed and progress has been recorded.
Recover when the write succeeded before the cursor advanced
There is a gap between a successful sheet write and a successful property update. Use a deterministic output range in a frozen snapshot or update rows by stable business keys. After a crash, compare the pending batch with the destination, write missing or corrected records, and advance the cursor only after confirming the expected result.
Consider an operations sheet listing delivery methods by market. A carrier label may change while its service identifier stays stable. Preserve that identifier and the store reference when updating rows. The Zid shipping methods guide provides context for the merchant settings represented by those records. A renamed label should not silently create a second delivery method.
Release the report after reconciling the batch
To close a Google Apps Script quota exceeded incident, compare source and destination counts for the fixed interval and inspect records on both sides of the resumption point. Check one empty result and one order spanning multiple rows. Keep a note of any excluded records so the report owner can explain the difference.
Publish the reporting period and last successful refresh beside the figures. An n8n reporting workflow can monitor stale results independently of the account that writes the sheet. For an automation review, bring the actual exception, account type, batch timing, and checkpoint format. Together they show whether the next change belongs in scheduling, data retrieval, or the write itself.
Is a script timeout the same as exhausting a daily quota?
An ordinary Apps Script execution has its own time limit. A triggered job also draws on a daily trigger runtime allowance, and individual services have separate quotas. Use the exception message, executing account, and elapsed time to identify the constraint before choosing a shorter batch or a later restart.
How does batching help a spreadsheet job?
Batching reduces the number of calls between Apps Script and the spreadsheet service. Read a range into an array, transform the rows in memory, and write a rectangular result in one operation. It will not replenish a depleted daily quota or change an external service’s own request limits.
Which row should the next run process?
Start with the first record whose destination write has not been confirmed. If the previous run may have written a batch before saving its cursor, reconcile that batch by stable record keys. Use a row number only when the input order and destination layout are fixed for the job.



