Retrieving and Managing Job State

Retrieving and Managing Job State#

Materialized provides a simple way to retrieve the status and results of a job, or to cancel jobs that are still pending.

To retrieve the status and results of a job, you can use the job_id returned when you submitted the job.

Job Status#

GET https://api.materialized.dev/job-status/{job_id}#

Retrieve the status of a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

Request Headers:
Accept:

application/json

Response JSON Object:
  • message – Verbose message for the job’s current status.

  • job_status – The current status of the job.

The job_status will be one of the following:

  • succeeded: The job completed successfully.

  • failed: The job failed.

  • cancelled: The job was cancelled.

  • pending: The job is still pending.

  • submitted: The job has been submitted.

  • starting: The job is starting.

  • running: The job is running.

  • unknown: The job status is unknown.

Cancelling a Job#

POST https://api.materialized.dev/job-cancel/{job_id}#

Cancel a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

Request Headers:
Accept:

application/json

Response JSON Object:
  • cancelled – True if the job was cancelled, False otherwise.

  • message – Verbose message for the job’s cancellation status.

Retrieving Results#

POST https://api.materialized.dev/job-results/#

Retrieve the results of a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

  • include_inputs (bool) – Whether to include the inputs in the results.

  • include_cumulative_logprobs (bool) – Whether to include the cumulative logprobs in the results.

Request Headers:
Accept:

application/json

Response JSON Object:
  • results – If include_inputs is True, the results will be a dictionary with inputs and outputs keys. If include_inputs is False, the results will be a list of outputs, in the same order as the inputs.

  • message – Verbose message for the job’s results.

Listing All Jobs#

GET https://api.materialized.dev/list-jobs/#

List all current and historical jobs, and associated metadata.

Request Headers:
Accept:

application/json

Response JSON Object:
  • jobs – A list of jobs you have access to.

  • message – Verbose message for the job’s results.