Subject: Flow Error: Transaction Cancelled - Maximum Execution Time Exceeded After Bulk Record Updat

jamesboding
Tera Contributor

Hi ServiceNow Community,

 

I'm currently experiencing an issue with a flow that I’ve built to update a large number of hardware asset records using a REST API call to fetch warranty information. The flow works well, but after about 800 records are updated, I receive the following error: Internal Server Error

 

When I look at the execution and iterate through the records to the one that it cancelled on, I found the error: 

Error: Transaction cancelled: maximum execution time exceeded

 

Background:

  • I’m using a REST step within a flow action to call an external API and retrieve warranty information.
  • The flow successfully updates the warranty expiration dates on hardware asset records in the alm_hardware table using the serial number and warranty end date from the API response.
  • The flow completes successfully for smaller data sets, but when processing a larger volume (around 800+ records), it throws the "maximum execution time exceeded" error and the flow eventually cancels.

What I’ve Tried:

  • I've reviewed my scripts and API response handling. Everything works well in smaller batches, and warranty dates are updated correctly in the system.
  • I checked if the error is due to long-running scripts or flows, but I couldn't find the glide.script.timeout system property, which I’ve seen suggested for similar issues.
  • I'm wondering if there's a different sys_property related to REST or flow execution limits, or if there's a different approach to avoid hitting the execution timeout limit.

Key Questions:

  1. Is there a property I can adjust to extend the execution time for flows?
  2. Would breaking this flow into smaller batches or triggering it differently be a better solution?
  3. Has anyone else encountered similar "maximum execution time exceeded" errors in bulk record updates, and how did you resolve them?

Additional Info:

  • The flow runs with no issues for smaller record sets.
  • I’d appreciate any insight or guidance on how to troubleshoot and prevent the flow from timing out when processing larger volumes.

Thanks in advance for your help!

6 REPLIES 6

Gangadhar Ravi
Giga Sage
Giga Sage

Hi @jamesboding 

 

When you are dealing with large amount of data in REST API using flows you need to use Data Stream flow actions. please refer below docs.

 

https://docs.servicenow.com/bundle/washingtondc-integrate-applications/page/administer/integrationhu...

 

Please mark my answer correct and helpful if this works for you.

Dhanraj Poojari
Mega Guru

I have faced this issue with flows as well where internal workloads like gliderecord updates (nested ones) timeout due to flow specific quota rules.

Approach that worked for me is to offload such workloads to good old scheduled jobs or a business rule where there are higher execution time quota's (or non existent ones! ;-))