REST Message methods trigger with a buffer time

Kaustubh k
Tera Contributor

Hello All,

 

Thanks for looking into my query.

 

We have created a REST Message which has 2 POST and 1 GET method in it.

we are triggering these methods from flow designer using a custom action.

 

GET method is only to check the status of the Request as asked from the previous APIs.

 

in our script we need to have a BUFFER TIME of 2 minutes before we trigger last method(GET Method)

please help how we can do the same.

 

we are triggering the APIs  

var r = new sn_ws.RESTMessageV2('REST MESSAGE', '1POST');
<content>
var response = r.execute();
 
var r = new sn_ws.RESTMessageV2('REST MESSAGE', '2POST');
<content>
var response = r.execute();
 
for the last method GET we need to have a buffer time of 2 mins , how we can achieve this and then trigger
var r = new sn_ws.RESTMessageV2('REST MESSAGE', 'GET');
 
Any help on the same will be highly appreciable.
 
Thanks

 

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

Hi,

You can call "wait for duration" flow logic, set duration type as Explicit and wait for 2 minutes. Add your last get message call after this "wait for duration" activity.

Thank you,
Palani

View solution in original post

2 REPLIES 2

palanikumar
Mega Sage

Hi,

You can call "wait for duration" flow logic, set duration type as Explicit and wait for 2 minutes. Add your last get message call after this "wait for duration" activity.

Thank you,
Palani

thomaskennedy
Tera Guru

You could set up (that is, create) a scheduled script execution for each request:

 

Run:Once
Starting:120 seconds from now
Run this script:Check the status of request X

 

Set that up after the second POST. I would recommend whacking the old SSEs nightly so they do not pile up.

 

If you have some flexibility on the timing you could instead have a single SSE running every two minutes to check all  requests >= 2 mins old and not already checked.