Back to Selected Work
Health/Insurance ServicesRescue & extensionUSD 20M+/yr through ERPSince 2022, ongoing

SuiteScript Performance Rescue + Event Layer

The heaviest SuiteScript reports were hitting governance limits, and finance and HR still worked from batch data that was hours old

1

The Problem

Governance Limits and Batch Data, on a System Already Live

This health and insurance services provider ran project and claims work through NetSuite, with over USD 20 million a year flowing through it. Two problems compounded each other. The heaviest SuiteScript reports were slow enough to bump into NetSuite's governance limits, and the finance and HR systems that depended on this data were still working from scheduled batch pulls rather than anything live.

Original Workflow

  • 1. Project and claims records update throughout the day inside NetSuite
  • 2. Heavy SuiteScript reports run against this data and hit governance limits, slowing to 15 seconds or more per execution
  • 3. Finance and HR systems pull a bulk batch on a fixed schedule rather than reading current data
  • 4. Downstream teams work from numbers that are hours old by the time they see them
  • 5. When a script times out against governance limits, it fails without a clear alert to anyone
  • 6. Every new downstream system means another custom point-to-point script inside NetSuite
2

Our Approach

Fix the Scripts First, Then Make the Data Move in Real Time

Before extending anything, each script needed careful consideration to stay within governance limits. That starts with the right script type for the job (a batch process belongs in Map/Reduce, not a Suitelet), then removing the inefficiencies: redundant record loads, uncached data, and repeated searches. Once that was stable, we deployed our toolkit to give the NetSuite account webhook capability, so finance and HR stopped waiting on the batch schedule.

Caveats & Considerations

  • Rewriting a script to run faster does not remove NetSuite's governance limit itself; it reduces how much of the limit each execution consumes
  • Up to 60x (15 seconds to 0.25 seconds) improvement on the heaviest script
  • Our NetSuite toolkit adds capabilities and improves integration stability and development speed
  • The 20-minute bulk pull stayed in place as a fallback rather than being switched off on day one
3

The Solution

SuiteScript Rewrites, Then the Same Event Layer

We profiled and rewrote the heaviest reports to use N/record, N/search, and N/query deliberately instead of looping through records and unoptimised saved searches. On top of that, our NetSuite toolkit adds event capture and emission, and event subscription management, so this account also got real-time delivery instead of scheduled batches.

SuiteScript 2.x scripts profiled and rewritten for N/record, N/search, and N/query governance usage instead of loops over records
Event capture layer (User Event, Scheduled, Map/Reduce) added on top, capturing record changes beyond the ones with native events
Event subscription endpoint for real-time data integrations
Optimised webhook with backoff strategy
4

Results

Faster Scripts, Then Real-Time Data

Heaviest SuiteScript execution time
15 seconds0.25 seconds (best case, one script)
Data freshness to downstream systems
Hours (batch sync)Seconds (real-time webhook)
New integration setup time
Days to weeksHours (subscribe via API)
Downstream systems connected
1-25+, and growing
Daily ERP operations via API
Manual or batch-driven4,500 a day, automated
Bulk polling pull
Every 20 minutes, ~10MB/pullKept only as a fallback

Related Reading

Have a Similar Challenge?

Let's discuss how we can build something similar for your business.

Book The Blueprint