Which one execute first?

NK13
Tera Contributor

Which one execute first:

Before update Business Rule

>Wait for condition activity in workflow

What I found in web is "wait for condition" activity will evaluate every time when current record is updated. I think workflow activity will be evaluated after update is done in database(After Before  Update BR executed).

I have scenario implemented in prod in which after "wait for condition" activity it set assignment group to "P". And One Business rule (type: Before Update) which also set the assignment group to "L".

And final result in assignment group is "L". Can someone Help me understand on this?

I also used field watcher on Assignment group field, found below logs.

find_real_file.png

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

This should be helpful here

Execution order of scripts and engines | ServiceNow Docs

The Before BR would run first!!

-Anurag

-Anurag

View solution in original post

6 REPLIES 6

Boyan1
Kilo Sage

Hello, 

Can you please check this one

https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/service-administration/reference/execution-order-scripts-engines.html

 

Best regards,

Boyan

 

NK13
Tera Contributor

Thanks Boyan,

As I checked, the order of Before update bussiness rule is set to more then 1000. That is why it is executing after workflow activity and before data base operation.

Allen Andreas
Administrator
Administrator

Hello,

The before business rule would run first (assignment group to "L")...then you said after your wait for condition in the workflow the assignment group to set to "P"? Through another workflow activity?

Anyways, you said AFTER the wait for condition, the assignment group is set to "P"...through "something", which updates the record...but then you have that before business rule setting it to "L"...so final result is "L".

Without specifics on your before business rule (the settings)...I can't really help, but just tell you the chain of events.

So while they ran within the same second, milliseconds may matter and the before business rule would ultimately win as it's intercepting the next update and setting it back to "L". You'd need to adjust that before business rule to not always run or something. Again, your post is very vague and we don't have any details on the business rule settings, but there ya go.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello Allen,

Thank you for your assistance, Before BR rule order is more that 1000.