Performance concerns with a flow triggered on cmdb_rel_ci?

Johnathan R
Tera Contributor

I am building a flow that is triggered on cmdb_rel_ci, with the following trigger

 

JohnathanR_0-1701439979752.png


Are there any performance concerns with running a flow like this on this table? I know discovery will be making many changes to relationships - would this trigger constantly being checked against be a bad idea? Should it be more of a scheduled job?

3 REPLIES 3

OlaN
Giga Sage
Giga Sage

Hi,

I would say it depends on what your Flow is going to do.

Technically a Flow consumes more resources than a script does, but it might still be the better option in some cases.

Can you dive into what the Flow is going to do?

Johnathan R
Tera Contributor

It simply updates a criticality value on the associated app service(s). It's a very light flow.

 

My thinking is more around does a flow need to be 'evaluated' when any change is made to a CI relationship, and will that cause performance issues in of itself - even if the flow itself is not triggered?

If discovery makes 20,000 relationship updates - does it not need to check each time 'do I need to run this flow? no I dont' 

Well, since Flows runs async, it's by design to run when resources are available, but you can risk building a long queue of flow that waits to be run.

Perhaps a more efficient way is to run this update of criticality on a schedule, like daily, after the processing of the Discovery is completed.

Another option is to set the flow trigger to only run if it's currently not running, that way you won't trigger two conflicting flows trying to calculate the same record at once.

 

One last thing to consider, does the Discovery run with business rules/workflows triggers enabled?

If it runs where the behavior is similar to a script running: ".setWorkFlow(false)" then no Flows (or business rules) will be triggered.