none
API App times out after 1 minute in Logic Apps RRS feed

  • Question

  • Hi,

    My API app is timing out after 1 minute when ran in a Logic app. Is there a way to set timeout? better yet, any async model would be nice here.

    thanks,

    Paul

    Monday, April 6, 2015 10:55 PM

Answers

  • The way that you would handle this is to have your API return back an Async operation.

    So instead of having to return a 200 within 60 seconds, it can return back a 202 and a retry-after header and location header that the Logic App will poll at that defined interval until a 200 was returned. There is a very long timeout (based on your SKU) for such async operations.

    Monday, May 4, 2015 3:18 AM
    Moderator

All replies

  • The way that you would handle this is to have your API return back an Async operation.

    So instead of having to return a 200 within 60 seconds, it can return back a 202 and a retry-after header and location header that the Logic App will poll at that defined interval until a 200 was returned. There is a very long timeout (based on your SKU) for such async operations.

    Monday, May 4, 2015 3:18 AM
    Moderator
  • I have a custom API app with async endpoints per your suggestion, but I am still getting a timeout after 1 minute.
    Monday, May 18, 2015 3:22 PM
  • The call itself still must return before 1 minute is up. So you return back 202 (almost immediately, ideally), and then the engine will poll on the Location header until the data is ready. Just marking your method as "async" will not accomplish this, you actually need to move the sync logic outside of that function or it will still block for >1 minute.  

    Tuesday, May 26, 2015 9:08 PM
    Moderator
  • Do I have to provide the retry-after and location headers or is that already handled? If the former, what is the schema for it? Thanks
    Tuesday, May 26, 2015 10:26 PM
  • Yes, you do need to provide the location header. The retry-after header is optional, and the engine will keep polling the on the location header every 20 seconds by default.

    These values do not go in the schema, it is the initial response from your API App that should return them. If the logic apps engine sees a 202 response with a location header, it knows what it should keep polling on the location until the operation is completed.

    Wednesday, May 27, 2015 10:51 PM
  • I am new to API and Logic App and I am having the same problem with logic App timeout. I can't simply put into action your statement sir Szymon W, can you show me a sample code on how could this be done from the action controller including those location header and 202 response? thanks!

    Tuesday, June 23, 2015 4:09 AM