Query on "REST API and business rule running order"

BT10
Tera Expert

Hi Expert ,

Just wanted to know in following scenario - 

 

we have scripted API which insert data in "A", "B" , "C" tables.  it means all business rule which are running on  "A", "B" , "C" tables they will also run.

but scripted api need to wait for all business rule to complete before sending response back??

 

 

for ex. 

1.all business rules on table A take 1 mins to complete.

1.all business rules on table B take 2 mins to complete.

1.all business rules on table A take 3 mins to complete.

 

does it mean that scripted API need to wait minimum 6 mins before sending the response 

OR 

API will process normally and all business rule will get trigger but REST api will not wait for all to complete ??

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you would never know how much time all the BRs take on those 3 tables

So you cannot tell system to wait for x mins

What's your requirement?

Usually API calls are synchronous so 3rd party can send the data and the BRs can run in background but you can send immediate response as soon as 3rd party consumes the API

Regards
Ankur

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

Hi Ankur ,

i have assumed time (1 min, 2 mins, 3 mins) just to understand the flow of REST api VS business rule . 

Just wanted to know if API will wait for all business rule to finish or not.

 

 

 

Hi,

Nope

The API won't wait and the script would send the response once the scripted rest api script is completed.

Regards
Ankur

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

Any supporting document of servicenow on this statement?