Reference

Environments, sessions and runs

Compute, live notebook state, execution records, ownership, and cleanup.

When you open a notebook, Querio starts live compute separately from the work you saved. Use session state to tell whether you can work, and run status to tell whether execution finished. Neither tells you that a result is analytically correct or current.

ResourceWhat it holdsWhat happens when compute closes
Saved notebookCells, configuration, layout, and stored outputs in an Explore.Saved work remains. Stored output may reflect earlier code or data.
Execution environmentCompute and a workspace file view.Its running services are released; the saved notebook remains.
Notebook sessionAn open notebook in an environment, with a mode, selected datasources, and query variables.Live Python values, cell state, and connections are lost when its runtime ends. An open saved session can restore compute.
RunA recorded notebook execution or agent turn associated with a session.Its status, input, output, error, and timestamps remain available, subject to access. The record does not keep Python running.

Associations and ownership

A session, its notebook, and its environment belong to the same workspace. An environment hosts one active notebook kernel at a time. To work in two notebooks concurrently, use separate environments. Finish closing a session before reusing its environment.

Explicit CLI/API opens use the saved notebook ID as the session ID. Only one such session can be open for that notebook. Browser View creates a separate live session ID for each view instance, so several people can view the same Explore in independent runtimes. Keep returned IDs; do not construct them.

Opening an edit session requires Explore edit permission. A run session normally requires read permission, and custom query variables also require edit permission. Sharing an Explore does not grant control of another person's live session or query access. Session events and scratchpad execution check runtime identity, with separate authorization for managed platform work.

Session datasource selections and query variables configure execution; query variables are not Python globals. Close and deliberately reopen an explicit session to change its configuration. A notebook may have a bound agent session in the same environment. Closing the agent leaves the notebook usable; closing the notebook closes its bound agents.

Close only resources you created or were asked to close. Resource IDs are not access grants. Query access still requires datasource permission and exactly one authorized credential; see Users, roles and groups.

Readiness and session states

An environment reporting ready can host a notebook. It does not mean a notebook is open or any cell has run.

Environment stateMeaning
readyThe environment resource is available. Notebook readiness is checked separately.
closedThe environment resource has been released. Create another environment before opening a notebook there.

An explicit notebook open can return while startup is in progress. Wait for session readiness before using it; readiness is not an execution result.

Notebook session stateMeaning and next action
startingSaved state is loading and the runtime is starting. Wait for readiness.
readyThe session can accept work. A calculation may still be running or may have failed.
closingShutdown is in progress. Wait before reusing the notebook or environment.
closedNo usable runtime is attached. Deliberately reopen an explicitly closed session.
failedStartup or session bookkeeping failed. Inspect error before retrying.

Read id, notebookId, environmentId, workspaceId, mode, config, state, and error together. activeRunId identifies a tracked run when present; its absence does not establish that no interactive work is happening.

Inspection can restore compute

Inspecting an open saved session can start a replacement runtime after idle reclamation or a server restart. The session keeps its saved configuration, but fresh compute does not recover in-memory Python values. Run the cells you need again. An explicitly closed session stays closed on inspection.

The saved open/closed marker and reported live state can differ while idle compute is reclaimed. Treat inspection as a possible restoration, not merely a metadata read.

Edit and View modes

The session mode run controls what you can do in View. It is distinct from a recorded execution run.

ModeNotebook behavior
editAuthor and execute cells. Notebook changes are saved to the Explore; its editing conversation is saved separately.
runExecute existing, unchanged cells and use controls. You cannot author cells or rename the source notebook. Live results and View chat are not saved back to the source Explore.

View's authoring restriction does not make the filesystem or database read-only. Hybrid and Notebook are display presets, not execution modes. See Explores for View chat and continuation into editable work.

Opening a CLI/API session does not execute its cells. The browser manages its own initialization and may run the notebook when opening View.

Operations and outcomes

These commands show which action creates, inspects, or closes each resource. See the CLI reference for flags and result shapes, or Get started with CLI for the authoring path. The CLI is distributed through its official repository.

OperationCLI commandResult
Create computeexecution-environment createEnvironment ID; no notebook opened.
Open a saved notebooknotebook-session createSession ID. --wait waits for readiness and leaves resources open.
Inspect or restorenotebook-session getCurrent session state; an open saved session may acquire compute again.
Wait for readinessnotebook-session waitReady session or startup/timeout error; no execution submitted.
Interactive workcode execSynchronous result with success and errors; no durable run ID.
Execute the notebooknotebook-session executeRun ID after acceptance. --wait waits for a terminal result and leaves resources open.
Execute in a new runtimenotebook runNotebook, environment, session, and run IDs. With --wait, it attempts cleanup after completion.
Read historynotebook-session executionsSaved runs, oldest first, with pagination.
Inspect or wait for a runruns get, runs waitRecorded status and results.
Request cancellationruns cancelAccepted request; inspect until the run is terminal.
Close a sessionnotebook-session closeSaves first, then closes the session and bound agents. Environment remains open.
Close computeexecution-environment closeReleases the environment after attached sessions close. Saved notebooks remain.

The current shared run inspection and cancellation API endpoints are marked deprecated; replacement endpoints are not yet defined. Existing CLI commands use the current surface. See the API reference before choosing an integration contract.

Run states and results

Run status is separate from session state: a session can be ready while a run is running. A returned run ID means the request was accepted, not that the work succeeded.

Recorded statusMeaning
pendingReserved or waiting for dispatch; it may not have reached the runtime.
runningStarted, with no terminal result recorded.
completedSuccessful execution recorded. Check the result and analytical assumptions before using it.
failedExecution, dispatch, or recovery failed. Inspect error and existing effects before retrying.
cancelledCancellation recorded. Effects already completed are not rolled back.

A response or live event can say cancelling while interruption is in progress. Read the recorded status for the final outcome. Cancellation does not guarantee that a remote warehouse query stopped.

Runs record kind (notebook or agent), sessionId, input, output, error, and creation, start, and completion times. Run output can differ from the notebook's current source, stored output, or a later result. Records remain after session and environment closure, subject to access; a live task index may disappear on restart. If a runtime vanishes without a completion report, do not assume success. No fixed history-retention period is promised here.

Concurrency and saving

Notebook execution and agent turns have busy checks. Another execution for the same active session can fail with Session execution already in progress. Browser editing can also be refused while an editor or automation holds the Explore. Wait for that work to finish; do not close someone else's session to clear a conflict.

In an editable session, a successful code exec waits for the notebook save. If saving fails, the code may already have run and changed cells. Keep the session open, inspect its cells and saved state, resolve the save failure, then retry saving or closing. Do not replay authoring code or submit a durable run just to flush a save.

Replacing a closed notebook's saved cells is a separate operation. It uses the last-read updatedAt timestamp and fails on a conflict. A title-only update can occur while a session is open. See CLI reference.

Disconnect, timeout, and close

EventResource effect
Browser notebook or chat connection dropsThe connection ended; another connection or active work can keep the session alive.
Browser session becomes idle and unobservedCompute may be reclaimed after the configured idle grace period. An open saved session can restore it.
CLI readiness wait times outCreated resources remain. Inspect them using the returned or printed IDs.
Durable run wait times outLocal waiting stops; the run may continue. Inspect it before submitting again.
Interactive execution disconnects or is interruptedInterruption is requested. Completed writes and other effects can remain. Check state before retrying.
Session close succeedsRuntime and bound agents close; saved notebook work and recorded runs remain. Environment stays open.
Environment close succeedsCompute is released; the saved notebook is not deleted.

The browser manages resources it opens. CLI/API callers close their own sessions, then their environments. Closing a terminal or losing a stream is not cleanup. Active work is protected from ordinary idle reclamation, but process failure and explicit close can still stop it.

notebook run --wait attempts cleanup in that order. Cleanup failures can appear on stderr even when the command exits successfully; confirm resource state separately.

Errors and recovery

ConditionNext action
Wrong workspace or unavailable resourceA lookup can return 404. Check workspace and IDs; an ID is not an access grant.
Notebook or environment occupiedA 409 can mean another session owns it. Inspect the session, use separate compute, or close only your earlier session.
Environment still has sessionsClose attached sessions before retrying environment close (409).
Startup failsInspect session error. It may report failed; execution acquisition can return 503. Resolve the cause before reopening.
View tries to change cellsUse an authorized edit session or continue into a new Explore (403).
Save fails before session closeClose fails and the live session stays open. Resolve persistence, inspect saved code, then retry close.
Runtime closed but closure could not be savedThe session reports failure with a retry-close message. Resolve it and retry session close before environment close.
Runtime replaced without a recorded outcomePreviously running work can be marked failed. Check results and external effects before rerunning.
Run already terminalCancellation returns 409. Read its recorded outcome.

For cells and stored outputs, see Notebooks. For resource creation and cleanup, use Get started with CLI.

Was this page helpful?

Last updated on October 27, 2026

On this page