Parallel actions

With parallel control flow in Logic Apps, two or more actions are executed simultaneously without affecting the performance of any other actions. The advantage of parallel processing is you can route the same message across different branches of Logic Apps, thereby reducing the overall complexity of a workflow. To optimally utilize a parallel control flow, you can configure the runAfter property. This will ensure that the parallel branch can only be executed if the runAfter property is true or false in the Logic Apps run execution.

To add a parallel control flow in Logic Apps, you can either your either use Logic Apps designer or Logic Apps code view. Both will achieve the same result. In the following example, we have a Logic Apps instance with an HTTP request trigger. Based on the request trigger, we have a different set of actions, such as Get document from Cosmos DB, create or update the document in Cosmos DB, or use an HTTP action to post a message to the external API endpoint:

As you can see from the preceding example, creating or updating documents and triggering HTTP actions are in parallel, which means that once the Get user document action succeeds, other actions following the parent action will be executed in parallel.

Whenever possible, you should try to use parallel control flow actions with the asynchronous fire-and-forget pattern. This will help to remove tight coupling from the application and integration layers. Running parallel actions in an asynchronous manner will also improve overall application performance and remove any unnecessary and unwanted timeout exceptions

It's easy to implement a parallel control flow from Logic Apps code view. You just need to appropriately set the runAfter property with the parent action name. In the following code view example, we have an HTTP action with a parent action, Get_User_document. To add another action in the same level as the HTTP action, we only need to define the action definition and set the runAfter property to the Get_User_document action:

The runAfter property in a Logic Apps workflow is a string array with a value of either Succeeded, Failed, or Skipped. You can use a combination of runAfter properties or a single property to control the Logic Apps workflow. With the runAfter property, you can implement Logic Apps flows with greater control of exception conditions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.148.105