Trigger Child Flows

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

Parent and Child flows must be contained in the same solution

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

To start with we will create the Child Flow, on the manual trigger we will pass a few parameters that we will get from the parent 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

Once the child flow has been created we then need to allow permissions to any connections used inside the child flow. You can see and change connections by clicking the 3 dots on any of the actions and selecting or changing this under Connection References:
 

If we now save the flow and go back, on the right hand side there will be an option for ‘Run only users’

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

Like this post? Why not share it!

LinkedIn
WhatsApp
Facebook
Reddit
X
Email

View more blog posts

Dataverse Lookup In Power Automate

2 min read

Read this blog

Using ChatGPT in Power Automate

3 min read

Read this blog

Setting Dataverse LookUp Value to Null Using Power Automate

1 min read

Read this blog

Creating Relationships In Dataverse

2 min read

Read this blog

Get In Touch

Let’s talk. Send us a message, and we’ll help you explore the best Power Platform solution for your business

We can turn your mondain tasks into effective workflows, saving you and your business time and money