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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Bad Gateway 504 Error

(0) ShareShare
ReportReport
Posted on by 1,760 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,760 Moderator on at
  • srduval Profile Picture
    1,760 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,760 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard