Introduction
Power Automate is a wonderful tool for modern and end-users, but it can quickly become huge and we end up writing a similar piece of code at multiple places, though copy to clipboard is a quick savior, if there is a change in a single place, for it to propagate to multiple places is a time-consuming thing. The best bet to us in these cases would be child flows.
Prerequisite
The child workflows are currently available as part of solutions. The solutions are accessible through the left navigation in the Power automate center.
Solutions
The solution is a logical container/group of Power Apps, Automates, tables, parameters, and connections. These help to ease the application life cycle maintenance of the Power Platform.
The solution can be:
Child Flow
The child flow is like any other flow except that you chose to invoke another flow manually. The child flow helps us to create a reusable flow that can be invoked from multiple places and also help to break the large flows which eases the maintainability.
Steps to Create a child Flow
Navigate to any solution use the New -> Cloud Flow -> Choose Instant
Ensure that the trigger is ‘Manually trigger a flow’
Artifacts of Flow
Every flow can have the following components
- Input Parameters
- Processing Body
- Output
Artifact |
Purpose |
Mandatory |
Count |
Input Parameters |
Defines the initial values for the flow to run with |
No |
Zero or more |
Processing Body/Actions |
The actual actions that define the flow |
NA |
One or more |
Output Values |
Defines the response that needs to be sent to the parent flow, though saving current flow does not mandate it, Invocation of the child flow from parent flow mandates it |
Yes |
One or more |
Input Parameter
As the name says it helps to pass any parameters of the specific types can be passed. Below are the types of input parameters. The parameters can be
- Text
- Boolean
- File
- Email
- Number
- Date
Navigate to the flow, click on ‘Add an input’
Output Parameter
For the flow to be used in another flow It needs to send a definitive response and is actually invoked using the below action
The output of the flow also should define its type and follows the same types of input parameters have.
Invoking the flow from another flow
Use the action Run a child flow and you could choose from the list of flows available
Common Issues
The below error would trigger if the child flow or sub-flow does not return a response, navigate to the child flow and return at least one parameter as shown in the outputs section
Run a Child Flow action is missing: Check if your power automate is not part of the solution, if yes, please move it
Citations
- Solutions: https://docs.microsoft.com/en-us/power-automate/overview-solution-flows
- Flow Issues: https://docs.microsoft.com/en-us/power-automate/triggers-troubleshoot
Conclusion
This article helps us to understand how to create reusable actions with the help of child flows.