job_runs
Creates, updates, deletes, gets or lists a job_runs resource.
Overview
| Name | job_runs |
| Type | Resource |
| Id | databricks_workspace.jobs.job_runs |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
effective_usage_policy_id | string | The id of the usage policy used by this run for cost attribution purposes. |
job_id | integer | The canonical identifier of the job that contains this run. |
job_run_id | integer | ID of the job run that this run belongs to. For legacy and single-task job runs the field is populated with the job run ID. For task runs, the field is populated with the ID of the job run that the task run belongs to. |
original_attempt_run_id | integer | If this run is a retry of a prior run attempt, this field contains the run_id of the original attempt; otherwise, it is the same as the run_id. |
run_id | integer | The canonical identifier of the run. This ID is unique across all runs of all jobs. |
creator_user_name | string | The creator user name. This field won’t be included in the response if the user has already been deleted. |
run_name | string | An optional name for the run. The maximum length is 4096 bytes in UTF-8 encoding. |
attempt_number | integer | The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy (`max_retries` > 0), subsequent runs are created with an `original_attempt_run_id` of the original attempt’s ID and an incrementing `attempt_number`. Runs are retried only until they succeed, and the maximum `attempt_number` is the same as the `max_retries` value for the job. |
cleanup_duration | integer | The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `cleanup_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
cluster_instance | object | The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run. |
cluster_spec | object | A snapshot of the job’s cluster specification when this run was created. |
description | string | Description of the run |
effective_performance_target | string | The actual performance target used by the serverless run during execution. This can differ from the client-set performance target on the request depending on whether the performance mode is supported by the job type. * `STANDARD`: Enables cost-efficient execution of serverless workloads. * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. (PERFORMANCE_OPTIMIZED, STANDARD) |
end_time | integer | The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running. |
execution_duration | integer | The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `execution_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
git_source | object | An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. |
has_more | boolean | Indicates if the run has more array properties (`tasks`, `job_clusters`) that are not shown. They can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests with `expand_tasks=true`. |
iterations | array | Only populated by for-each iterations. The parent for-each task is located in tasks array. |
job_clusters | array | A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. If more than 100 job clusters are available, you can paginate through them using :method:jobs/getrun. |
job_parameters | array | Job-level parameters used in the run |
next_page_token | string | A token that can be used to list the next page of array properties. |
number_in_job | integer | A unique identifier for this job run. This is set to the same value as `run_id`. |
overriding_parameters | object | The parameters used for this run. |
queue_duration | integer | The time in milliseconds that the run has spent in the queue. |
repair_history | array | The repair history of the run. |
run_duration | integer | The time in milliseconds it took the job run and all of its repairs to finish. |
run_page_url | string | The URL to the detail page of the run. |
run_type | string | The type of a run. * `JOB_RUN`: Normal job run. A run created with :method:jobs/runNow. *<br />`WORKFLOW_RUN`: Workflow run. A run created with [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit<br />run. A run created with :method:jobs/submit.<br /><br />[dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow (JOB_RUN, SUBMIT_RUN, WORKFLOW_RUN) |
schedule | object | The cron schedule that triggered this run if it was triggered by the periodic scheduler. |
setup_duration | integer | The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `setup_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
start_time | integer | The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued. |
state | object | Deprecated. Please use the `status` field instead. |
status | object | The current status of the run |
tasks | array | The list of tasks performed by the run. Each task has its own `run_id` which you can use to call `JobsGetOutput` to retrieve the run resutls. If more than 100 tasks are available, you can paginate through them using :method:jobs/getrun. Use the `next_page_token` field at the object root to determine if more results are available. |
trigger | string | The type of trigger that fired this run.<br /><br />* `PERIODIC`: Schedules that periodically trigger runs, such as a cron scheduler. * `ONE_TIME`:<br />One time triggers that fire a single run. This occurs you triggered a single run on demand<br />through the UI or the API. * `RETRY`: Indicates a run that is triggered as a retry of a<br />previously failed run. This occurs when you request to re-run the job in case of failures. *<br />`RUN_JOB_TASK`: Indicates a run that is triggered using a Run Job task. * `FILE_ARRIVAL`:<br />Indicates a run that is triggered by a file arrival. * `CONTINUOUS`: Indicates a run that is<br />triggered by a continuous job. * `TABLE`: Indicates a run that is triggered by a table update. *<br />`CONTINUOUS_RESTART`: Indicates a run created by user to manually restart a continuous job run.<br />* `MODEL`: Indicates a run that is triggered by a model update. (CONTINUOUS, CONTINUOUS_RESTART, FILE_ARRIVAL, ONE_TIME, PERIODIC, RETRY, RUN_JOB_TASK, TABLE) |
trigger_info | object | Additional details about what triggered the run |
| Name | Datatype | Description |
|---|---|---|
effective_usage_policy_id | string | The id of the usage policy used by this run for cost attribution purposes. |
job_id | integer | The canonical identifier of the job that contains this run. |
job_run_id | integer | ID of the job run that this run belongs to. For legacy and single-task job runs the field is populated with the job run ID. For task runs, the field is populated with the ID of the job run that the task run belongs to. |
original_attempt_run_id | integer | If this run is a retry of a prior run attempt, this field contains the run_id of the original attempt; otherwise, it is the same as the run_id. |
run_id | integer | The canonical identifier of the run. This ID is unique across all runs of all jobs. |
creator_user_name | string | The creator user name. This field won’t be included in the response if the user has already been deleted. |
run_name | string | An optional name for the run. The maximum length is 4096 bytes in UTF-8 encoding. |
attempt_number | integer | |
cleanup_duration | integer | The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `cleanup_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
cluster_instance | object | The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run. |
cluster_spec | object | A snapshot of the job’s cluster specification when this run was created. |
description | string | Description of the run |
effective_performance_target | string | PerformanceTarget defines how performant (lower latency) or cost efficient the execution of run<br />on serverless compute should be. The performance mode on the job or pipeline should map to a<br />performance setting that is passed to Cluster Manager (see cluster-common PerformanceTarget). (PERFORMANCE_OPTIMIZED, STANDARD) |
end_time | integer | The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running. |
execution_duration | integer | The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `execution_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
git_source | object | An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. |
has_more | boolean | Indicates if the run has more array properties (`tasks`, `job_clusters`) that are not shown. They can be accessed via :method:jobs/getrun endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests with `expand_tasks=true`. |
job_clusters | array | A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. If more than 100 job clusters are available, you can paginate through them using :method:jobs/getrun. |
job_parameters | array | Job-level parameters used in the run |
number_in_job | integer | A unique identifier for this job run. This is set to the same value as `run_id`. |
overriding_parameters | object | The parameters used for this run. |
queue_duration | integer | The time in milliseconds that the run has spent in the queue. |
repair_history | array | The repair history of the run. |
run_duration | integer | The time in milliseconds it took the job run and all of its repairs to finish. |
run_page_url | string | The URL to the detail page of the run. |
run_type | string | The type of a run. * `JOB_RUN`: Normal job run. A run created with :method:jobs/runNow. *<br />`WORKFLOW_RUN`: Workflow run. A run created with [dbutils.notebook.run]. * `SUBMIT_RUN`: Submit<br />run. A run created with :method:jobs/submit.<br /><br />[dbutils.notebook.run]: https://docs.databricks.com/dev-tools/databricks-utils.html#dbutils-workflow (JOB_RUN, SUBMIT_RUN, WORKFLOW_RUN) |
schedule | object | The cron schedule that triggered this run if it was triggered by the periodic scheduler. |
setup_duration | integer | The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the `setup_duration`, `execution_duration`, and the `cleanup_duration`. The `setup_duration` field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the `run_duration` field. |
start_time | integer | The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued. |
state | object | Deprecated. Please use the `status` field instead. |
status | object | The current status of the run |
tasks | array | The list of tasks performed by the run. Each task has its own `run_id` which you can use to call `JobsGetOutput` to retrieve the run resutls. If more than 100 tasks are available, you can paginate through them using :method:jobs/getrun. Use the `next_page_token` field at the object root to determine if more results are available. |
trigger | string | The type of trigger that fired this run.<br /><br />* `PERIODIC`: Schedules that periodically trigger runs, such as a cron scheduler. * `ONE_TIME`:<br />One time triggers that fire a single run. This occurs you triggered a single run on demand<br />through the UI or the API. * `RETRY`: Indicates a run that is triggered as a retry of a<br />previously failed run. This occurs when you request to re-run the job in case of failures. *<br />`RUN_JOB_TASK`: Indicates a run that is triggered using a Run Job task. * `FILE_ARRIVAL`:<br />Indicates a run that is triggered by a file arrival. * `CONTINUOUS`: Indicates a run that is<br />triggered by a continuous job. * `TABLE`: Indicates a run that is triggered by a table update. *<br />`CONTINUOUS_RESTART`: Indicates a run created by user to manually restart a continuous job run.<br />* `MODEL`: Indicates a run that is triggered by a model update. (CONTINUOUS, CONTINUOUS_RESTART, FILE_ARRIVAL, ONE_TIME, PERIODIC, RETRY, RUN_JOB_TASK, TABLE) |
trigger_info | object | Additional details about what triggered the run |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | run_id, deployment_name | include_history, include_resolved_values, page_token | Retrieves the metadata of a run. |
list | select | deployment_name | active_only, completed_only, expand_tasks, job_id, limit, offset, page_token, run_type, start_time_from, start_time_to | List runs in descending order by start time. |
submit | insert | deployment_name | Submit a one-time run. This endpoint allows you to submit a workload directly without creating a job. | |
delete | delete | deployment_name | Deletes a non-active run. Returns an error if the run is active. | |
cancel_all | exec | deployment_name | Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs | |
cancel | exec | deployment_name, run_id | Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when | |
export | exec | run_id, deployment_name | views_to_export | Export and retrieve the job run task. |
repair | exec | deployment_name, run_id | Re-run one or more tasks. Tasks are re-run as part of the original job run. They use the current job |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
run_id | integer | The canonical identifier for the run. This field is required. |
active_only | boolean | If active_only is true, only active runs are included in the results; otherwise, lists both active and completed runs. An active run is a run in the QUEUED, PENDING, RUNNING, or TERMINATING. This field cannot be true when completed_only is true. |
completed_only | boolean | If completed_only is true, only completed runs are included in the results; otherwise, lists both active and completed runs. This field cannot be true when active_only is true. |
expand_tasks | boolean | Whether to include task and cluster details in the response. Note that only the first 100 elements will be shown. Use :method:jobs/getrun to paginate through all tasks and clusters. |
include_history | boolean | Whether to include the repair history in the response. |
include_resolved_values | boolean | Whether to include resolved parameter values in the response. |
job_id | integer | The job for which to list runs. If omitted, the Jobs service lists runs from all jobs. |
limit | integer | The number of runs to return. This value must be greater than 0 and less than 25. The default value is 20. If a request specifies a limit of 0, the service instead uses the maximum limit. |
offset | integer | The offset of the first run to return, relative to the most recent run. Deprecated since June 2023. Use page_token to iterate through the pages instead. |
page_token | string | Use next_page_token or prev_page_token returned from the previous request to list the next or previous page of runs respectively. |
run_type | string | The type of runs to return. For a description of run types, see :method:jobs/getRun. |
start_time_from | integer | Show runs that started at or after this value. The value must be a UTC timestamp in milliseconds. Can be combined with start_time_to to filter by a time range. |
start_time_to | integer | Show runs that started at or before this value. The value must be a UTC timestamp in milliseconds. Can be combined with start_time_from to filter by a time range. |
views_to_export | string | Which views to export (CODE, DASHBOARDS, or ALL). Defaults to CODE. |
SELECT examples
- get
- list
Retrieves the metadata of a run.
SELECT
effective_usage_policy_id,
job_id,
job_run_id,
original_attempt_run_id,
run_id,
creator_user_name,
run_name,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
description,
effective_performance_target,
end_time,
execution_duration,
git_source,
has_more,
iterations,
job_clusters,
job_parameters,
next_page_token,
number_in_job,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
run_page_url,
run_type,
schedule,
setup_duration,
start_time,
state,
status,
tasks,
trigger,
trigger_info
FROM databricks_workspace.jobs.job_runs
WHERE run_id = '{{ run_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_history = '{{ include_history }}'
AND include_resolved_values = '{{ include_resolved_values }}'
AND page_token = '{{ page_token }}'
;
List runs in descending order by start time.
SELECT
effective_usage_policy_id,
job_id,
job_run_id,
original_attempt_run_id,
run_id,
creator_user_name,
run_name,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
description,
effective_performance_target,
end_time,
execution_duration,
git_source,
has_more,
job_clusters,
job_parameters,
number_in_job,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
run_page_url,
run_type,
schedule,
setup_duration,
start_time,
state,
status,
tasks,
trigger,
trigger_info
FROM databricks_workspace.jobs.job_runs
WHERE deployment_name = '{{ deployment_name }}' -- required
AND active_only = '{{ active_only }}'
AND completed_only = '{{ completed_only }}'
AND expand_tasks = '{{ expand_tasks }}'
AND job_id = '{{ job_id }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND page_token = '{{ page_token }}'
AND run_type = '{{ run_type }}'
AND start_time_from = '{{ start_time_from }}'
AND start_time_to = '{{ start_time_to }}'
;
INSERT examples
- submit
- Manifest
Submit a one-time run. This endpoint allows you to submit a workload directly without creating a job.
INSERT INTO databricks_workspace.jobs.job_runs (
access_control_list,
budget_policy_id,
email_notifications,
environments,
git_source,
health,
idempotency_token,
notification_settings,
queue,
run_as,
run_name,
tasks,
timeout_seconds,
usage_policy_id,
webhook_notifications,
deployment_name
)
SELECT
'{{ access_control_list }}',
'{{ budget_policy_id }}',
'{{ email_notifications }}',
'{{ environments }}',
'{{ git_source }}',
'{{ health }}',
'{{ idempotency_token }}',
'{{ notification_settings }}',
'{{ queue }}',
'{{ run_as }}',
'{{ run_name }}',
'{{ tasks }}',
{{ timeout_seconds }},
'{{ usage_policy_id }}',
'{{ webhook_notifications }}',
'{{ deployment_name }}'
RETURNING
effective_usage_policy_id,
job_id,
job_run_id,
original_attempt_run_id,
run_id,
creator_user_name,
run_name,
attempt_number,
cleanup_duration,
cluster_instance,
cluster_spec,
description,
effective_performance_target,
end_time,
execution_duration,
git_source,
has_more,
iterations,
job_clusters,
job_parameters,
next_page_token,
number_in_job,
overriding_parameters,
queue_duration,
repair_history,
run_duration,
run_page_url,
run_type,
schedule,
setup_duration,
start_time,
state,
status,
tasks,
trigger,
trigger_info
;
# Description fields are for documentation purposes
- name: job_runs
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the job_runs resource.
- name: access_control_list
description: |
List of permissions to set on the job.
value:
- group_name: "{{ group_name }}"
permission_level: "{{ permission_level }}"
service_principal_name: "{{ service_principal_name }}"
user_name: "{{ user_name }}"
- name: budget_policy_id
value: "{{ budget_policy_id }}"
description: |
The user specified id of the budget policy to use for this one-time run. If not specified, the run will be not be attributed to any budget policy.
- name: email_notifications
description: |
An optional set of email addresses notified when the run begins or completes.
value:
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
on_duration_warning_threshold_exceeded:
- "{{ on_duration_warning_threshold_exceeded }}"
on_failure:
- "{{ on_failure }}"
on_start:
- "{{ on_start }}"
on_streaming_backlog_exceeded:
- "{{ on_streaming_backlog_exceeded }}"
on_success:
- "{{ on_success }}"
- name: environments
description: |
A list of task execution environment specifications that can be referenced by tasks of this run.
value:
- environment_key: "{{ environment_key }}"
spec: "{{ spec }}"
- name: git_source
description: |
An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job.
value:
git_url: "{{ git_url }}"
git_provider: "{{ git_provider }}"
git_branch: "{{ git_branch }}"
git_commit: "{{ git_commit }}"
git_snapshot:
used_commit: "{{ used_commit }}"
git_tag: "{{ git_tag }}"
job_source:
job_config_path: "{{ job_config_path }}"
import_from_git_branch: "{{ import_from_git_branch }}"
dirty_state: "{{ dirty_state }}"
- name: health
description: |
:param idempotency_token: str (optional) An optional token that can be used to guarantee the idempotency of job run requests. If a run with the provided token already exists, the request does not create a new run but returns the ID of the existing run instead. If a run with the provided token is deleted, an error is returned. If you specify the idempotency token, upon failure you can retry until the request succeeds. Databricks guarantees that exactly one run is launched with that idempotency token. This token must have at most 64 characters. For more information, see [How to ensure idempotency for jobs]. [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html
value:
rules:
- metric: "{{ metric }}"
op: "{{ op }}"
value: {{ value }}
- name: idempotency_token
value: "{{ idempotency_token }}"
- name: notification_settings
description: |
Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this run.
value:
no_alert_for_canceled_runs: {{ no_alert_for_canceled_runs }}
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
- name: queue
description: |
The queue settings of the one-time run.
value:
enabled: {{ enabled }}
- name: run_as
description: |
Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who submits the request.
value:
group_name: "{{ group_name }}"
service_principal_name: "{{ service_principal_name }}"
user_name: "{{ user_name }}"
- name: run_name
value: "{{ run_name }}"
description: |
An optional name for the run. The default value is `Untitled`.
- name: tasks
description: |
:param timeout_seconds: int (optional) An optional timeout applied to each run of this job. A value of `0` means no timeout.
value:
- task_key: "{{ task_key }}"
clean_rooms_notebook_task:
clean_room_name: "{{ clean_room_name }}"
notebook_name: "{{ notebook_name }}"
etag: "{{ etag }}"
notebook_base_parameters: "{{ notebook_base_parameters }}"
compute:
hardware_accelerator: "{{ hardware_accelerator }}"
condition_task:
op: "{{ op }}"
left: "{{ left }}"
right: "{{ right }}"
dashboard_task:
dashboard_id: "{{ dashboard_id }}"
filters: "{{ filters }}"
subscription:
custom_subject: "{{ custom_subject }}"
paused: {{ paused }}
subscribers:
- destination_id: "{{ destination_id }}"
user_name: "{{ user_name }}"
warehouse_id: "{{ warehouse_id }}"
dbt_cloud_task:
connection_resource_name: "{{ connection_resource_name }}"
dbt_cloud_job_id: {{ dbt_cloud_job_id }}
dbt_platform_task:
connection_resource_name: "{{ connection_resource_name }}"
dbt_platform_job_id: "{{ dbt_platform_job_id }}"
dbt_task:
commands:
- "{{ commands }}"
catalog: "{{ catalog }}"
profiles_directory: "{{ profiles_directory }}"
project_directory: "{{ project_directory }}"
schema: "{{ schema }}"
source: "{{ source }}"
warehouse_id: "{{ warehouse_id }}"
depends_on: "{{ depends_on }}"
description: "{{ description }}"
email_notifications:
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
on_duration_warning_threshold_exceeded:
- "{{ on_duration_warning_threshold_exceeded }}"
on_failure:
- "{{ on_failure }}"
on_start:
- "{{ on_start }}"
on_streaming_backlog_exceeded:
- "{{ on_streaming_backlog_exceeded }}"
on_success:
- "{{ on_success }}"
environment_key: "{{ environment_key }}"
existing_cluster_id: "{{ existing_cluster_id }}"
for_each_task:
inputs: "{{ inputs }}"
task:
task_key: "{{ task_key }}"
clean_rooms_notebook_task:
clean_room_name: "{{ clean_room_name }}"
notebook_name: "{{ notebook_name }}"
etag: "{{ etag }}"
notebook_base_parameters: "{{ notebook_base_parameters }}"
compute:
hardware_accelerator: "{{ hardware_accelerator }}"
condition_task:
op: "{{ op }}"
left: "{{ left }}"
right: "{{ right }}"
dashboard_task:
dashboard_id: "{{ dashboard_id }}"
filters: "{{ filters }}"
subscription:
custom_subject: "{{ custom_subject }}"
paused: {{ paused }}
subscribers: "{{ subscribers }}"
warehouse_id: "{{ warehouse_id }}"
dbt_cloud_task:
connection_resource_name: "{{ connection_resource_name }}"
dbt_cloud_job_id: {{ dbt_cloud_job_id }}
dbt_platform_task:
connection_resource_name: "{{ connection_resource_name }}"
dbt_platform_job_id: "{{ dbt_platform_job_id }}"
dbt_task:
commands:
- "{{ commands }}"
catalog: "{{ catalog }}"
profiles_directory: "{{ profiles_directory }}"
project_directory: "{{ project_directory }}"
schema: "{{ schema }}"
source: "{{ source }}"
warehouse_id: "{{ warehouse_id }}"
depends_on:
- task_key: "{{ task_key }}"
outcome: "{{ outcome }}"
description: "{{ description }}"
disable_auto_optimization: {{ disable_auto_optimization }}
disabled: {{ disabled }}
email_notifications:
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
on_duration_warning_threshold_exceeded:
- "{{ on_duration_warning_threshold_exceeded }}"
on_failure:
- "{{ on_failure }}"
on_start:
- "{{ on_start }}"
on_streaming_backlog_exceeded:
- "{{ on_streaming_backlog_exceeded }}"
on_success:
- "{{ on_success }}"
environment_key: "{{ environment_key }}"
existing_cluster_id: "{{ existing_cluster_id }}"
for_each_task:
inputs: "{{ inputs }}"
task:
task_key: "{{ task_key }}"
clean_rooms_notebook_task: "{{ clean_rooms_notebook_task }}"
compute: "{{ compute }}"
condition_task: "{{ condition_task }}"
dashboard_task: "{{ dashboard_task }}"
dbt_cloud_task: "{{ dbt_cloud_task }}"
dbt_platform_task: "{{ dbt_platform_task }}"
dbt_task: "{{ dbt_task }}"
depends_on: "{{ depends_on }}"
description: "{{ description }}"
disable_auto_optimization: {{ disable_auto_optimization }}
disabled: {{ disabled }}
email_notifications: "{{ email_notifications }}"
environment_key: "{{ environment_key }}"
existing_cluster_id: "{{ existing_cluster_id }}"
for_each_task: "{{ for_each_task }}"
gen_ai_compute_task: "{{ gen_ai_compute_task }}"
health: "{{ health }}"
job_cluster_key: "{{ job_cluster_key }}"
libraries: "{{ libraries }}"
max_retries: {{ max_retries }}
min_retry_interval_millis: {{ min_retry_interval_millis }}
new_cluster: "{{ new_cluster }}"
notebook_task: "{{ notebook_task }}"
notification_settings: "{{ notification_settings }}"
pipeline_task: "{{ pipeline_task }}"
power_bi_task: "{{ power_bi_task }}"
python_wheel_task: "{{ python_wheel_task }}"
retry_on_timeout: {{ retry_on_timeout }}
run_if: "{{ run_if }}"
run_job_task: "{{ run_job_task }}"
spark_jar_task: "{{ spark_jar_task }}"
spark_python_task: "{{ spark_python_task }}"
spark_submit_task: "{{ spark_submit_task }}"
sql_task: "{{ sql_task }}"
timeout_seconds: {{ timeout_seconds }}
webhook_notifications: "{{ webhook_notifications }}"
concurrency: {{ concurrency }}
gen_ai_compute_task:
dl_runtime_image: "{{ dl_runtime_image }}"
command: "{{ command }}"
compute:
num_gpus: {{ num_gpus }}
gpu_node_pool_id: "{{ gpu_node_pool_id }}"
gpu_type: "{{ gpu_type }}"
mlflow_experiment_name: "{{ mlflow_experiment_name }}"
source: "{{ source }}"
training_script_path: "{{ training_script_path }}"
yaml_parameters: "{{ yaml_parameters }}"
yaml_parameters_file_path: "{{ yaml_parameters_file_path }}"
health:
rules:
- metric: "{{ metric }}"
op: "{{ op }}"
value: {{ value }}
job_cluster_key: "{{ job_cluster_key }}"
libraries: "{{ libraries }}"
max_retries: {{ max_retries }}
min_retry_interval_millis: {{ min_retry_interval_millis }}
new_cluster: "{{ new_cluster }}"
notebook_task:
notebook_path: "{{ notebook_path }}"
base_parameters: "{{ base_parameters }}"
source: "{{ source }}"
warehouse_id: "{{ warehouse_id }}"
notification_settings:
alert_on_last_attempt: {{ alert_on_last_attempt }}
no_alert_for_canceled_runs: {{ no_alert_for_canceled_runs }}
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
pipeline_task:
pipeline_id: "{{ pipeline_id }}"
full_refresh: {{ full_refresh }}
power_bi_task:
connection_resource_name: "{{ connection_resource_name }}"
power_bi_model:
authentication_method: "{{ authentication_method }}"
model_name: "{{ model_name }}"
overwrite_existing: {{ overwrite_existing }}
storage_mode: "{{ storage_mode }}"
workspace_name: "{{ workspace_name }}"
refresh_after_update: {{ refresh_after_update }}
tables:
- catalog: "{{ catalog }}"
name: "{{ name }}"
schema: "{{ schema }}"
storage_mode: "{{ storage_mode }}"
warehouse_id: "{{ warehouse_id }}"
python_wheel_task:
package_name: "{{ package_name }}"
entry_point: "{{ entry_point }}"
named_parameters: "{{ named_parameters }}"
parameters:
- "{{ parameters }}"
retry_on_timeout: {{ retry_on_timeout }}
run_if: "{{ run_if }}"
run_job_task:
job_id: {{ job_id }}
dbt_commands:
- "{{ dbt_commands }}"
jar_params:
- "{{ jar_params }}"
job_parameters: "{{ job_parameters }}"
notebook_params: "{{ notebook_params }}"
pipeline_params:
full_refresh: {{ full_refresh }}
python_named_params: "{{ python_named_params }}"
python_params:
- "{{ python_params }}"
spark_submit_params:
- "{{ spark_submit_params }}"
sql_params: "{{ sql_params }}"
spark_jar_task:
jar_uri: "{{ jar_uri }}"
main_class_name: "{{ main_class_name }}"
parameters:
- "{{ parameters }}"
run_as_repl: {{ run_as_repl }}
spark_python_task:
python_file: "{{ python_file }}"
parameters:
- "{{ parameters }}"
source: "{{ source }}"
spark_submit_task:
parameters:
- "{{ parameters }}"
sql_task:
warehouse_id: "{{ warehouse_id }}"
alert:
alert_id: "{{ alert_id }}"
pause_subscriptions: {{ pause_subscriptions }}
subscriptions: "{{ subscriptions }}"
dashboard:
dashboard_id: "{{ dashboard_id }}"
custom_subject: "{{ custom_subject }}"
pause_subscriptions: {{ pause_subscriptions }}
subscriptions: "{{ subscriptions }}"
file:
path: "{{ path }}"
source: "{{ source }}"
parameters: "{{ parameters }}"
query:
query_id: "{{ query_id }}"
timeout_seconds: {{ timeout_seconds }}
webhook_notifications:
on_duration_warning_threshold_exceeded:
- id: "{{ id }}"
on_failure:
- id: "{{ id }}"
on_start:
- id: "{{ id }}"
on_streaming_backlog_exceeded:
- id: "{{ id }}"
on_success:
- id: "{{ id }}"
concurrency: {{ concurrency }}
gen_ai_compute_task:
dl_runtime_image: "{{ dl_runtime_image }}"
command: "{{ command }}"
compute:
num_gpus: {{ num_gpus }}
gpu_node_pool_id: "{{ gpu_node_pool_id }}"
gpu_type: "{{ gpu_type }}"
mlflow_experiment_name: "{{ mlflow_experiment_name }}"
source: "{{ source }}"
training_script_path: "{{ training_script_path }}"
yaml_parameters: "{{ yaml_parameters }}"
yaml_parameters_file_path: "{{ yaml_parameters_file_path }}"
health:
rules:
- metric: "{{ metric }}"
op: "{{ op }}"
value: {{ value }}
libraries: "{{ libraries }}"
new_cluster: "{{ new_cluster }}"
notebook_task:
notebook_path: "{{ notebook_path }}"
base_parameters: "{{ base_parameters }}"
source: "{{ source }}"
warehouse_id: "{{ warehouse_id }}"
notification_settings:
alert_on_last_attempt: {{ alert_on_last_attempt }}
no_alert_for_canceled_runs: {{ no_alert_for_canceled_runs }}
no_alert_for_skipped_runs: {{ no_alert_for_skipped_runs }}
pipeline_task:
pipeline_id: "{{ pipeline_id }}"
full_refresh: {{ full_refresh }}
power_bi_task:
connection_resource_name: "{{ connection_resource_name }}"
power_bi_model:
authentication_method: "{{ authentication_method }}"
model_name: "{{ model_name }}"
overwrite_existing: {{ overwrite_existing }}
storage_mode: "{{ storage_mode }}"
workspace_name: "{{ workspace_name }}"
refresh_after_update: {{ refresh_after_update }}
tables:
- catalog: "{{ catalog }}"
name: "{{ name }}"
schema: "{{ schema }}"
storage_mode: "{{ storage_mode }}"
warehouse_id: "{{ warehouse_id }}"
python_wheel_task:
package_name: "{{ package_name }}"
entry_point: "{{ entry_point }}"
named_parameters: "{{ named_parameters }}"
parameters:
- "{{ parameters }}"
run_if: "{{ run_if }}"
run_job_task:
job_id: {{ job_id }}
dbt_commands:
- "{{ dbt_commands }}"
jar_params:
- "{{ jar_params }}"
job_parameters: "{{ job_parameters }}"
notebook_params: "{{ notebook_params }}"
pipeline_params:
full_refresh: {{ full_refresh }}
python_named_params: "{{ python_named_params }}"
python_params:
- "{{ python_params }}"
spark_submit_params:
- "{{ spark_submit_params }}"
sql_params: "{{ sql_params }}"
spark_jar_task:
jar_uri: "{{ jar_uri }}"
main_class_name: "{{ main_class_name }}"
parameters:
- "{{ parameters }}"
run_as_repl: {{ run_as_repl }}
spark_python_task:
python_file: "{{ python_file }}"
parameters:
- "{{ parameters }}"
source: "{{ source }}"
spark_submit_task:
parameters:
- "{{ parameters }}"
sql_task:
warehouse_id: "{{ warehouse_id }}"
alert:
alert_id: "{{ alert_id }}"
pause_subscriptions: {{ pause_subscriptions }}
subscriptions:
- destination_id: "{{ destination_id }}"
user_name: "{{ user_name }}"
dashboard:
dashboard_id: "{{ dashboard_id }}"
custom_subject: "{{ custom_subject }}"
pause_subscriptions: {{ pause_subscriptions }}
subscriptions:
- destination_id: "{{ destination_id }}"
user_name: "{{ user_name }}"
file:
path: "{{ path }}"
source: "{{ source }}"
parameters: "{{ parameters }}"
query:
query_id: "{{ query_id }}"
timeout_seconds: {{ timeout_seconds }}
webhook_notifications:
on_duration_warning_threshold_exceeded:
- id: "{{ id }}"
on_failure:
- id: "{{ id }}"
on_start:
- id: "{{ id }}"
on_streaming_backlog_exceeded:
- id: "{{ id }}"
on_success:
- id: "{{ id }}"
- name: timeout_seconds
value: {{ timeout_seconds }}
- name: usage_policy_id
value: "{{ usage_policy_id }}"
description: |
The user specified id of the usage policy to use for this one-time run. If not specified, a default usage policy may be applied when creating or modifying the job.
- name: webhook_notifications
description: |
A collection of system notification IDs to notify when the run begins or completes.
value:
on_duration_warning_threshold_exceeded:
- id: "{{ id }}"
on_failure:
- id: "{{ id }}"
on_start:
- id: "{{ id }}"
on_streaming_backlog_exceeded:
- id: "{{ id }}"
on_success:
- id: "{{ id }}"
DELETE examples
- delete
Deletes a non-active run. Returns an error if the run is active.
DELETE FROM databricks_workspace.jobs.job_runs
WHERE deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- cancel_all
- cancel
- export
- repair
Cancels all active runs of a job. The runs are canceled asynchronously, so it doesn't prevent new runs
EXEC databricks_workspace.jobs.job_runs.cancel_all
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"all_queued_runs": {{ all_queued_runs }},
"job_id": {{ job_id }}
}'
;
Cancels a job run or a task run. The run is canceled asynchronously, so it may still be running when
EXEC databricks_workspace.jobs.job_runs.cancel
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": {{ run_id }}
}'
;
Export and retrieve the job run task.
EXEC databricks_workspace.jobs.job_runs.export
@run_id='{{ run_id }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@views_to_export='{{ views_to_export }}'
;
Re-run one or more tasks. Tasks are re-run as part of the original job run. They use the current job
EXEC databricks_workspace.jobs.job_runs.repair
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"run_id": {{ run_id }},
"dbt_commands": "{{ dbt_commands }}",
"jar_params": "{{ jar_params }}",
"job_parameters": "{{ job_parameters }}",
"latest_repair_id": {{ latest_repair_id }},
"notebook_params": "{{ notebook_params }}",
"performance_target": "{{ performance_target }}",
"pipeline_params": "{{ pipeline_params }}",
"python_named_params": "{{ python_named_params }}",
"python_params": "{{ python_params }}",
"rerun_all_failed_tasks": {{ rerun_all_failed_tasks }},
"rerun_dependent_tasks": {{ rerun_dependent_tasks }},
"rerun_tasks": "{{ rerun_tasks }}",
"spark_submit_params": "{{ spark_submit_params }}",
"sql_params": "{{ sql_params }}"
}'
;