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

Danish Bhairag2
Tera Sage
Tera Sage

Thanks Danish, unfortunately increasing the REST Attachment API request timeout has not resolved the issue.

Amit Verma
Kilo Patron
Kilo Patron

Hi @jamesboding 

 

Refer below links and give this a try :

https://www.servicenow.com/community/developer-forum/rest-execution-time-exceeded-error/m-p/2435441#....

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0866547

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Thanks Amit, unfortunately increasing the REST Attachment API request timeout has not resolved the issue.