Microsoft Flow, also known as Power Automate, allows you to create and automate tasks via numerous applications and services swiftly and easily. In MS Flow, these automated workflows are referred to as ‘Flows’ and it intuitively integrates a variety of Microsoft services and apps (Dynamics 365, Office 365, Power BI etc.).
Flow Building Blocks
When building Flows one of the approaches to simplify their structure, help troubleshooting and create re-usable modules is to make the Flows call other Flows. Natively, Microsoft Flows does not have a way for a Flow to call another Flow. However, Flows can be triggered on an HTTP request and they can also make HTTP calls, hence they can call each other by combining an HTTP request receive trigger and an HTTP request action.
We are building some Flows to help around our organizational structure. Create a new Flow, search for HTTP triggers to add, and there will be a one called “When an HTTP request is received”:
We create the HTTP trigger (1), which has the option of being a POST or a GET method (2). In this case, we are using the GET method as we want this to be as universally available outside of Flow, even for systems which are not able to submit a POST call. Once this call is received this child Flow carries on with some other actions (3).
In another Flow which will be the parent, we want to invoke this child Flow. This parent Flow we will use for fetching all user details from Office 365, including their direct reports information which will be provided by the other Flow we just created.
- Add an HTTP request action which will make a GET method call to our other Flow (1).
- Use the URI provided by the trigger in the other Flow and move the attributes to the queries section (2), include also the “manager” attribute to search for.
Calling Parent Flow
If we now test by calling the URI of the parent Flow, and passing it a manager attribute we can see the combined results in a single JSON:
- The manager section provided by the parent Flow (1)
- The direct reports appended to the manager from the child Flow (2)
We now have the option of calling for a combined action to return manager details and the direct reports, or reuse the child Flow in other operations when we just want the direct reports.
Stay tuned for more MS Flow content. People are always looking for the most intuitive way to increase automation for their workflows. Mastering MS Flow helps you achieve this, in addition to improving development efficiency.