REST message and long response times

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 01:34 PM
Hi all,
I have a case where I am calling the REST API of an orchestrating tool from a RITM workflow.
The tool might take around 10 to 20 minutes to process the request and send a response. Below is the code that I have which will be inside the 'run script' activity of the workflow.
var requestUpdateSet = new sn_ws.RESTMessageV2();
requestUpdateSet.setEndpoint(endpoint);
requestUpdateSet.setHttpMethod('GET');
requestUpdateSet.setRequestHeader("Accept", "application/json");
requestUpdateSet.setMIDServer('xyz');
//requestUpdateSet.setHttpTimeout(10000);
var obj = requestUpdateSet.execute();
Will the REST message code above wait for the whole 10 -20 minutes of the tool to send back the response or does it work asynchronously? So far i have seen that it works synchronously when the processing takes around 20-60 seconds but I have not dealt with the case yet when it takes 10 minutes or more.
Edit:
We already have the below property added to remove the default 30 seconds timeout limit
Thanks,
Ravish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 02:42 PM
Hi, you might find this HI article gives you the details\the answers you need
https://hi.service-now.com/kb_view.do?sysparm_article=KB0694711
From personal experience, timeouts of any significance are poor platform performance just waiting to happen; To compond the problem degraded performance from timeouts can be self perpetuating, and even small timeouts become bigger issues as a platforms get busier over time.
If I was seeing 10-20 minute response times from any integration, my first action would be to engage the project/management team responsible for the functionality and make it clear that the solution is a business risk and that this needs to be accepted or an alternative found.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 02:42 PM
Try using executeAsync() instead of execute().
FYR:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0716391