inactivity_timeout
End the session after this long with no traffic on its WebSocket.
Use it for: Freeing the thread quickly when a script dies (short), or giving a person or a slow step time to think (long), up to your plan's cap.
Browsers: Google Chrome, Microsoft Edge, Brave, Opera, Naver Whale, Yandex Browser, Chromium, Patchright, Rebrowser, Camoufox, Firefox, WebKit.
Details
- Type:
number | string - Default: 120s
- Example:
{"inactivity_timeout":"2m"}
The timer resets on any protocol traffic in either direction. A number of seconds (90, 1.5) or a string with a unit: 500ms, 45s, 10m, 2h (digits only, no spaces or decimals). Clamped to 1 s – 24 h. An unparseable value silently falls back to the default.
Up to 10 minutes on shared threads, 5 on Community and 24 h on dedicated; a longer value is cut to your plan's maximum. Idle minutes are billed like any others. A slow page load through a proxy can produce no traffic for a while, so keep it at 60 s or more. Never longer than the session's overall timeout.
Used in
- Case 78: keep_alive: an agent run that survives its client going away
- Case 58: Do it by hand in live view, then let your code finish in the same browser
- Short-lived sessions for burst jobs
- Chrome you can disconnect from and come back to
- Microsoft Edge over CDP that survives a disconnect
- Headful Opera over CDP that survives a disconnect
- Long-running session
All options: launch options.