简体   繁体   中英

Azure logic apps to return multiple response

I am trying to create a azure logic app. This logic app should return first response with status code 202 accepted, send it back with a id and then process remaining workflow and then return 200 status code with final response. I am new to logic apps. Can this be achieved in azure logic apps, Please guide. Thanks.

That's how usually a logic app works. There is nothing like the whole logic app returning with an ID but it is the connector in the Logic app that returns the values and the flow is continued within the logic app.

The whole Logic App is a workflow which is a collection of connectors that works according to our requirement

For more information, you can refer to it from Azure Logic Apps documentation | Microsoft Docs and Introduction to Azure Logic Apps - Learn | Microsoft Docs .

As I understand, your Logic App has a " When a HTTP request is received " trigger.

If you add a " Response " action and trigger the Logic App, it will run synchronously and return what you call the "final response" to the caller.

If you enable the Asynchronous Response setting in your "Response" action and trigger the Logic App again, it will work as you expect it to:

  • when the Logic App is triggered it will return 202 immediately, and the Location header of the response will contain a URL.
  • when you send a GET request to the URL from the response's Location header, it will return either 202 (and the response body will show that the Logic App is still running) or 200 (if that's the status code you selected in your "Response" action) with the final response, as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM