Skip to main content

jobs

Creates, updates, deletes, gets or lists a jobs resource.

Overview

Namejobs
TypeResource
Iddatabricks_workspace.workflows.jobs

Fields

The following fields are returned by SELECT queries:

Request completed successfully.

NameDatatypeDescription
job_idinteger
creator_user_namestring
created_timeinteger
has_moreboolean
settingsobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_nameRetrieves a list of jobs.
getselectdeployment_nameRetrieves the details for a single job.
createinsertdeployment_nameCreate a new job.
updateupdatedeployment_nameAdd, update, or remove specific settings of an existing job. Use the
resetreplacedeployment_nameOverwrite all settings for the given job. Use the
deletedeletedeployment_nameDeletes a job.
runnowexecdeployment_nameRun a job and return the
submitexecdeployment_nameSubmit a one-time run. This endpoint allows you to submit a workload directly without creating a job. Runs submitted using this endpoint don’t display in the UI. Use the

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Retrieves a list of jobs.

SELECT
job_id,
creator_user_name,
created_time,
has_more,
settings
FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Create a new job.

INSERT INTO databricks_workspace.workflows.jobs (
data__name,
data__description,
data__timeout_seconds,
data__max_concurrent_runs,
data__format,
data__edit_mode,
data__email_notifications,
data__webhook_notifications,
data__notification_settings,
data__health,
data__schedule,
data__trigger,
data__continuous,
data__tasks,
data__job_clusters,
data__git_source,
data__tags,
data__queue,
data__parameters,
data__run_as,
data__deployment,
data__environments,
data__access_control_list,
deployment_name
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ timeout_seconds }}',
'{{ max_concurrent_runs }}',
'{{ format }}',
'{{ edit_mode }}',
'{{ email_notifications }}',
'{{ webhook_notifications }}',
'{{ notification_settings }}',
'{{ health }}',
'{{ schedule }}',
'{{ trigger }}',
'{{ continuous }}',
'{{ tasks }}',
'{{ job_clusters }}',
'{{ git_source }}',
'{{ tags }}',
'{{ queue }}',
'{{ parameters }}',
'{{ run_as }}',
'{{ deployment }}',
'{{ environments }}',
'{{ access_control_list }}',
'{{ deployment_name }}'
RETURNING
job_id
;

UPDATE examples

Add, update, or remove specific settings of an existing job. Use the

UPDATE databricks_workspace.workflows.jobs
SET
data__job_id = '{{ job_id }}',
data__fields_to_remove = {{ fields_to_remove }},
data__new_settings = '{{ new_settings }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

REPLACE examples

Overwrite all settings for the given job. Use the

REPLACE databricks_workspace.workflows.jobs
SET
data__job_id = '{{ job_id }}',
data__new_settings = '{{ new_settings }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes a job.

DELETE FROM databricks_workspace.workflows.jobs
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

Run a job and return the

EXEC databricks_workspace.workflows.jobs.runnow 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"job_id": "{{ job_id }}",
"idempotency_token": {{ idempotency_token }},
"job_parameters": "{{ job_parameters }}",
"pipeline_params": "{{ pipeline_params }}",
"queue": "{{ queue }}"
}';