# ResponseTimeout (504 BadGateway) when Power Apps runs a flow in Power Automate: cause and fix

Source page: https://ipaaserrors.com/power-automate/power-apps-flow-responsetimeout
Platform: Power Automate · Power Apps calling a flow · Code ResponseTimeout
Checked against vendor docs: 2026-11-27

ResponseTimeout with a 504 BadGateway when a Power App runs a flow means the synchronous flow run took longer than the 120-second limit. Find the slow runs and optimize the actions so the flow responds within 120 seconds.

## Error text

```
ResponseTimeout
BadGateway
The server did not receive a timely response from the upstream server. Request tracking id '<some_tracking_id>'.
```

## Likely causes

- A synchronous flow run called from Power Apps exceeded the 120-second limit.

## How to fix it

1. Find the slow runs in the flow's run history.
2. Optimize the actions so the flow finishes within 120 seconds.

## Sources

- [Troubleshoot Power Apps flow integration issues](https://learn.microsoft.com/en-us/troubleshoot/power-platform/power-apps/connections/best-practices-when-updating-a-flow)

From iPaaS Errors (https://ipaaserrors.com), part of iPaaS Group. When citing, link to https://ipaaserrors.com/power-automate/power-apps-flow-responsetimeout and the vendor documentation above.
