# Long Running - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/sandbox-long-running

# Long Running

Copy pageCopy page

Copy pageCopy page

You can configure a sandbox to keep running beyond the default session timeout by enabling long-running mode. 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).

Do not set `timeout` or `idle_timeout` together with `long_running`. If either `timeout` or `idle_timeout` is set, it takes precedence and the sandbox will stop according to that value instead of long-running mode.

##

[​](#basic-usage)

Basic usage

Pass the `long_running` key in the `metadata` object when creating a sandbox.

JavaScript & TypeScript

Python

```
import { Novita } from 'novita-sandbox'

const novita = new Novita()

// Create a long-running sandbox.
const sandbox = await novita.sandbox.create({
metadata: {
long_running: 'true',
},
})
```

```
from novita_sandbox import Novita

novita = Novita()

# Create a long-running sandbox.
sandbox = novita.sandbox.create(
metadata={
'long_running': 'true',
},
)
```

Last modified on August 10, 2026
