Use Case
As a Power Platform admin, you want to count the number of actions in a flow to evaluate the complexity of the flows. The goal is to provide targeted advice to makers, e.g. by using child flows, and to optimize the quality of the flows.
Benefits of the Analysis
Maker Consulting : Identify complex flows and offer support, e.g. by using child flows.
Quality metrics : Use the number of actions as an indicator of the complexity and quality of the flows.
Step-by-step instructions using a concrete example
1. Initialize variable
Start with the action “Initialize Variable” .
Name: vArrayOfFlows
Type: Array
Purpose: In this variable we will later store the display names of the flows and the number of actions per flow.

2. Retrieve flows
Use the “List Flows as Admin (V2)” action to get the flows of a specific environment.
Limitation: Set $top to 20 to retrieve only the first 20 flows (customizable as needed).

3. Create loop: Get details about each flow
Add an “Apply to each” loop that iterates over the list of flows.
Inside the loop: Use the Get Flow action to get details about each flow.

4. Calculate the number of actions
Inside the loop:
Add the “Append to array variable” action to store the results in the vArrayOfFlows variable.
Flow display name: outputs('Get_Flow')?['body/properties/displayName'])
Number of actions per flow: length(outputs('Get_Flow')?['body/properties/definitionSummary/actions'])
{
"DisplayName": @{outputs('Get_Flow')?['body/properties/displayName']},
"NumberOfActions": @{length(outputs('Get_Flow')?['body/properties/definitionSummary/actions'])}
}

5. Visualize results
Use the “Create HTML Table” action to display the results in table form.
Input: vArrayOfFlows
Output: A readable table with columns “DisplayName” and “NumberOfActions”.

Result

Conclusion
This approach allows you to quickly and efficiently assess the complexity of your flows. This enables you to support makers, optimize processes and monitor the performance of your environment.
I hope this post was helpful – have fun trying it out!
Comments