Developer ToolsFree referencePDF, Excel, Word exportNetSuite

NetSuite SuiteScript Governance Units by Script Type

Governance units cap how much work a SuiteScript can do in one run. When a script goes over, NetSuite stops it with a usage limit error. This reference gives the limit by script type and the design habits that keep real integrations inside it.

Download:
Script typeUnits per executionRuns onDesign guidance
Client script
1,000
Browser, per entry point
Keep light, call a Suitelet or RESTlet for heavy work
User event script
1,000
Server, per event
Avoid loading other records, use search lookups
Suitelet
1,000
Server, per request
Hand off long jobs to a scheduled or map/reduce script
RESTlet
5,000
Server, per request
Keep requests small, page large reads
Scheduled script
10,000
Server, queued or timed
Reschedule yourself or move to map/reduce when you near the limit
Map/reduce: getInputData
10,000
Server, one call
Return a search or query, not loaded records
Map/reduce: map
1,000
Server, per key
One small unit of work per key
Map/reduce: reduce
5,000
Server, per key
Group related work by key
Map/reduce: summarize
10,000
Server, one call
Report errors and totals, avoid heavy processing
Mass update script
1,000
Server, per record
Use for bulk edits chosen by a saved search
Workflow action script
1,000
Server, per action
Keep actions single purpose
Portlet script
1,000
Server, per render
Cache results and avoid large searches
Bundle installation script
10,000
Server, install or update
Use for setup tasks in a SuiteApp

Limits are the commonly documented defaults per execution or per invocation of the entry point. Operation costs, such as loading a record, differ by record type and change between releases, so read the governance table in the NetSuite help for your version before sizing a script.

Scripts hitting governance limits?

Ask for a short architecture review of the heaviest scripts in your account.

Optional. The tool and every export work without this. No spam.

How to use the table

Find your script type and compare the limit to what the script does. A RESTlet at 5,000 units that loads thirty transactions may be fine, while a user event at 1,000 units that does the same will fail on busy days. Use the guidance column to choose a safer pattern, usually a search instead of record loads or a hand-off to a map/reduce script.

What consumes units

Units are charged per API call, and record operations are the expensive ones. Loading or saving a transaction costs much more than reading a field, and running a search costs per call or per page. Because costs depend on record type and release, measure with runtime.getCurrentScript().getRemainingUsage() while testing, and log it at key points.

  • Prefer search.lookupFields for one or two values
  • Avoid record.load inside loops
  • Use submitFields for single field updates instead of load and save
  • Log remaining usage during sandbox testing

Choosing the right script type

Map/reduce is designed for volume. It splits work into stages and keys so the platform manages governance and parallel processing for you. Scheduled scripts suit sequential jobs with a clear order. Event driven scripts, such as user events and client scripts, should stay small because they run while a user waits or while a record saves.

Common mistakes

The usual causes of usage limit errors are loops that load records one by one, searches that return everything and then process it in the same run, and user events that call other records on every save. Failures often appear only in production because test data sets are small.

Frequently Asked Questions

What happens when a script exceeds its governance limit?

NetSuite throws a usage limit exceeded error and stops the script. Work done before the error may or may not be committed depending on the script type, so design for restart and avoid half finished updates.

Do governance units apply to SuiteQL?

Yes. Query calls consume units, and large result sets add cost per page. Page through results and select only the columns you need to keep usage predictable.

How do I check remaining units?

Call runtime.getCurrentScript().getRemainingUsage() in SuiteScript 2.x and log the value at key points. Use it to decide when to yield, reschedule or stop cleanly.

Are these numbers guaranteed?

They are the documented defaults at the time of writing. NetSuite can change limits and costs between releases, so confirm against the help for your version before you design around an exact number.

If a custom script keeps hitting limits, we can review the design and suggest a simpler pattern or an off-platform approach for the heavy work.