By default, a sandbox timeout is effective for at most 1 hour — any larger value is capped. Long-running mode lifts this cap: with it enabled, the timeout you pass when creating the sandbox can exceed 1 hour. This is useful for workloads that need to stay alive well beyond a typical session, such as persistent services, long-running agent tasks, or background jobs.
Long-running mode is configured via the metadata field when creating a sandbox. The key is long_running and the value is "true" (as a string).
long_running works together with timeout: set the timeout you actually need when creating the sandbox — with long_running enabled, it can exceed the default 1-hour cap. Without long_running, timeout is effective for at most 1 hour. If timeout is not set, it defaults to 5 mins.
Long-running mode does not disable idle timeout: if you set one, it still applies, and an inactive sandbox will be paused or killed accordingly.
Basic usage
Pass the long_running key in the metadata object when creating a sandbox.
How it works
- On
create (and resume), when long_running is set, the timeout you pass can exceed the default 1-hour maximum running time.
Scope and inheritance
- Only
create accepts the long_running parameter.
resume (including auto-resume): a sandbox created with long_running keeps the behavior after being resumed from a snapshot.
clone inherits the parameter, and the sandbox keeps it when it continues running after a reset.
Examples
Create a long-running sandbox that stays alive for up to 7 days: