{"id":110856,"date":"2017-06-23T09:30:49","date_gmt":"2017-06-23T16:30:49","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/"},"modified":"2017-06-23T09:30:49","modified_gmt":"2017-06-23T16:30:49","slug":"build-nested-flows","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/","title":{"rendered":"How to build nested flows with the HTTP action"},"content":{"rendered":"

Step 1: Modelling your workflows<\/h2>\n

In this walkthrough I would like to create a common approval process for files added in two different places. A flow’s trigger can only listen to one location at a time, so there’s no way to build a single flow that can listen to many different locations. Instead, I can use a nested workflow<\/em> that has all the approval logic, and call it from two different workflows — each of which listen to their respective location. To have one flow call another flow I will use the\u00a0HTTP<\/strong>\u00a0action.<\/p>\n

Here is a diagram showing the overall design:<\/p>\n

\"\"<\/p>\n

It’s important to know what information will be sent from the parent flows to the child flow. In this case, I just need the name and link to the files. This will be sent in a JSON object that looks like:<\/p>\n

{ \"name\" : \"MyFile.docx\", \"link\" : \"https:\/\/microsoft.sharepoint.com\/....MyFile.docx\" }<\/code><\/p>\n

Step 2: Create your nested \/ child workflow<\/h2>\n

Second, you’ll have to create the flow that runs inside the others. In order to have a flow that can be called by other flows, you will need to start with the\u00a0Request<\/strong>\u00a0trigger. This trigger exposes an HTTP endpoint that can be called to kick off the flow.<\/p>\n

In this trigger you should define the request payload. This payload is how the rest of the flow will know what fields it can use from the trigger. Select\u00a0Use sample payload to generate schema<\/strong>\u00a0and then paste in the JSON object from Step 1.<\/p>\n

\"\"<\/p>\n

Now you can construct the rest of the flow that you want to be shared. In this case, I’m going to build an Approval flow for the documents. When I fill out the approval actions, I can use the fields that were passed in from the trigger:<\/p>\n

\"\"<\/p>\n

Finally, Save your child flow and copy the\u00a0HTTP POST URL<\/strong>\u00a0from the request trigger (you’ll use this in the next step).<\/p>\n

Step 3: Call the child workflow from the parent flows<\/h2>\n

Third, you’ll need to build your parent workflows that call into the child workflow. Start with the trigger you need, just like any other flow. Then, add an\u00a0HTTP\u00a0<\/strong>action. Select the\u00a0POST<\/strong>\u00a0method and paste in the HTTP Post URL you copied from Step 2.\u00a0<\/p>\n

\"\"<\/p>\n

Last, you will need to include in the Body <\/strong>the JSON object that you defined in Step 1. Be sure to replace the placeholders with dynamic content from the trigger (as I did above with File name and File path). Now you can repeat this same process with the other Parent flow, calling the same HTTP endpoint.\u00a0<\/p>\n

Summary<\/h2>\n

In three steps you can build a single workflow that can be called by other workflows. Other scenarios for nested workflows include a flow that you want to run on a schedule AND based on some trigger (for example, generate a report when there is new data, and once a day), or, for handling nested loops. Since Microsoft Flow limits you to one apply to each loop at a time, you can call into a child workflow that has its own apply to each — if you need to process arrays inside of other arrays. I hope you found the walkthrough helpful, let us know what questions you have on the Flow Community<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

There are a few different scenarios where you want one flow to be able to call another flow. For example, you can have some set of steps or logic that you want to re-use across multiple flows. This blog post will walk you through how to set up nested workflows using the HTTP action. <\/p>\n","protected":false},"author":347,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2836],"power-automate-tag":[],"coauthors":[2913],"class_list":["post-110856","power-automate","type-power-automate","status-publish","hentry","power-automate-category-walkthroughs"],"yoast_head":"\nHow to build nested flows with the HTTP action - Microsoft Power Platform Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build nested flows with the HTTP action - Microsoft Power Platform Blog\" \/>\n<meta property=\"og:description\" content=\"There are a few different scenarios where you want one flow to be able to call another flow. For example, you can have some set of steps or logic that you want to re-use across multiple flows. This blog post will walk you through how to set up nested workflows using the HTTP action.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Power Platform Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 min read\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"Stephen Siciliano\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/\",\"name\":\"How to build nested flows with the HTTP action - Microsoft Power Platform Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.png\",\"datePublished\":\"2017-06-23T16:30:49+00:00\",\"dateModified\":\"2017-06-23T16:30:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.webp\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.webp\",\"width\":932,\"height\":658,\"caption\":\"diagram\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Power Automate\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to build nested flows with the HTTP action\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"name\":\"Microsoft Power Platform Blog\",\"description\":\"Innovate with Business Apps\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\",\"name\":\"Microsoft Power Platform Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"width\":194,\"height\":145,\"caption\":\"Microsoft Power Platform Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to build nested flows with the HTTP action - Microsoft Power Platform Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/","og_locale":"en_US","og_type":"article","og_title":"How to build nested flows with the HTTP action - Microsoft Power Platform Blog","og_description":"There are a few different scenarios where you want one flow to be able to call another flow. For example, you can have some set of steps or logic that you want to re-use across multiple flows. This blog post will walk you through how to set up nested workflows using the HTTP action.","og_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/","og_site_name":"Microsoft Power Platform Blog","og_image":[{"url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 min read","Written by":"Stephen Siciliano"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/","name":"How to build nested flows with the HTTP action - Microsoft Power Platform Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.png","datePublished":"2017-06-23T16:30:49+00:00","dateModified":"2017-06-23T16:30:49+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#primaryimage","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.webp","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/build-nested-flows-diagram.webp","width":932,"height":658,"caption":"diagram"},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/build-nested-flows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/"},{"@type":"ListItem","position":2,"name":"Power Automate","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/"},{"@type":"ListItem","position":3,"name":"How to build nested flows with the HTTP action"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","name":"Microsoft Power Platform Blog","description":"Innovate with Business Apps","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization","name":"Microsoft Power Platform Blog","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","width":194,"height":145,"caption":"Microsoft Power Platform Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/"}}]}},"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Power Platform Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/types\/power-automate"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/users\/347"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/comments?post=110856"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110856\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/media?parent=110856"}],"wp:term":[{"taxonomy":"power-automate-category","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-category?post=110856"},{"taxonomy":"power-automate-tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-tag?post=110856"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/coauthors?post=110856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}