Session operation exceeded its timeout (504)
You might be here because: “The session took too long to respond. Try again” · “Session timeout” · “504 session-timeout” · “The operation exceeded the supplied timeout of N ms” · “timeout_ms” · “my command timed out” · “the page is slow and the step gives up” · “gateway timeout from the API” · “the session keeps timing out”
Short answer
One action on a running session did not finish inside the time limit the request allowed; the session itself is usually still running. The API answers HTTP 504 session-timeout, detail “The operation exceeded the supplied timeout of N ms.”, with the limit repeated in timeout_ms. The desktop app shows “The session took too long to respond. Try again.”. Try the action again, or allow more time when your request sets the limit.
Check first
- Is the session still running in the Sessions tab? A 504 is about one action, not the session.
- Is the page slow through the profile’s proxy? A slow proxy makes every step slow.
- From code: which limit did you pass? The refusal echoes it in
timeout_ms.
Likely causes and fixes
-
The page or the session was slower than the limit. This error is kept apart from a driver failure on purpose, so you can tell “did not finish in time” from “failed”. Fix: try again; if your request sets the limit, set a larger one. On a session’s navigate, interact and wait calls the limit is the optional
timeout_ms: navigate 1–120 s (30 s if you leave it out), interact 0.1–60 s (10 s), wait 0.1–120 s (30 s). -
Retrying from code. A 504 is not one of the SDKs’ retryable classes, so
isRetryablereturns false and the built-in retry does not repeat it. Fix: retry deliberately, after deciding whether the action is safe to run twice — a tap that did land would land again. -
The page never finishes loading. If the site behind the proxy is not answering, every step waits and gives up. See the page-load page for the proxy and DNS checks.
-
It times out every time. The session has probably stopped answering the steps sent to it, even if the live view still shows the page. Fix: stop the session and launch the profile again.
If it still fails
If a fresh session on the same profile times out on its first action, press Talk to a person in this chat (or open Help) and include the session id, what the action was, the timeout_ms value shown, and the time. Nothing here needs an account or billing action.