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
Staying logged in across sessions
Sessions always start from a clean environment, so a new session normally means a fresh login. If the credential has credential persistence enabled, Deck restores the credential’s saved login state into the new session, and the agent can pick up already logged in when the source honors it. This is a credential setting, not a session one: the session lifecycle described on this page is unchanged.Session statuses
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
completing and then to completed once teardown finishes. Any running task runs in the session are canceled as part of teardown.
You can only end a session that is queued, running, or idle. Ending a session that has already finished (completed or failed) returns an error.