0

I understand that Azure standard Stateful Logic app workflow runs Asynchronously but can i use stateful standard logic app for the below scenario:

We want to receive Json data from the third party in a HTTP post request, then process it and store it in Azure data lake. But the problem is since Azure standard stateful workflow runs asynchronously as soon the http trigger is hit it returns Status 202 Accepted. I want to send the caller end status of the request. For example- I want to send 500 Internal server error when the request was valid but still the workflow failed due to an internal error. If the data was processed successfully i want to send the caller HTTP Status 200 Ok. I dont want to send always HTTP status 202 Accepted to the caller. I want the caller to know what exactly happened to their HTTP request. Is it possible through standard logic app? I dont want to use consumption Logic app because of security reasons.

1 Answers1

0

You can achieve this using runafter configuration by enabling this configuration it runs even after the whole workflow is getting failed.

Go to your work flow and select Menu for the action you want to run regardless if the previous one is about to fail, timeout, or skip. It's Condition in my case, and then 'Configure run after'.

For instance here is my logic app

enter image description here

enter image description here

Here is how my code view looks like :

enter image description here

OUTPUT:

enter image description here

UPDATED ANSWER

In that case, too you can use the same runafter concept with the condition having status code is not equal to 200 as a true statement and continue the flow

Here is the logic app enter image description here

enter image description here

Here is the output

enter image description here

enter image description here

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
  • Hi there, thanks so much for taking out time to explain this but my problem is little different. Since Stateful Logic App workflow is Asynchronous, as soon as HTTP trigger action is succeeded it sends back Status 202 Accepted to the caller without waiting for the complete workflow to finish. I want to send the actual outcome of the workflow. So if my workflow encountered any error i want to send 500 Internal server error. Please consider i am talking about Stateful workflow which work different to stateless and consumption workflow.Thanks – rohit gupta Jan 12 '22 at 19:36
  • @rohitgupta Can you please check the updated answer – SwethaKandikonda Jan 19 '22 at 09:19
  • Many Thanks for your help with this one. Your help is much appreciated :) – rohit gupta Mar 15 '22 at 11:19