Is there a way to tell if stages are present in a flow?

TEdwards
Mega Sage

Hello all,

 

I need to create an instance scan check that checks to see if a flow contains stages. I have done something similar to check for hard coded assignment groups in flows by querying the sys_hub_action_instance_v2 table. I know there is a sys_hub_flow_stage table that contains the stages for each flow, but that will only indicate that there were stages created for the flow, not whether they are actually present in the flow. Any assistance would be appreciated.

1 ACCEPTED SOLUTION

jonsan09
Giga Sage
Giga Sage

After doing some testing, it looks like the "Component indexes" field on 'sys_hub_flow_stage' might be the key. I setup two flows and loaded the stage templates for Request Items on both. One had flow had the stages actually added to the actions, while the other didn't. It looks like the "Component indexes' field gets updated with a value if the stage is present on an action in the flow. 
Screenshot 2025-12-05 135953.png

View solution in original post

2 REPLIES 2

jonsan09
Giga Sage
Giga Sage

After doing some testing, it looks like the "Component indexes" field on 'sys_hub_flow_stage' might be the key. I setup two flows and loaded the stage templates for Request Items on both. One had flow had the stages actually added to the actions, while the other didn't. It looks like the "Component indexes' field gets updated with a value if the stage is present on an action in the flow. 
Screenshot 2025-12-05 135953.png

Great find! Yes, it appears you are correct. I can definitely work with that. Thank you for your help!