The job APIs are available on connections to LanceDB Enterprise clusters.
On embedded (OSS) connections, these methods raise a
NotSupported error
because there is no server orchestrating background work.When to use it
Use these APIs when you need to:- Find a job id after starting an indexing or compaction call and follow its progress from another process.
- Build a small dashboard or health check that lists in-flight jobs across a cluster.
- Cancel a long-running job that is no longer needed.
- Inspect why a job failed by reading its lifecycle history.
The Job handle
Some client calls that trigger server-side work — for example, kicking off an
index build — return a Job handle. A Job also comes back from
connection.job(job_id), which is how you rebuild a
handle from an id you saved earlier.
Job supports four operations:
status() is a point-in-time snapshot and does not raise on terminal
failure or cancellation. Use wait() when you want the call to block and
surface a failure as an exception.Look up a job by id
connection.job(job_id) rebuilds a Job handle from a job id you saved
earlier — for example, one you persisted from a previous run. The lookup is
local; the handle only contacts the server when you call status(), wait(),
or cancel().
List jobs
list_jobs returns a summary of server-side jobs across the tables in the
database. Each entry includes the job id, the target table, the job type, the
current lifecycle state, and when the job was created.
JobInfo:
job_id/jobId— the id accepted byget_jobandcancel_job.table— the table the job runs against, without URI or namespace.job_type/jobType— the kind of job (for example, an index build or a compaction).state—"running","finished","failed", or"cancelled".created_at_millis/createdAtMillis— creation time as Unix milliseconds.
Describe a single job
get_job returns a richer JobDescription for one job, including its
job-type-specific spec and — if the job failed — a structured failure record.
It returns None (or null in TypeScript) when the server has no such job.
Cancel a job
cancel_job asks the server to cancel a job by id. It returns true on
success and false when there is no such job. Cancelling a job that has
already reached a terminal state is a no-op success.
Read job history
job_history returns the lifecycle events for a single job — creation,
state transitions, and any failure details — as one or more Arrow
RecordBatches (Python) or an Arrow Table (TypeScript). Omit the id to
list history across all jobs.
Related
- LanceDB Enterprise Architecture — where jobs fit in the data plane.
- Indexing — the operations that most commonly show up as server-side jobs.