502 Bad Gateway and other random failures in Power Automate: retry, wait or report
A flow that worked for months starts failing at random with 502, 500, 503 or 504. How to tell a temporary service problem from your own fault, set retries that actually help, make the flow survive the next outage, and report it with the evidence support needs.
Power AutomateFix a problem10 min read
Intermittent failures are the most frustrating kind: the same flow, the same data, sometimes green and sometimes red with 502 Bad Gateway or 500 InternalServerError. Usually the problem isn't in your flow at all. This page helps you prove that quickly, keep the flow working through it, and know when it is yours to fix.
What are you seeing?
500 · 502 · 503 · 504Fails at random, works on a re-runUsually a temporary problem on the service's side.502Keeps failing on on-premises dataCheck the on-premises data gateway, and the network and firewall settings it depends on.5xxStill failing after the retriesCatch the failure and re-process the work later.5xxFailing for more than a day, no incident postedReport it, with the evidence support needs.
What the codes mean
| Code | Plain meaning | Usually |
|---|---|---|
| 500 Internal Server Error | The service you called failed while handling the request | On their side; temporary |
| 502 Bad Gateway | The connection between Power Automate and the service failed | Temporary, or an on-premises gateway problem |
| 503 / 504 | The service is unavailable or too slow to answer | Temporary, often under heavy load |
| 429 Too Many Requests | You're sending too much, too fast | Yours: see the throttling notes in Cloud flow error codes |
| 400 / 401 / 403 / 404 | Your request, sign-in, permission or target is wrong | Yours: retrying won't help |
The first rule: retrying only helps 5xx errors, 429 and 408 (a timeout). Errors such as 400, 401, 403 and 404 fail the same way every time until you fix the request, the sign-in, the permission or the target.
Work through it
Is it you or them?
- Look at the pattern in run history. Do failures cluster in a time window and then stop? That points to the service. Does the same item fail every time? That points to that item's data, so look at its inputs.
- Check service health. For Microsoft services such as SharePoint, Outlook, Dataverse and Power Automate itself, look at Service health in the Microsoft 365 admin center (your admin can) for known incidents. For other services, check their status page.
- Check the gateway, if the action uses on-premises data. If a 502 keeps coming back, Microsoft's advice is to look at the network and the firewall, above all where an on-premises data gateway is involved. Check that the gateway is online, restart the gateway service if it isn't, and keep it up to date: Microsoft supports only its last six monthly releases.
- Re-run one failed run: open it in run history and select Resubmit. If it now succeeds unchanged, it was temporary. A resubmitted run can create records or send emails a second time, so check for duplicates afterwards.
Tip
When several flows fail at the same moment with 5xx errors, check Service health first: it shows the known issues affecting your tenant. When only one flow fails, look at what that flow sends.
Make sure retries are working for you
Actions that support retries already have a retry policy, set to Default: an exponential policy, where the wait between tries grows. Retries are there for faults that clear up by themselves, like a brief network drop or a service that's down for a moment. How many times Default retries depends on which Microsoft page you read:
- Power Automate's limits page: up to 2 retries on the Low performance profile, and up to 12 on Medium and High, with the wait growing to about an hour before the last one.
- Power Automate's designer page: 2 on Low; on Medium and High, 12 for a flow with premium connectors and 8 for a flow without them. We follow this page in the quick answer, because it's the more specific of Power Automate's own pages.
- The note under Retry policy on the action's Settings tab: "The default is an exponential interval policy set to retry 4 times." That's the default Azure Logic Apps documents for most operations (up to 4 retries, with waits of 5 to 45 seconds), and Power Automate's limits page sends you to the Logic Apps page for more about retry policies.
Microsoft Learn doesn't say which of these figures a cloud flow actually uses, so don't count on more than 4 retries (2 on the Low profile); if an action must keep trying longer, set your own exponential policy.
Check an important action's Settings → Retry policy:
- Default (exponential) is right for nearly everything. Leave it.
- None turns retries off. Only choose it when a repeat would do harm, such as sending a payment twice.
- An exponential or fixed interval policy lets you set your own count (up to 90) and waits (at least 5 seconds, at most 1 day).
What the action's Settings tab shows, as of July 2025:
- Settings: the tab you open on the selected action, here Create item.
- Retry policy, under Networking: its note says it applies to HTTP status codes 408, 429 and 5xx, and to connectivity exceptions, and that the default retries 4 times (see the counts above).
- The open list: Default, None, Exponential interval and Fixed interval. Default is selected.

Warning
Retries count toward your daily request limits, and a retried action that creates something, such as an item or an email, can create it twice if the first attempt actually succeeded before the error came back. For "create" actions, check whether the item exists before creating it.
Survive the outage instead of just failing
If a failure that outlasts the retries shouldn't lose work:
- Catch the failure. After the risky step, add an action and, on its Settings tab, set Run after to Has failed and Has timed out (in the classic designer, this is Configure run after on the action's menu). The full pattern is in Try, catch and finally.
- Record what didn't happen. Write the item's ID and the error to a list or table, with a status such as "Retry".
- Re-process later. A small scheduled flow can pick up the "Retry" rows each hour and try again.
- Tell a person if something stays failed for, say, a day.
What the catching action's Run after section shows, as of July 2025:
- Run after, on the Settings tab of the action that catches the failure (here Create item): it names the step this action waits for, Update item.
- The four boxes: Is successful, Has timed out, Is skipped and Has failed. Only Has timed out and Has failed are selected, so Create item runs only when Update item fails or times out.
- The coloured dots beside Update item, and above the card on the canvas, show which outcomes are selected.

This turns a one-hour outage from "lost orders" into "orders a little late".
When to report it
Report the problem, to Microsoft support through your admin or to the service's own vendor, when:
- failures continue for more than a day with no incident posted;
- a single action fails consistently with a 5xx error on valid input;
- you see the problem across environments or tenants.
Include:
- the flow run URL of a few failed runs, with their dates and times in UTC;
- the action name and the full error output from the failed action's Outputs;
- the environment name or ID and its region, the flow ID (in the flow's address, after
/flows/), and any correlation ID or client request ID shown in the error; - whether a manual re-run succeeds;
- whether it uses an on-premises gateway, and the gateway version.
Sources
- Microsoft Learn: Fix connection failures in cloud flows: error codes and gateway issues
- Microsoft Learn: Troubleshoot cloud flow errors
- Microsoft Learn: Test cloud flows: resubmit cloud flow runs
- Microsoft Learn: Limits of automated, scheduled and instant flows: retry policy
- Microsoft Learn: Explore the cloud flows designer: Settings
- Microsoft Learn: Employ robust error handling
- Microsoft Learn: Recommendations for handling transient faults (Power Platform Well-Architected)
- Microsoft Learn: Troubleshoot common problems with Power Automate triggers
- Microsoft Learn: Handle workflow errors and exceptions in Azure Logic Apps: retry policies
- Microsoft Learn: Limits and configuration reference for Azure Logic Apps: retry policy limits
- Microsoft Learn: Troubleshoot the on-premises data gateway
- Microsoft Learn: How do I check my online service health?
- Microsoft Learn: Create an effective Power Automate support request
- Microsoft Learn: Support for Power Platform and Dynamics 365 apps: who can submit a support request
Add LowCodeStacks as a preferred source on Google
Did this fix it?
Get the weekly email
New guides and updates from LowCodeStacks, every Tuesday. One email a week, no more.
From LowCodeStacks, Regina, SK, contact@lowcodestacks.com. You can unsubscribe any time, from the link in every email or in your privacy settings. See the Privacy notice.
Comments
No comments yet. Share what worked for you.
Sign in to comment. Comments show under a display name you choose, never your email.