How to Call a Child Flow in Parent Flow in Azure Logic Apps

Imagine you are managing an e-commerce platform, and a payment gateway integration is critical for processing customer orders. However, due to intermittent network issues, the payment API occasionally fails. To address this, you implement a robust mechanism using Azure Logic Apps. 

High level resolution steps 

We create a Parent Flow and Child flow in Azure logic apps and we call all the child flows that have payment integration into Parent Flow and notify users about the failure via an email. 

Detailed resolution steps 

Step1: Create a Parent flow 

    • Add a recurrence as a trigger for every 15 seconds to run the flow. 
    • Next add a try scope and include the HTTP connection to call the payment gateway 1(this is optional) 
    • Now when gateway 1 fails, it must re-route by calling the child flow by using an inbuilt action called “invoke a workflow in this workflow app” and select the child flow you want to call. 
    • Now inside the catch scope, even if child flow fails, then an email notification will be called out as shown below: 

    Step:2: Create a child flow to get another HTTP request to a payment gateway: 

    Here, I am just triggering the flow via “When a HTTP request is received” and then the Payment gateway gets called in child flow and a response action is used to send request or response message whether the HTTP action gets succeeded or failed. 

    Output 

    First Parent flow will run to fetch the HTTP request, in case it fails 

    It will call the child flow to check if it succeeds, if not a failure notification will be sent to the user or IT team.