How to use waitfor response method in servicenow rest call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 12:13 AM - edited 07-21-2025 12:13 AM
I am seeing default servicenow http time out is 30 seconds can we increase based on integration?
WaitforResponse() can be used in both synchronous and asynchronous calls? is it can be used without turning off the property glide.http.outbound.max_timeout??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 01:47 AM
hi @Manikantahere ,
Yes, you can increase the timeout.
If 'glide.http.outbound.max_timeout.enabled' is set to true, the timeout is capped at the property value (default 30s).
- To set a timeout longer than 30s (for specific integrations), you must set glide.http.outbound.max_timeout.enabled to false. Then, use waitForResponse(milliseconds) in your script to specify a longer timeout.
waitForResponse() is designed for asynchronous outbound REST/SOAP calls issued via executeAsync(), not for synchronous calls. After making an asynchronous call, you can call waitForResponse(timeout) on the response object to block the script and wait for the outcome, up to the timeout you define (in milliseconds). For synchronous REST/SOAP calls (using .execute()), the timeout behavior is determined strictly by the system property, and waitForResponse() is not applicable.
¹If glide.http.outbound.max_timeout.enabled is set to false and you don't specify waitForResponse(), the system will use a default of 5 minutes for async calls.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct' Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 02:09 AM
- I am seeing default servicenow http time out is 30 seconds can we increase based on integration? - YES
- WaitforResponse() can be used in both synchronous and asynchronous calls? - NO
- can be used without turning off the property glide.http.outbound.max_timeout?? - NO
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 03:14 AM
May I know how to increase timeout as per integration with out effecting other integrations within the sync rest call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 02:12 AM
for sync it's strict -> 30 seconds and cannot exceed regardless of you use waitForResponse()
for async you can call waitForResponse() after executeAsync()
If glide.http.outbound.max_timeout.enabled is false, the timeout you supply to waitForResponse() will be honored (up to 5 minutes by default, or longer if properties are adjusted). If this property is true, the smallest value between the waitForResponse() argument and glide.http.outbound.max_timeout will be used
Workaround:
To set a longer timeout in integrations
-> turn glide.http.outbound.max_timeout.enabled to false
-> use asynchronous execution with waitForResponse() in your script.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader