How to Resolve HTTP 504 Gateway Timeout Error Due to Workflow Execution Timeout?

Javier GL 0 Reputation points
2024-09-05T23:37:09.1766667+00:00

Hi,

Can someone help me with an issue I'm facing? I created an Azure Logic App to process a workflow, where I receive a JSON array containing 2000 objects. I need to process each object and store it in a database, but I'm encountering the following error:

"The execution of template action 'Response' is failed: the client application timed out waiting for a response from the service. This means that the workflow took longer to respond than the allotted timeout value. The connection between the client application and service was closed, and the client application received an HTTP status code 504 Gateway Timeout."

What alternatives do I have to resolve this timeout issue?

I am aware of the Microsoft documentation that specifies the time limits for Azure Logic Apps. However, what options are available if I need more time to complete the processing?

User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,187 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ben Gimblett 4,530 Reputation points Microsoft Employee
    2024-09-17T14:54:11.6166667+00:00

    hi - thanks for the question

    The simplest thing to do here is to set the async property on the response, for example#

    User's image

    This means the caller will get an initial 202 with a "location" to poll and "retryAfter" interval

    The client can then start polling , until the logic app is finished they'll get a 202 - once it's done they'll get a 200 and a response body (whatever you set in the response action to be returned)

    It does of course mean the client/caller is capable of polling - if the caller is another logic app it's easy as logic apps will follow the http pattern automatically when you use a http action to call an http endpoint

    The other way of doing this would be to use the webhook pattern

    Webhooks are event based and avoid polling. You could also use some other event or message based pattern via Event Grid, Az Service Bus or Az Web Pub Sub

    Web Sockets which also allow for long running actions are not directly supported in Logic Apps today


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.