Logic Apps: Async processing pattern

Posted: April 26, 2021  |  Categories: Automation Azure Logic Apps

Sometimes we have the need to perform a kind of “fire and forget” pattern in Logic Apps. Todays post is a short one, but very useful one.

Usually, a Logic App will have a synchronous pattern, meaning you call it and you will have to wait for it to finish processing.

But how do we configure our LA to receive a request and continue processing without us having to wait for it?

It’s quite simple actually, although not a very pretty thing to do.

The way to achieve this is to set a Response action right after the trigger action and in the settings, set the “Asynchronous Response” to true. It’s not pretty as I’ve said, but it will set the path for the async pattern we’re looking for.

There should be a flag that you could set in the Trigger to automate this and send back a response like this, but so far, this feature is not available yet.

The response will be sent to the calling system, whatever it is, with the status code 202 Accepted.

You can also set custom headers and a body, but it might not help much.

As you can see, the Response will automatically set a location header for you to “ping” to check the status. By default, the engine will refresh every 20 seconds.

So that’s all there is to it, it’s a simple way to achieve an asynchronous pattern with Logic Apps, although not very pretty, but it works!

Happy coding!

#1 Azure Monitoring Platform
Author: Pedro Almeida

Pedro Almeida is a Senior Integration Developer at Devscope, working with Logic Apps, BizTalk, and other related products. Although he started his career as a Dynamics CRM Consultant, Integrations quickly caught his eyes and has made it his primary area of interest and work. Since then, Pedro has worked with customers from very different areas, from Retail to Banking to Governmental Services and others. You can contact Pedro at pedro.miguel_almeida@outlook.com(Twitter: @ItsNotRcktScnce)

6 thoughts on “Logic Apps: Async processing pattern”

  1. “There should be a flag that you could set in the Trigger to automate this and send back a response like this, but so far, this feature is not available yet.”

    The point at which you want respond that the request is accepted might not be straight after the trigger (JSON payload validation for example)

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top