A session is an isolated compute environment where Deck executes tasks. Sessions are created automatically when you run a task, or you can reuse an existing session to run multiple tasks in the same environment.Documentation Index
Fetch the complete documentation index at: https://docs.deck.co/llms.txt
Use this file to discover all available pages before exploring further.
How sessions fit in
When you run a task, Deck creates a session (or reuses one you specify) and executes the work. The session manages the compute lifecycle so your application doesn’t have to.Session lifecycle
Sessions are created implicitly when a task runs. You don’t need to create them ahead of time. The response includes asession_id you can reuse.
Reusing a session
To run additional tasks in the same session, pass thesession_id from a previous task run:
POST /v2/tasks/{task_id}/run
Session statuses
| Status | Meaning |
|---|---|
queued | Waiting to be provisioned |
running | Active and executing work |
idle | No active tasks, waiting for new work |
completing | Work is done, session is shutting down |
completed | All work finished and the session was closed |
failed | The session encountered an error |
Timeout
Sessions time out after 10 minutes of inactivity. Inactivity means no task runs are executing in the session. When the timeout elapses, the session is torn down automatically and transitions tocompleted.
To keep a session alive across multiple tasks, start the next run before the 10-minute window elapses.
Ending a session
completed. Any running task runs in the session will be canceled.