Introduction
There may be times where there is a need to use a child flow. Child flows can be used for a number of scenarios:- Organisation of Automations
- Team collaboration
- Prevent duplicated Power Automate flows
- Run a flow from service account
- Error isolation
In this post we will show you how to create and run a child flow
For this example we are going to create a file inside a folder using a Child flow. Imagine the user that runs the flow doesn’t have read/ edit permissions to a specific SharePoint document library or folder, we can use the Child Flow to use a service account to create that file or folder.To use a Child flow few things need setting within the flow:
- Parent Flow (To run the child flow)
- Child flow with Manual Trigger
- Run As Permissions (For Each Connection)
- ‘Respond to power app or flow’ in the child flow
Creating a Child Flow
We will then add our actions and use the parameters we have set as dynamic content:
Finally we will use the ‘Respond to a Power App or Flow’ action
We are not passing any information back to the parent flow, however if wanted we could pass data back into the flow, for example if the child flow was getting data from a database that where the user that triggers the parent flow doesn’t have permissions
Run As Permissions
Instead of using ‘Provided by run-only’ user we then need to select one of the connections provided that has access to the connection
Creating The Parent Flow
For the parent flow we will trigger as an automated flow when a file is created inside a OneDrive folder.
To run the child flow we need to select as the action ‘Run a Child Flow’ and select the flow we created previously from the drop down.
As we added some parameters to the Child Flow, the child flow action will now expect some parameters to be passed into the child flow:
If we now test this we should see a successfully run for the parent:
If we go to the child Flow we can also see that the child run ran successfully:
We can now call this Child Flow again from a different flow inside the same solution