LowCodeStacks™
Sign in

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

Checked against Microsoft Learn 14 sources · Updated By · drafted with AI help, checked by a personHow we write guides

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.

An action fails with a 500, 502, 503 or 504 error. The Default retry policy retries with growing waits, up to 8 or 12 times on Medium and High, and often the blip clears. If it's still failing, a branch set, on its Settings tab, to Run after has failed or has timed out catches it and records the item ID, the error and the status Retry in a list or table; a scheduled flow re-processes those rows hourly and a person is told after a day. Errors 400, 401, 403 and 404 fail the same way every time, so retrying won't help. Retries count toward request limits, and a retried create can create twice.
Retries handle blips; a catch-and-retry-later pattern handles longer outages.

What are you seeing?

What the codes mean

CodePlain meaningUsually
500 Internal Server ErrorThe service you called failed while handling the requestOn their side; temporary
502 Bad GatewayThe connection between Power Automate and the service failedTemporary, or an on-premises gateway problem
503 / 504The service is unavailable or too slow to answerTemporary, often under heavy load
429 Too Many RequestsYou're sending too much, too fastYours: see the throttling notes in Cloud flow error codes
400 / 401 / 403 / 404Your request, sign-in, permission or target is wrongYours: 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?

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. Settings: the tab you open on the selected action, here Create item.
  2. 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).
  3. The open list: Default, None, Exponential interval and Fixed interval. Default is selected.
The Settings tab of the SharePoint action Create item in the Power Automate designer. Under General, Action timeout is empty, with the hint Example: P1D. Under Networking, Retry policy has the note: A retry policy applies to intermittent failures, characterized as HTTP status codes 408, 429, and 5xx, in addition to any connectivity exceptions. The default is an exponential interval policy set to retry 4 times. Its drop-down is open, listing Default (selected), None, Exponential interval and Fixed interval.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the Retry policy options on an action's Settings tab in the Power Automate designer, interface as of July 2025, with made-up data.

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:

  1. 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.
  2. Record what didn't happen. Write the item's ID and the error to a list or table, with a status such as "Retry".
  3. Re-process later. A small scheduled flow can pick up the "Retry" rows each hour and try again.
  4. Tell a person if something stays failed for, say, a day.

What the catching action's Run after section shows, as of July 2025:

  1. 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.
  2. 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.
  3. The coloured dots beside Update item, and above the card on the canvas, show which outcomes are selected.
The Settings tab of the SharePoint action Create item in the Power Automate designer, scrolled to the Run after section. Under Select actions, the step Update item is listed with a delete icon and four check boxes: Is successful (clear), Has timed out (selected), Is skipped (clear) and Has failed (selected). Coloured dots beside Update item, and above the selected Create item card on the canvas to the right, mark the two selected outcomes: orange for timed out and red for failed.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the Run after settings on an action's Settings tab in the Power Automate designer, interface as of July 2025, with made-up data.

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

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.