web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Bad Gateway 504 Error

(0) ShareShare
ReportReport
Posted on by 1,781 Moderator

I have a flow that is trying to execute a stored procedure in an Azure SQL database, the SP runs fine (3-5 minutes) in SSMS, but in flow it fails every time with a bad gateway/timeout error.

 

i've tried the execute stored procedure step as well as the execute SQL query both fail. I have other steps that read from the same connection to the same server/database. I put a parameter on the sp to see what happens and when i put the parameter to just return a select statement, it ran without issue. But when the flow tries to run the full SP which truncates a table and inserts new records, it fails

Annotation 2020-07-16 112809.png

{
"error": {
"code": 504,
"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
"clientRequestId": "921d218a-8b4d-4402-a508-72f3059d6c4e",
"message": "BadGateway",
"innerError": {
"status": 504,
"message": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.\r\nclientRequestId: 921d218a-8b4d-4402-a508-72f3059d6c4e",
"error": {
"message": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
},
"source": "sql-wus.azconn-wus.p.azurewebsites.net"
}
}
}

Categories:
I have the same question (0)
  • srduval Profile Picture
    1,781 Moderator on at
  • srduval Profile Picture
    1,781 Moderator on at

    @Msft @EUG-MSFT  I'm having problems loading the MS support site, it is just spinning on my end and not loading. Is there an alternative way to create a support ticket?

  • Toltekrom Profile Picture
    on at

    Hope you found the issue. What I see you are using the wrong Power Automate object - Execute a SQL Query instead of Execute a Store Procedure 

  • srduval Profile Picture
    1,781 Moderator on at

    @Toltekrom The two objects do the same thing in this case depending on how you construct the SQL statement. So it is not the "Wrong" object besides I tried it with both objects and still had the gateway error. The issue is a hardset timeout of 120 seconds that can not be manually overridden. So if automate doesn't get a "progress" report within that 2 minutes, it terminates the workflow. So in this case SQL doesn't communicate anything to Automate while the SP is executing, so it hits the 120 seconds of no communication and terminates the flow.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard