Script Include Process Time

ChezAndrewI0898
Tera Contributor

I have a script include which utilizes Rest Message.

 

Sometimes it stops running at the middle of execution without an error.

 

Is there a maximum process time or maximum json reponse limit ServiceNow can handle?

 

Thank you.

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@ChezAndrewI0898 

may be the response is huge or the time it takes to get response is huge

what's your debugging and findings?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

kalanidhikr
Tera Expert

Hello @ChezAndrewI0898 

The issue occurs because ServiceNow enforces a 30‑second max timeout for outbound REST calls when the property glide.http.outbound.max_timeout.enabled is true.
To allow longer REST processing, ServiceNow recommends:

  1. Set glide.http.outbound.max_timeout.enabled = false
  2. Then use waitForResponse() to specify a higher timeout for that specific REST call.

    For Additional information please check these links
    Solved: How to increase the timeout for a REST response? (... - ServiceNow Community

    How to configure default response timeout for outbound async REST and SOAP messages - Support and Tr...

    If my response helped mark as helpful and accept the solution

yashkamde
Tera Guru

Hello @ChezAndrewI0898 ,

 

Try using executeAsync() instead of execute().

You may refer this :

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

 

If my response helped mark as helpful and accept the solution.

SohamTipnis
Tera Guru

Hi @ChezAndrewI0898,

 

Yes, ServiceNow does enforce execution and timeout limits for outbound REST calls, and what you’re seeing is usually related to one of those rather than a strict JSON size limit.

 

Or there is no single documented “maximum JSON response size” for RESTMessageV2, but very large responses can indirectly cause the following:

 

i. Timeouts

ii. Memory pressure

iii. Slow parsing

iv. Transaction cancellation

 

If you find my answer useful, please mark it as Helpful and Correct ‌😊


Regards,
Soham Tipnis
ServiceNow Developer ||  Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10