As part of the October release, Microsoft released quite a lot of new features for Microsoft Flow (now part of Microsoft Power Automate) which makes development easier and faster for Users. One of those cool new features is the addition of ‘Run a Child Flow’, which means we can call a child Flow from various Flows. With this we no longer have to re-write the same logic across multiple Microsoft Flows. In this blog, I will go through the steps to call a child Flow from another Flow for creating a CDS record.
This child Flow is quite simple, all it does is a create a new CDS Account. The name of the account is passed by the parent Flow.
Create a new ‘Power Apps’ solution if you don’t already have one. Then create a new Flow in that solution. We will be creating the child Flow first.
Use ‘Power Apps’ as the trigger for the child Flow. Without using this trigger users wouldn’t be able to use the child Flow from the parent Flow (highlighted in Red above)
Then use CDS connection and create an ‘Account’ record, pass in the input parameters from the Power Apps trigger (highlighted in Green above).
Add ‘Respond to Power App or flow’ action. Without it, the users wouldn’t be able to call the child Flow from the parent Flow (highlighted in Blue above). This action will return the response back to the parent Flow
Once changes are made, save the Flow and now it is ready to be called by the parent Flow.
Just like child Flow, you need to create the parent Flow in the solution too.
To call the child Flow, simply search for the action ‘Run a child Flow’ and select that action.
Then select the child Flow from the ‘Child Flow’ drop down list, and then pass in the input parameters. In this case I will be passing the name of the account.
That’s all it takes to call a child Flow from Parent Flow.
I did a test run of the parent Flow and passed in the Account name. Then I ran the parent Flow which ran successfully.
Then I had a look at the run history of the child Flow which ran successfully.
The child Flow successfully created the ‘Sajas’ Account too.