On after business rule vs Flows? which is preferred and why?

Suggy
Giga Sage

I have simple use cases which require to write On After business rules. One of my team mate says stop using on After Business rules, always use flows - but why? no answer from him 😉

 

So whats your feedback or experience of using On after business rule vs Flows? which is preferred and why?

 

 

 

1 ACCEPTED SOLUTION

Anand Kumar P
Giga Patron
Giga Patron

Hi @Suggy ,

ServiceNow recommends everyone to use flows over Business rules wherever possible dependent on the use case (due to their advantageous nature), flows created using flow designer are easy to manage and maintain and can be a great asset in controlling technical depth.

 

You should use Flow Designer instead of Business Rules when:

  • The business logic only calls a script includes.
  • There is a need to execute the business logic, immediately before or after writing to the database in the context of the same thread.
  • The is a requirement for the business logic to run in a specific order with other business rules.

 

Flow Designer will run in the background, similar to scheduled jobs and asynchronous business rules. There will always be a delay between the actual trigger and the start of the flow. So it's not a replacement for before or after business rules, but for use cases that you would previously have solved with an asynchronous business rule, I'd consider using the flow designer.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

View solution in original post

3 REPLIES 3

Ashish Parab
Mega Sage

Hi @Suggy ,

 

It depends on the complexity of the task, flexibility, and the skillset of the individuals involved. For simple logic enforcement, Business Rules are effective, while Flow Designer is good to deal with complex workflow.

 

 

  • If your use case is simple (like updating fields on a record) and performance is critical, stick with Business Rules.
  • If your use case involves complex workflows, cross-record actions, or integration with external systems, or if maintainability and ease of use are prioritized, use Flow designer.

 

Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.

 

Thanks and Regards,

Ashish

 

Animesh Das2
Mega Sage

Hi @Suggy ,

 

I don't know any reason why he asked you to use Flow only instead of after BR Always. BR and Flow can do same things but in most of the cases they have separate use cases as well. I can think of some use case examples as below,

1. Flow is suitable where you can do series of actions/activities with more low code approach where as in BR you mostly need to write scripts if you need to execute multiple actions/activities. then Flow is better to use.

2. On the other hand if you don't have any series of action to perform and no need to write any complex script in BR then definitely go for BR instead of Flow.

3. If you need to do some activity after any insert/update (not immediately) then you can use Async BR as well.

4. From troubleshooting perspective, it is bit easier to troubleshoot a flow using flow execution whereas for BR you need to look for logs which little more troublesome.

 

If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das

Anand Kumar P
Giga Patron
Giga Patron

Hi @Suggy ,

ServiceNow recommends everyone to use flows over Business rules wherever possible dependent on the use case (due to their advantageous nature), flows created using flow designer are easy to manage and maintain and can be a great asset in controlling technical depth.

 

You should use Flow Designer instead of Business Rules when:

  • The business logic only calls a script includes.
  • There is a need to execute the business logic, immediately before or after writing to the database in the context of the same thread.
  • The is a requirement for the business logic to run in a specific order with other business rules.

 

Flow Designer will run in the background, similar to scheduled jobs and asynchronous business rules. There will always be a delay between the actual trigger and the start of the flow. So it's not a replacement for before or after business rules, but for use cases that you would previously have solved with an asynchronous business rule, I'd consider using the flow designer.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand