Skip to main content
POST
Schedule a job

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

job_id
string<uuid>
required

Unique identifier for a job.

Body

application/json

Records which executor has claimed a pending job and moves it to scheduled.

executor
string
required

Identifier of a job executor. Non-blank, at most 255 characters.

Required string length: 1 - 255
Example:

"job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266"

Response

OK

A job. Every job carries the same envelope of fields — see JobBase — but input and result hold job-type-specific payloads, so the response is a union over type: pick the branch whose type matches and you get the typed input and result for that kind of job.

The union is open on purpose. Job types are free strings on the server, so a type this spec version does not describe lands in OtherJobResponse, where both fields stay free-form. No branch closes itself to extra properties, and new job types can appear without a spec change.

input and result are returned exactly as they were stored when the job was enqueued or completed. The server never reshapes them, so a field a job type gained after a row was written is absent from that row rather than null. The typed branches describe what the current code writes; fields that have not always been written are left out of each branch's required list.

result is null in every branch until the job reaches a terminal state.

job_id
string<uuid>
required

Unique identifier for the job.

company_id
integer<int64>
required

The company the job belongs to.

request_source
object
required

Who asked for the job. Discriminated by type: api_user for a job requested through the API on behalf of a user, process for one enqueued by a Narrative process.

Example:
state
enum<string>
required

Where a job is in its lifecycle.

  • pending — enqueued and waiting to be picked up.
  • scheduled — claimed by an executor but not yet started.
  • running — being executed.
  • pending_cancellation — cancellation has been requested and the data plane has yet to stop the work.
  • completed, cancelled, failed — terminal states.
Available options:
pending,
scheduled,
running,
pending_cancellation,
completed,
cancelled,
failed
operator_type
string
required

Which operator runs the job, e.g. materialized-view-refresh or datasets_execute_select. Finer-grained than type: several job types can share one operator, and where no such mapping exists the two are equal.

tags
string[]
required

Free-form labels attached to the job.

Required string length: 1 - 255
execution_cluster
enum<string>
required

The type of the execution cluster to run the job on.

  • dedicated runs job on a dedicated cluster.
  • shared runs job on a shared cluster.
Available options:
dedicated,
shared
idempotency_key
string
required

The unique key the job was enqueued under.

Required string length: 1 - 255
created_at
string<date-time>
required

The timestamp representing when the job was created.

updated_at
string<date-time>
required

The timestamp representing when the job was updated.

attempted_at
string<date-time>
required

When the job's current attempt started. A job can be retried; each retry is a new attempt, so this advances to the latest one, while created_at stays at the original submission.

attempt_version
integer
required

Which attempt this is: 1 for the first, increasing by one on each retry.

type
enum<string>
required
Available options:
materialize-view
input
object
required

Jobs enqueued today carry every field below, with null where a value is unset. Most of the optional fields were added over the life of this job type, so a row written before a field existed lacks that key.

Example:
result
object | null
required

Written by the completion handler and by the Spark executor alike. recalculation_id and row_stats were added after this job type existed, so older completed rows lack them.

Example:
data_plane_id
string<uuid> | null

The data plane the job runs on. Jobs enqueued without one are reported as running on the Narrative data plane, f79cbdae-4848-47ca-95e8-69588364d185, so this is never null in practice.

compute_pool_id
string<uuid> | null

The compute pool associated with the job, if any.

executor
string | null

The internal job executor tied to the job. Null until an executor picks the job up.

dequeued_at
string<date-time> | null

When the job was taken off the queue. Null while it is still queued.

ended_at
string<date-time> | null

The timestamp representing when the job finished. Null until the job reaches a terminal state.

workflow_id
string<uuid> | null

The id of the workflow that enqueued the job. Null for jobs not enqueued by a workflow.

workflow_run_id
string<uuid> | null

The id of the workflow run that enqueued the job. Null for jobs not enqueued by a workflow run.