---
title: Add tasks to jobs in Declarative Automation Bundles
description: Learn how to define tasks for jobs in Declarative Automation Bundles.
canonical_url: https://docs.databricks.com/aws/en/dev-tools/bundles/job-task-types
---

# Add tasks to jobs in Declarative Automation Bundles

This page provides information about how to define job tasks in Declarative Automation Bundles. For information about job tasks, see [Configure and edit tasks in Lakeflow Jobs](https://docs.databricks.com/aws/en/jobs/configure-task.md).

> [!IMPORTANT]
>
> The job `git_source` field and task `source` field set to `GIT` are not recommended for bundles, because local relative paths may not point to the same content in the Git repository. Bundles expect that a deployed job has the same files as the local copy from where it was deployed.
>
> Instead, clone the repository locally and set up your bundle project within this repository, so that the source for tasks are the workspace.

## Configure tasks

Define tasks for a job in a bundle in the `tasks` key for the job definition. Examples of task configuration for the available task types is in the [Task settings](https://docs.databricks.com/aws/en/dev-tools/bundles/job-task-types.md#task-settings) section. For information about defining a job in a bundle, see [job](https://docs.databricks.com/aws/en/dev-tools/bundles/resources.md#jobs).

> [!TIP]
>
> To quickly generate resource configuration for an existing job using the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/index.md), you can use the `bundle generate job` command. See [bundle commands](https://docs.databricks.com/aws/en/dev-tools/cli/bundle-commands.md#generate).

To set task values, most job task types have task-specific parameters, but you can also define [job parameters](https://docs.databricks.com/aws/en/jobs/job-parameters.md) that get passed to tasks. [Dynamic value references](https://docs.databricks.com/aws/en/jobs/dynamic-value-references.md) are supported for job parameters, which enable passing values that are specific to the job run between tasks. For complete information on how to pass task values by task type, see [Details by task type](https://docs.databricks.com/aws/en/jobs/parameter-use.md#details-by-task-type).

You can also override general job task settings with settings for a target workspace. See [Override with target settings](https://docs.databricks.com/aws/en/dev-tools/bundles/overrides.md).

The following example configuration defines a job with two notebook tasks, and passes a task value from the first task to the second task.

```yaml
resources:
  jobs:
    pass_task_values_job:
      name: pass_task_values_job
      tasks:
        # Output task
        - task_key: output_value
          notebook_task:
            notebook_path: ../src/output_notebook.ipynb

        # Input task
        - task_key: input_value
          depends_on:
            - task_key: output_value
          notebook_task:
            notebook_path: ../src/input_notebook.ipynb
            base_parameters:
              received_message: '{{tasks.output_value.values.message}}'
```

The `output_notebook.ipynb` contains the following code, which sets a task value for the `message` key:

```python
# Databricks notebook source
# This first task sets a simple output value.

message = "Hello from the first task"

# Set the message to be used by other tasks
dbutils.jobs.taskValues.set(key="message", value=message)

print(f"Produced message: {message}")
```

The `input_notebook.ipynb` retrieves the value of the parameter `received_message`, that was set in the configuration for the task:

```python
# This notebook receives the message as a parameter.

dbutils.widgets.text("received_message", "")
received_message = dbutils.widgets.get("received_message")

print(f"Received message: {received_message}")
```

## <a id="task-settings" />Task settings

This section contains settings and examples for each job task type.

### <a id="ai-function-task" />AI Function task

> [!NOTE]
> **Beta**
>
> The AI Function task, including support in Declarative Automation Bundles, is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md). Workspace admins can control access to the AI Function task from the **Previews** page. See [Manage Databricks previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md).

The AI Function task runs an AI function on every file in a Unity Catalog volume or every row of a table, and writes the results to a Unity Catalog table, when the `ai_function_task` field is present. Each run processes only the files or rows that were added, changed, or deleted since the previous run. For more information about AI Function tasks, see [AI Function tasks for jobs](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/index.md).

The following keys are available for an AI Function task. Set one input, `volume` or `delta_table`, and one function, `ai_parse_document`, `ai_extract`, or `ai_classify`. For the corresponding REST API object definition, see [ai\_function\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-ai_function_task).

*Added in Databricks CLI version 1.24.0*

| Key                 | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ai_classify`       | Map  | Classifies each row into labels you define. See [`ai_classify` task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/classification.md). Contains:<br /><ul><li>`version` (String): Required. The `ai_classify` version to run, for example `2.1`.</li><li>`inline_labels` (Map): Required. The labels. Contains `labels` (Sequence), where each label has a `name` (String) and an optional `description` (String). An `ai_classify` task takes 2 to 10 labels, or 1 to 10 if `multilabel` is `true`.</li><li>`instructions` (String): Guidance applied to every row.</li><li>`multilabel` (Boolean): Whether more than one label can be assigned to each input.</li><li>`enable_confidence_scores` (Boolean): Whether to include a confidence score for each label.</li><li>`enable_rationales` (Boolean): Whether to include a rationale for each classification.</li></ul>                                                                       |
| `ai_extract`        | Map  | Extracts the fields you define from each row. See [`ai_extract` task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/information-extraction.md). Contains:<br /><ul><li>`version` (String): Required. The `ai_extract` version to run, for example `2.1`.</li><li>`schema` (String): The fields to extract, as a JSON string in the format that [`ai_extract`](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_extract.md#arguments) expects.</li><li>`instructions` (String): Guidance applied to every field.</li><li>`mode` (String): Set to `MODE_PRECISION` to improve accuracy for complex fields and long documents. If you leave this out, the task uses standard extraction.</li><li>`enable_confidence_scores` (Boolean): Whether to include a confidence score for each extracted value.</li><li>`enable_citations` (Boolean): Whether to include a reference to the source text for each extracted value.</li></ul> |
| `ai_parse_document` | Map  | Parses each document. See [`ai_parse_document` task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/document-parsing.md). Contains:<br /><ul><li>`version` (String): Required. The `ai_parse_document` output schema version, for example `2.0`.</li><li>`description_element_types` (Sequence): The element types to generate AI descriptions for. Set `DESCRIPTION_ELEMENT_TYPE_ALL` for all supported types or `DESCRIPTION_ELEMENT_TYPE_FIGURE` for figures only. If you leave this out, the task generates no descriptions.</li><li>`image_output_path` (String): A volume path where rendered page and element images are written.</li></ul>                                                                                                                                                                                                                                                                                                  |
| `delta_table`       | Map  | A Unity Catalog table input. The function runs on each row. The table must have [change data feed](https://docs.databricks.com/aws/en/tables/features/change-data-feed.md) enabled. Contains:<br /><ul><li>`table_name` (String): Required. The three-part name of the table, or a reference to an earlier task's output table such as `{{tasks.<task_key>.output.table_name}}`.</li><li>`input_column` (String): Required. The column that holds the content to run the function on.</li><li>`merge_key_columns` (Sequence): The columns that identify a row across runs, such as a primary key. If you leave this out, the task uses the file's URI for a `FILE` column, or otherwise the table's [row tracking](https://docs.databricks.com/aws/en/tables/features/row-tracking.md) ID, which requires row tracking to be enabled on the table. See [ID column](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/index.md#id-column).</li></ul>             |
| `output`            | Map  | Required. The output table. The task creates and manages this table. Contains:<br /><ul><li>`catalog` (String): The catalog of the output table.</li><li>`schema` (String): The schema of the output table. The schema must already exist.</li><li>`table` (String): The name of the output table. If you leave this out, the task generates a name that stays the same across runs.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `volume`            | Map  | A Unity Catalog volume input. The function runs on each file. Contains:<br /><ul><li>`volume_path` (String): Required. The path to a volume or a folder in a volume, for example `/Volumes/main/finance/invoices`.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

#### Examples

The following example adds an `ai_parse_document` task to a job. The task parses each file in a volume and generates descriptions for figures only.

```yaml
resources:
  jobs:
    parse_invoices:
      name: parse_invoices
      tasks:
        - task_key: parsing
          ai_function_task:
            volume:
              volume_path: /Volumes/main/finance/invoices
            output:
              catalog: main
              schema: finance
            ai_parse_document:
              version: '2.0'
              description_element_types: [DESCRIPTION_ELEMENT_TYPE_FIGURE]
```

The following example parses the files in a volume and then extracts an invoice ID and a total from each parsed document. The `extraction` task reads the `parsing` task's output table with `{{tasks.parsing.output.table_name}}`, reads its `response` column, and uses its `id` column to identify rows. To classify the parsed documents instead, replace the `ai_extract` function with an `ai_classify` function, like the one in the `ai_classify` example, and set `output.table` to a new name such as `invoice_labels`. See [Use the output in a later task](https://docs.databricks.com/aws/en/jobs/tasks/ai-functions/index.md#chain).

```yaml
resources:
  jobs:
    parse_and_extract_invoices:
      name: parse_and_extract_invoices
      tasks:
        - task_key: parsing
          ai_function_task:
            volume:
              volume_path: /Volumes/main/finance/invoices
            output:
              catalog: main
              schema: finance
            ai_parse_document:
              version: '2.0'
        - task_key: extraction
          depends_on:
            - task_key: parsing
          ai_function_task:
            delta_table:
              table_name: '{{tasks.parsing.output.table_name}}'
              input_column: response
              merge_key_columns: [id]
            output:
              catalog: main
              schema: finance
              table: invoice_fields
            ai_extract:
              version: '2.1'
              schema: |
                {
                  "invoice_id": {"type": "string", "description": "Unique invoice identifier"},
                  "total_amount": {"type": "number", "description": "Total invoice amount"}
                }
```

The following example adds an `ai_extract` task that extracts the counterparty, effective date, and renewal term from each contract in a table, with a citation for each value.

```yaml
resources:
  jobs:
    extract_contract_fields:
      name: extract_contract_fields
      tasks:
        - task_key: extraction
          ai_function_task:
            delta_table:
              table_name: main.legal.contracts
              input_column: contract_text
              merge_key_columns: [contract_id]
            output:
              catalog: main
              schema: legal
            ai_extract:
              version: '2.1'
              schema: |
                {
                  "counterparty": {"type": "string", "description": "Legal name of the other party"},
                  "effective_date": {"type": "string", "description": "Date in YYYY-MM-DD format"},
                  "renewal_term_months": {"type": "integer", "description": "Length of the renewal term in months"}
                }
              instructions: Ignore text in exhibits and appendices.
              enable_citations: true
```

The following example adds an `ai_classify` task that labels each support ticket as `urgent` or `normal` and includes a rationale for each label.

```yaml
resources:
  jobs:
    classify_support_tickets:
      name: classify_support_tickets
      tasks:
        - task_key: classification
          ai_function_task:
            delta_table:
              table_name: main.support.tickets
              input_column: body
              merge_key_columns: [ticket_id]
            output:
              catalog: main
              schema: support
            ai_classify:
              version: '2.1'
              inline_labels:
                labels:
                  - name: urgent
                    description: The customer is blocked or reports an outage.
                  - name: normal
                    description: A question or a non-blocking issue.
              instructions: Prefer urgent when the ticket mentions production.
              enable_rationales: true
```

### <a id="ai-runtime-task" />AI Runtime task

The AI Runtime task runs a multi-GPU compute workload on Databricks AI Runtime when the `ai_runtime_task` field is present. You specify the accelerator type and count, the command to run on each node, and the MLflow experiment where run output is stored.

For code packaging, compute, and environment configuration, see [Configure AI Runtime bundle tasks](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/monitor-deploy/configure-bundle-tasks.md).

The following keys are available for an AI Runtime task. For the corresponding REST API object definition, see [ai\_runtime\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-ai_runtime_task).

*Added in Databricks CLI version 1.6.0*

| Key                           | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code_source_path`            | String   | Optional path to a packaged code archive. Use a local `tgz` bundle artifact or an uploaded `/Workspace/…` or `/Volumes/…` archive. The runtime extracts it on each node and sets `CODE_SOURCE_PATH` to the extracted code directory. This field is in Private Preview.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `deployments`                 | Sequence | Required. Deployment specs for this task. Exactly one deployment is currently supported (a single entry where every node runs the same command). Each deployment is an object that contains:<br /><ul><li>`command_path` (String): Required. The workspace path of the script to run on each node in this deployment. When the task runs, the file at this path is run on each node; if it fails, the task fails with its exit code.</li><li>`compute` (Map): Required. Compute resources allocated to each node in this deployment. Contains:<br /><ul><li>`accelerator_type` (String): Required. The hardware accelerator type, for example `GPU_1xA10` or `GPU_8xH100`. The number of accelerators per node is encoded in the value—`GPU_8xH100` means 8 H100 GPUs per node.</li><li>`accelerator_count` (Integer): Required. The total number of accelerators across all nodes. Must be a positive multiple of the per-node accelerator count encoded in `accelerator_type`. For example, `GPU_8xH100` with `accelerator_count: 16` allocates 2 nodes.</li></ul></li><li>`name` (String): An optional human-readable name for this deployment, for example `driver` or `worker`. Used for log and UI display.</li></ul> |
| `docker_image_url`            | String   | Optional Docker image URL in the format `{organization}/{repository}:{tag}`. When set, the task uses this image instead of the default Databricks image. This field is in Beta.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `experiment`                  | String   | Required. The MLflow experiment name for this run. If an experiment with this name already exists under the calling user, the run is appended to it; otherwise a new experiment is created. To target a specific MLflow storage location, set `mlflow_experiment_directory`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `mlflow_artifact_location`    | String   | Optional root location for MLflow artifacts logged by the run, such as `dbfs:/Volumes/<catalog>/<schema>/<volume>/artifacts`. Use a unique location for each experiment. For an existing experiment, match its artifact location or omit this field. This field is in Private Preview.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `mlflow_experiment_directory` | String   | An optional workspace directory under which the MLflow experiment named in `experiment` is created. Must start with `/Workspace`. Set this when running as a service principal that has no default user directory; for regular users the experiment defaults to the user's home directory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `mlflow_run`                  | String   | An optional display name for the MLflow run created under `experiment`. If omitted, MLflow generates a default name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

#### Examples

The following example adds an AI Runtime task to a job. The task runs `train.sh` on a single 8-GPU H100 node and stores output in the specified MLflow experiment:

```yaml
resources:
  jobs:
    my-ai-runtime-job:
      name: my-ai-runtime-job
      tasks:
        - task_key: train-task
          ai_runtime_task:
            experiment: /Users/someone@example.com/my-experiment
            deployments:
              - command_path: /Workspace/Users/someone@example.com/train.sh
                compute:
                  accelerator_type: GPU_8xH100
                  accelerator_count: 8
```

### <a id="alert-task" />Alert (v2) task

The alert (v2) task evaluates a Databricks alert and sends notifications to subscribers when the `alert_task` field is present. For more information about alert tasks, see [SQL alert task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/alert.md).

The following keys are available for an alert (v2) task. For the corresponding REST API object definition, see [alert\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-alert_task).

*Added in Databricks CLI version 0.296.0*

| Key              | Type     | Description                                                                                                                                                                                                                                                                                                              |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `alert_id`       | String   | The ID of the alert to evaluate. Only one of `alert_id` or `workspace_path` can be specified to identify the alert.                                                                                                                                                                                                      |
| `subscribers`    | Sequence | A list of subscribers to receive alert evaluation result notifications after the alert task is completed. The number of subscriptions is limited to 100. Each subscriber is an object with one of: `destination_id` (String) for a notification destination, or `user_name` (String) for a workspace user email address. |
| `warehouse_id`   | String   | The warehouse settings used by the alert task.                                                                                                                                                                                                                                                                           |
| `workspace_path` | String   | The path to the alert file in the workspace. The path must start with "/Workspace" and must be a normalized path. Only one of `alert_id` or `workspace_path` can be specified to identify the alert.                                                                                                                     |

#### Examples

The following example adds an alert task to a job:

```yaml
resources:
  jobs:
    my_job:
      name: my_job
      tasks:
        - task_key: alert_task
          alert_task:
            workspace_path: ./my_alert.dbalert.json
            warehouse_id: 1a111111a1111aa1
```

### <a id="clean-room-notebook-task" />Clean room notebook task

The clean room notebook task runs a clean rooms notebook when the `clean_rooms_notebook_task` field is present. For information about clean rooms, see [What is Databricks Clean Rooms?](https://docs.databricks.com/aws/en/clean-rooms/index.md).

The following keys are available for a [clean rooms notebook task](https://docs.databricks.com/aws/en/jobs/tasks/clean-room-notebook.md). For the corresponding REST API object definition, see [clean\_rooms\_notebook\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-clean_rooms_notebook_task).

*Added in Databricks CLI version 0.237.0*

| Key               | Type   | Description                                                                                                                                                                                     |
| ----------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clean_room_name` | String | Required. The clean room that the notebook belongs to.                                                                                                                                          |
| `etag`            | String | Checksum to validate the freshness of the notebook resource. It can be fetched by calling the [clean room assets get operation](https://docs.databricks.com/api/workspace/cleanroomassets/get). |
| `object`          | Map    | Base parameters to be used for the clean room notebook job.                                                                                                                                     |
| `notebook_name`   | String | Required. Name of the notebook being run.                                                                                                                                                       |

### <a id="condition" />Condition task

The `condition_task` enables you to add a task with if/else conditional logic to your job. The task evaluates a condition that can be used to control the execution of other tasks. The condition task does not require a cluster to execute and does not support retries or notifications. For more information about the if/else condition task, see [Add branching logic to a job with the If/else task](https://docs.databricks.com/aws/en/jobs/tasks/if-else.md).

The following keys are available for a condition task. For the corresponding REST API object definition, see [condition\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-condition_task).

| Key     | Type   | Description                                                                                                                                                                          |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `left`  | String | Required. The left operand of the condition. Can be a string value or a job state or a dynamic value reference such as `{{job.repair_count}}` or `{{tasks.task_key.values.output}}`. |
| `op`    | String | Required. The operator to use for comparison. Valid values are: `EQUAL_TO`, `NOT_EQUAL`, `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL`.                 |
| `right` | String | Required. The right operand of the condition. Can be a string value or a job state or a dynamic value reference.                                                                     |

#### Examples

The following example contains a condition task and a notebook task, where the notebook task only executes if the number of job repairs is less than 5.

```yaml
resources:
  jobs:
    my-job:
      name: my-job
      tasks:
        - task_key: condition_task
          condition_task:
            op: LESS_THAN
            left: '{{job.repair_count}}'
            right: '5'
        - task_key: notebook_task
          depends_on:
            - task_key: condition_task
              outcome: 'true'
          notebook_task:
            notebook_path: ../src/notebook.ipynb
```

### <a id="dashboard-task" />Dashboard task

You use this task to refresh a dashboard and send a snapshot to subscribers. For more information about dashboards in bundles, see [dashboard](https://docs.databricks.com/aws/en/dev-tools/bundles/resources.md#dashboards).

The following keys are available for a [dashboard task](https://docs.databricks.com/aws/en/jobs/tasks/dashboard.md). For the corresponding REST API object definition, see [dashboard\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-dashboard_task).

*Added in Databricks CLI version 0.248.0*

| Key            | Type   | Description                                                                                                                                                                                                                                                                                                  |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dashboard_id` | String | Required. The identifier of the dashboard to be refreshed. The dashboard must already exist.                                                                                                                                                                                                                 |
| `subscription` | Map    | The subscription configuration for sending the dashboard snapshot. Each subscription object can specify destination settings for where to send snapshots after the dashboard refresh completes. See [subscription](https://docs.databricks.com/api/workspace/jobs/create#tasks-dashboard_task-subscription). |
| `warehouse_id` | String | The warehouse ID to execute the dashboard with for the schedule. If not specified, the default warehouse of the dashboard will be used.                                                                                                                                                                      |

#### Examples

The following example adds a dashboard task to a job. When the job is run, the dashboard with the specified ID is refreshed.

```yaml
resources:
  jobs:
    my-dashboard-job:
      name: my-dashboard-job
      tasks:
        - task_key: my-dashboard-task
          dashboard_task:
            dashboard_id: 11111111-1111-1111-1111-111111111111
```

### <a id="dbt-task" />dbt task

You use this task to run one or more dbt commands. For more information about dbt, see [Connect to dbt Cloud](https://docs.databricks.com/aws/en/partners/prep/dbt-cloud.md).

The following keys are available for a [dbt task](https://docs.databricks.com/aws/en/jobs/tasks/dbt.md). For the corresponding REST API object definition, see [dbt\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-dbt_task).

| Key                  | Type     | Description                                                                                                                                                                                                                                                                                                                                             |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catalog`            | String   | The name of the catalog to use. The catalog value can only be specified if a `warehouse_id` is specified. This field requires dbt-databricks >= 1.1.1.                                                                                                                                                                                                  |
| `commands`           | Sequence | Required. A list of dbt commands to execute in sequence. Each command must be a complete dbt command (e.g., `dbt deps`, `dbt seed`, `dbt run`, `dbt test`). A maximum of up to 10 commands can be provided.                                                                                                                                             |
| `profiles_directory` | String   | The path to the directory containing the dbt profiles.yml file. Can only be specified if no `warehouse_id` is specified. If no `warehouse_id` is specified and this folder is unset, the root directory is used.                                                                                                                                        |
| `project_directory`  | String   | The path to the directory containing the dbt project. If not specified, defaults to the root of the repository or workspace directory. For projects stored in the Databricks workspace, the path must be absolute and begin with a slash. For projects in a remote repository, the path must be relative.                                               |
| `schema`             | String   | The schema to write to. This parameter is only used when a `warehouse_id` is also provided. If not provided, the default schema is used.                                                                                                                                                                                                                |
| `source`             | String   | The location type of the dbt project. Valid values are `WORKSPACE` and `GIT`. When set to `WORKSPACE`, the project will be retrieved from the Databricks workspace. When set to `GIT`, the project will be retrieved from a Git repository defined in `git_source`. If empty, the task uses `GIT` if `git_source` is defined and `WORKSPACE` otherwise. |
| `warehouse_id`       | String   | The ID of the SQL warehouse to use for running dbt commands. If not specified, the default warehouse will be used.                                                                                                                                                                                                                                      |

#### Examples

The following example adds a dbt task to a job. This dbt task uses the specified SQL warehouse to run the specified dbt commands.

To get a SQL warehouse's ID, open the SQL warehouse's settings page, then copy the ID found in parentheses after the name of the warehouse in the **Name** field on the **Overview** tab.

> [!TIP]
>
> Declarative Automation Bundles also includes a `dbt-sql` project template that defines a job with a dbt task, as well as dbt profiles for deployed dbt jobs. For information about Declarative Automation Bundles templates, see [Default bundle templates](https://docs.databricks.com/aws/en/dev-tools/bundles/templates.md#default-templates).

```yaml
resources:
  jobs:
    my-dbt-job:
      name: my-dbt-job
      tasks:
        - task_key: my-dbt-task
          dbt_task:
            commands:
              - 'dbt deps'
              - 'dbt seed'
              - 'dbt run'
            project_directory: /Users/someone@example.com/Testing
            warehouse_id: 1a111111a1111aa1
          libraries:
            - pypi:
                package: 'dbt-databricks>=1.0.0,<2.0.0'
```

### <a id="for-each" />For each task

The `for_each_task` enables you to add a task with a for each loop to your job. The task executes a nested task for every input provided. For more information about the `for_each_task`, see [Use a `For each` task to run another task in a loop](https://docs.databricks.com/aws/en/jobs/tasks/for-each.md).

The following keys are available for a `for_each_task`. For the corresponding REST API object definition, see [for\_each\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-for_each_task).

| Key           | Type    | Description                                                                                                                                                                                                     |
| ------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `concurrency` | Integer | The maximum number of task iterations that can run concurrently. If not specified, all iterations may run in parallel subject to cluster and workspace limits.                                                  |
| `inputs`      | String  | Required. The input data for the loop. This can be a JSON string or a reference to an array parameter. Each element in the array will be passed to one iteration of the nested task.                            |
| `task`        | Map     | Required. The nested task definition to execute for each input. This object contains the complete task specification including `task_key` and the task type (e.g., `notebook_task`, `python_wheel_task`, etc.). |

#### Examples

The following example adds a `for_each_task` to a job, where it loops over the values of another task and processes them.

```yaml
resources:
  jobs:
    my_job:
      name: my_job
      tasks:
        - task_key: generate_countries_list
          notebook_task:
            notebook_path: ../src/generate_countries_list.ipnyb
        - task_key: process_countries
          depends_on:
            - task_key: generate_countries_list
          for_each_task:
            inputs: '{{tasks.generate_countries_list.values.countries}}'
            task:
              task_key: process_countries_iteration
              notebook_task:
                notebook_path: ../src/process_countries_notebook.ipnyb
```

### <a id="jar" />JAR task

You use this task to run a JAR. You can reference local JAR libraries or those in a workspace, a Unity Catalog volume, or an external cloud storage location. See [JAR file (Java or Scala)](https://docs.databricks.com/aws/en/dev-tools/bundles/library-dependencies.md#jar).

For details on how to compile and deploy Scala JAR files on a Unity Catalog-enabled cluster in standard access mode, see [Tutorial: Run Scala code on serverless compute](https://docs.databricks.com/aws/en/dev-tools/databricks-connect/scala/jar-compile.md).

The following keys are available for a [JAR task](https://docs.databricks.com/aws/en/jobs/tasks/jar.md). For the corresponding REST API object definition, see [jar\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-jar_task).

| Key               | Type     | Description                                                                                                                                                                                                                                           |
| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `jar_uri`         | String   | Deprecated. The URI of the JAR to be executed. DBFS and cloud storage paths are supported. This field is deprecated and should not be used. Instead, use the `libraries` field to specify JAR dependencies.                                           |
| `main_class_name` | String   | Required. The full name of the class containing the main method to be executed. This class must be contained in a JAR provided as a library. The code must use `SparkContext.getOrCreate` to obtain a Spark context; otherwise, runs of the job fail. |
| `parameters`      | Sequence | The parameters passed to the main method. Use task parameter variables to set parameters containing information about job runs.                                                                                                                       |

#### Examples

The following example adds a JAR task to a job. The path for the JAR is to a volume location.

```yaml
resources:
  jobs:
    my-jar-job:
      name: my-jar-job
      tasks:
        - task_key: my-jar-task
          spark_jar_task:
            main_class_name: org.example.com.Main
          libraries:
            - jar: /Volumes/main/default/my-volume/my-project-0.1.0-SNAPSHOT.jar
```

### <a id="notebook-task" />Notebook task

You use this task to run a notebook. See [Notebook task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/notebook.md).

The following keys are available for a notebook task. For the corresponding REST API object definition, see [notebook\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-notebook_task).

| Key               | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `base_parameters` | Map    | The base parameters to use for each run of this job.<br /><ul><li>If the run is initiated by a call to jobs or run-now with parameters specified, the two parameters maps are merged.</li><li>If the same key is specified in `base_parameters` and in `run-now`, the value from `run-now` is used. Use task parameter variables to set parameters containing information about job runs.</li><li>If the notebook takes a parameter that is not specified in the job’s `base_parameters` or the `run-now` override parameters, the default value from the notebook is used. Retrieve these parameters in a notebook using `dbutils.widgets.get`.</li></ul> |
| `notebook_path`   | String | Required. The path of the notebook in the Databricks workspace or remote repository, for example `/Users/user.name@databricks.com/notebook_to_run`. For notebooks stored in the Databricks workspace, the path must be absolute and begin with a slash. For notebooks stored in a remote repository, the path must be relative.                                                                                                                                                                                                                                                                                                                            |
| `source`          | String | Location type of the notebook. Valid values are `WORKSPACE` and `GIT`. When set to `WORKSPACE`, the notebook will be retrieved from the local Databricks workspace. When set to `GIT`, the notebook will be retrieved from a Git repository defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise.                                                                                                                                                                                                                                                                                  |
| `warehouse_id`    | String | The ID of the warehouse to run the notebook on. Classic SQL warehouses are not supported. Use serverless or pro SQL warehouses instead. Note that SQL warehouses only support SQL cells. If the notebook contains non-SQL cells, the run will fail, so if you need to use Python (or other) in a cell, use serverless.                                                                                                                                                                                                                                                                                                                                     |

#### Examples

The following example adds a notebook task to a job and sets a job parameter named `my_job_run_id`. The path for the notebook to deploy is relative to the configuration file in which this task is declared. The task gets the notebook from its deployed location in the Databricks workspace.

```yaml
resources:
  jobs:
    my-notebook-job:
      name: my-notebook-job
      tasks:
        - task_key: my-notebook-task
          notebook_task:
            notebook_path: ./my-notebook.ipynb
      parameters:
        - name: my_job_run_id
          default: '{{job.run_id}}'
```

### <a id="pipeline-task" />Pipeline task

You use this task to run a pipeline. See [Spark Declarative Pipelines on Lakeflow](https://docs.databricks.com/aws/en/ldp/index.md).

The following keys are available for a [pipeline task](https://docs.databricks.com/aws/en/jobs/tasks/pipeline.md). For the corresponding REST API object definition, see [pipeline\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-pipeline_task).

| Key            | Type    | Description                                                                                                                                                                                                                                                                                                         |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `full_refresh` | Boolean | If true, a full refresh of the pipeline will be triggered, which will completely recompute all datasets in the pipeline. If false or omitted, only incremental data will be processed. For details, see [Pipeline refresh semantics](https://docs.databricks.com/aws/en/ldp/updates.md#pipeline-refresh-semantics). |
| `pipeline_id`  | String  | Required. The ID of the pipeline to run. The pipeline must already exist.                                                                                                                                                                                                                                           |

#### Examples

The following example adds a pipeline task to a job. This task runs the specified pipeline.

> [!TIP]
>
> You can get a pipelines's ID by opening the pipeline in the workspace and copying the **Pipeline ID** value on the **Pipeline details** tab of the pipeline's settings page.

```yaml
resources:
  jobs:
    my-pipeline-job:
      name: my-pipeline-job
      tasks:
        - task_key: my-pipeline-task
          pipeline_task:
            pipeline_id: 11111111-1111-1111-1111-111111111111
```

### <a id="power-bi-task" />Power BI task

> [!NOTE]
> **Preview**
>
> Power BI task type is in [Public Preview](https://docs.databricks.com/aws/en/release-notes/release-types.md).

Use this task to trigger a refresh of a Power BI semantic model (formerly known as a dataset).

The following keys are available for a [Power BI task](https://docs.databricks.com/aws/en/jobs/tasks/powerbi.md). For the corresponding REST API object definition, see [power\_bi\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-power_bi_task).

*Added in Databricks CLI version 0.248.0*

| Key                        | Type     | Description                                                                                                                                                  |
| -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `connection_resource_name` | String   | Required. The name of the Unity Catalog connection to authenticate from Databricks to Power BI.                                                              |
| `power_bi_model`           | String   | Required. The name of the Power BI semantic model (dataset) to update.                                                                                       |
| `refresh_after_update`     | Boolean  | Whether to refresh the Power BI semantic model after the update completes. Defaults to false.                                                                |
| `tables`                   | Sequence | A list of tables (each as a Map) to be exported to Power BI. See [tables](https://docs.databricks.com/api/workspace/jobs/create#tasks-power_bi_task-tables). |
| `warehouse_id`             | String   | The ID of the SQL warehouse to use as the Power BI datasource.                                                                                               |

#### Examples

The following example defines a Power BI task, which specifies a connection, the Power BI model to update, and the Databricks table to export.

```yaml
resources:
  jobs:
    my_job:
      name: my_job
      tasks:
        - task_key: power_bi_task
          power_bi_task:
            connection_resource_name: 'connection_name'
            power_bi_model:
              workspace_name: 'workspace_name'
              model_name: 'model_name'
              storage_mode: 'DIRECT_QUERY'
              authentication_method: 'OAUTH'
              overwrite_existing: false
            refresh_after_update: false
            tables:
              - catalog: 'main'
                schema: 'tpch'
                name: 'customers'
                storage_mode: 'DIRECT_QUERY'
            warehouse_id: '1a111111a1111aa1'
```

### <a id="python-script-task" />Python script task

You use this task to run a Python file.

The following keys are available for a [Python script task](https://docs.databricks.com/aws/en/jobs/tasks/python-script.md). For the corresponding REST API object definition, see [python\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-spark_python_task).

| Key           | Type     | Description                                                                                                                                                                                                                                                                                                                                                              |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `parameters`  | Sequence | The parameters to pass to the Python file. Use task parameter variables to set parameters containing information about job runs.                                                                                                                                                                                                                                         |
| `python_file` | String   | Required. The URI of the Python file to be executed, for example `/Users/someone@example.com/my-script.py`. For python files stored in the Databricks workspace, the path must be absolute and begin with /. For files stored in a remote repository, the path must be relative. This field does not support dynamic value references such as variables.                 |
| `source`      | String   | The location type of the Python file. Valid values are `WORKSPACE` and `GIT`. When set to `WORKSPACE`, the file will be retrieved from the local Databricks workspace. When set to `GIT`, the file will be retrieved from a Git repository defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. |

#### Examples

The following example adds a Python script task to a job. The path for the Python file to deploy is relative to the configuration file in which this task is declared. The task gets the Python file from its deployed location in the Databricks workspace.

```yaml
resources:
  jobs:
    my-python-script-job:
      name: my-python-script-job

      tasks:
        - task_key: my-python-script-task
          spark_python_task:
            python_file: ./my-script.py
```

### <a id="python-wheel-task" />Python wheel task

You use this task to run a Python wheel. See [Build a Python wheel file using Declarative Automation Bundles](https://docs.databricks.com/aws/en/dev-tools/bundles/python-wheel.md).

The following keys are available for a [Python wheel task](https://docs.databricks.com/aws/en/jobs/tasks/python-wheel.md). For the corresponding REST API object definition, see [python\_wheel\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-python_wheel_task).

| Key                | Type     | Description                                                                                                                                                                                                                                                                                                                                          |
| ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `entry_point`      | String   | Required. The named entry point to execute: function or class. If it does not exist in the metadata of the package it executes the function from the package directly using `$packageName.$entryPoint()`.                                                                                                                                            |
| `named_parameters` | Map      | The named parameters to pass to the Python wheel task, also know as *Keyword arguments*. A named parameter is a key-value pair with a string key and a string value. Both `parameters` and `named_parameters` cannot be specified. If `named_parameters` is specified, the `parameters` are passed as keyword arguments to the entry point function. |
| `package_name`     | String   | Required. The name of the Python package to execute. All dependencies must be installed in the environment. This does not check for or install any package dependencies.                                                                                                                                                                             |
| `parameters`       | Sequence | The parameters to pass to the Python wheel task, also known as *Positional arguments*. Each parameter is a string. If specified, `named_parameters` must not be specified.                                                                                                                                                                           |

#### Examples

The following example adds a Python wheel task to a job. The path for the Python wheel file to deploy is relative to the configuration file in which this task is declared. See [Declarative Automation Bundles library dependencies](https://docs.databricks.com/aws/en/dev-tools/bundles/library-dependencies.md).

```yaml
resources:
  jobs:
    my-python-wheel-job:
      name: my-python-wheel-job
      tasks:
        - task_key: my-python-wheel-task
          python_wheel_task:
            entry_point: run
            package_name: my_package
          libraries:
            - whl: ./my_package/dist/my_package-*.whl
```

### <a id="run-job-task" />Run job task

You use this task to run another job.

The following keys are available for a [run job task](https://docs.databricks.com/aws/en/jobs/tasks/run-job.md). For the corresponding REST API object definition, see [run\_job\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-run_job_task).

| Key               | Type    | Description                                                                                                                                                      |
| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `job_id`          | Integer | Required. The ID of the job to run. The job must already exist in the workspace.                                                                                 |
| `job_parameters`  | Map     | Job-level parameters to pass to the job being run. These parameters are accessible within the job's tasks.                                                       |
| `pipeline_params` | Map     | Parameters for the pipeline task. Used only if the job being run contains a pipeline task. Can include `full_refresh` to trigger a full refresh of the pipeline. |

#### Examples

The following example contains a run job task in the second job that runs the first job.

This example uses a [substitution](https://docs.databricks.com/aws/en/dev-tools/bundles/variables.md#substitutions) to retrieve the ID of the job to run. To get a job's ID from the UI, open the job in the workspace and copy the ID from the **Job ID** value in the **Job details** tab of the jobs's settings page.

```yaml
resources:
  jobs:
    my-first-job:
      name: my-first-job
      tasks:
        - task_key: my-first-job-task
          new_cluster:
            spark_version: '13.3.x-scala2.12'
            node_type_id: 'i3.xlarge'
            num_workers: 2
          notebook_task:
            notebook_path: ./src/test.py
    my_second_job:
      name: my-second-job
      tasks:
        - task_key: my-second-job-task
          run_job_task:
            job_id: ${resources.jobs.my-first-job.id}
```

### <a id="sql-task" />SQL task

You use this task to run a SQL file, query, or alert.

The following keys are available for a [SQL task](https://docs.databricks.com/aws/en/jobs/tasks/sql.md). For the corresponding REST API object definition, see [sql\_task](https://docs.databricks.com/api/workspace/jobs/create#tasks-sql_task).

| Key            | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `alert`        | Map    | Configuration for running a SQL alert. Contains:<br /><ul><li>`alert_id` (String): Required. The canonical identifier of the SQL alert to run.</li><li>`pause_subscriptions` (Boolean): Whether to pause alert subscriptions.</li><li>`subscriptions` (Sequence): List of subscription settings.</li></ul>                                                                                                                                  |
| `dashboard`    | Map    | Configuration for refreshing a SQL dashboard. Contains:<br /><ul><li>`dashboard_id` (String): Required. The canonical identifier of the SQL dashboard to refresh.</li><li>`custom_subject` (String): Custom subject for the email sent to dashboard subscribers.</li><li>`pause_subscriptions` (Boolean): Whether to pause dashboard subscriptions.</li><li>`subscriptions` (Sequence): List of subscription settings.</li></ul>            |
| `file`         | Map    | Configuration for running a SQL file. Contains:<br /><ul><li>`path` (String): Required. The path of the SQL file in the workspace or remote repository. For files stored in the Databricks workspace, the path must be absolute and begin with a slash. For files stored in a remote repository, the path must be relative.</li><li>`source` (String): The location type of the SQL file. Valid values are `WORKSPACE` and `GIT`.</li></ul> |
| `parameters`   | Map    | Parameters to be used for each run of this task. SQL queries and files can use these parameters by referencing them with the syntax `{{parameter_key}}`. Use task parameter variables to set parameters containing information about job runs.                                                                                                                                                                                              |
| `query`        | Map    | Configuration for running a SQL query. Contains:<br /><ul><li>`query_id` (String): Required. The canonical identifier of the SQL query to run.</li></ul>                                                                                                                                                                                                                                                                                    |
| `warehouse_id` | String | Required. The ID of the SQL warehouse to use to run the SQL task. The SQL warehouse must already exist.                                                                                                                                                                                                                                                                                                                                     |

#### Examples

> [!TIP]
>
> To get a SQL warehouse's ID, open the SQL warehouse's settings page, then copy the ID found in parentheses after the name of the warehouse in the **Name** field on the **Overview** tab.

The following example adds a SQL file task to a job. This SQL file task uses the specified SQL warehouse to run the specified SQL file.

```yaml
resources:
  jobs:
    my-sql-file-job:
      name: my-sql-file-job
      tasks:
        - task_key: my-sql-file-task
          sql_task:
            file:
              path: /Users/someone@example.com/hello-world.sql
              source: WORKSPACE
            warehouse_id: 1a111111a1111aa1
```

The following example adds a SQL alert task to a job. This SQL alert task uses the specified SQL warehouse to refresh the specified SQL alert.

```yaml
resources:
  jobs:
    my-sql-file-job:
      name: my-sql-alert-job
      tasks:
        - task_key: my-sql-alert-task
          sql_task:
            warehouse_id: 1a111111a1111aa1
            alert:
              alert_id: 11111111-1111-1111-1111-111111111111
```

The following example adds a SQL query task to a job. This SQL query task uses the specified SQL warehouse to run the specified SQL query.

```yaml
resources:
  jobs:
    my-sql-query-job:
      name: my-sql-query-job
      tasks:
        - task_key: my-sql-query-task
          sql_task:
            warehouse_id: 1a111111a1111aa1
            query:
              query_id: 11111111-1111-1111-1111-111111111111
```

### Other task settings

The following task settings allow you to configure behaviors for all tasks. For the corresponding REST API object definitions, see [tasks](https://docs.databricks.com/api/workspace/jobs/create#tasks).

| Key                         | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `compute`                   | Map      | Task level compute configuration. Each item contains:<br /><ul><li>`hardware_accelerator` (String): Hardware accelerator configuration for AI Runtime workloads. Valid values are `GPU_1xA10`, `GPU_1xH100`, `GPU_8xH100`, and `GPU_8xB300`.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `depends_on`                | Sequence | An optional list of task dependencies. Each item contains:<br /><ul><li>`task_key` (String): Required. The key of the task this task depends on.</li><li>`outcome` (String): Can be specified only for `condition_task`. If specified, the dependent task will only run if the condition evaluates to the specified outcome (either `true` or `false`).</li></ul>                                                                                                                                                                                                                                                                                                                                       |
| `description`               | String   | An optional description for the task.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `disable_auto_optimization` | Boolean  | Whether to disable serverless auto-optimization for this task. On serverless compute, auto-optimization can retry a failed task in addition to the retries in your retry policy, so set this to `true` if the task must run at most once. This setting has no effect on classic compute. See [Configure serverless compute auto-optimization to disallow retries](https://docs.databricks.com/aws/en/jobs/run-serverless-jobs.md#retry).                                                                                                                                                                                                                                                                |
| `email_notifications`       | Map      | An optional set of email addresses to notify when a run begins, completes, or fails. Each item contains:<br /><ul><li>`on_start` (Sequence): List of email addresses to notify when a run starts.</li><li>`on_success` (Sequence): List of email addresses to notify when a run completes successfully.</li><li>`on_failure` (Sequence): List of email addresses to notify when a run fails.</li><li>`on_duration_warning_threshold_exceeded` (Sequence): List of email addresses to notify when run duration exceeds the threshold.</li><li>`on_streaming_backlog_exceeded` (Sequence): List of email addresses to notify when any streaming backlog thresholds are exceeded for any stream.</li></ul> |
| `environment_key`           | String   | The key of an environment defined in the job's `environments` configuration. Used to specify environment-specific settings. This field is required for Python script, Python wheel and dbt tasks when using serverless compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `existing_cluster_id`       | String   | The ID of an existing cluster that will be used for all runs of this task.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `health`                    | Map      | An optional specification for health monitoring of this task that includes a `rules` key, which is a list of health rules to evaluate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `job_cluster_key`           | String   | The key of a job cluster defined in the job's `job_clusters` configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `libraries`                 | Sequence | An optional list of libraries to be installed on the cluster that will execute the task. Each library is specified as a map with keys like `jar`, `egg`, `whl`, `pypi`, `maven`, `cran`, or `requirements`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `max_retries`               | Integer  | An optional maximum number of times to retry the task if it fails. If not specified, the task will not be retried.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `min_retry_interval_millis` | Integer  | An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. If not specified, the default is 0 (immediate retry).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `new_cluster`               | Map      | A specification for a new cluster to be created for each run of this task. See [cluster](https://docs.databricks.com/aws/en/dev-tools/bundles/resources.md#clusters).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `notification_settings`     | Map      | Optional notification settings for this task. Each item contains:<br /><ul><li>`no_alert_for_skipped_runs` (Boolean): If true, do not send notifications for skipped runs.</li><li>`no_alert_for_canceled_runs` (Boolean): If true, do not send notifications for canceled runs.</li><li>`alert_on_last_attempt` (Boolean): If true, send notifications only on the last retry attempt.</li></ul>                                                                                                                                                                                                                                                                                                       |
| `retry_on_timeout`          | Boolean  | An optional policy to specify whether to retry the task when it times out. If not specified, defaults to false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `run_if`                    | String   | An optional value indicating the condition under which the task should run. Valid values are:<br /><ul><li>`ALL_SUCCESS` (default): Run if all dependencies succeed.</li><li>`AT_LEAST_ONE_SUCCESS`: Run if at least one dependency succeeds.</li><li>`NONE_FAILED`: Run if no dependencies have failed.</li><li>`ALL_DONE`: Run when all dependencies complete, regardless of outcome.</li><li>`AT_LEAST_ONE_FAILED`: Run if at least one dependency fails.</li><li>`ALL_FAILED`: Run if all dependencies fail.</li></ul>                                                                                                                                                                              |
| `task_key`                  | String   | Required. A unique name for the task. This field is used to refer to this task from other tasks using the `depends_on` field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `timeout_seconds`           | Integer  | An optional timeout applied to each run of this task. A value of 0 means no timeout. If not set, the default timeout from the cluster configuration is used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `webhook_notifications`     | Map      | An optional set of system destinations to notify when a run begins, completes, or fails. Each item contains:<br /><ul><li>`on_start` (Sequence): List of notification destinations when a run starts.</li><li>`on_success` (Sequence): List of notification destinations when a run completes.</li><li>`on_failure` (Sequence): List of notification destinations when a run fails.</li><li>`on_duration_warning_threshold_exceeded` (Sequence): List of notification destinations when run duration exceeds threshold.</li><li>`on_streaming_backlog_exceeded` (Sequence): List of up to 3 notification destinations when any streaming backlog thresholds are exceeded for any stream.</li></ul>      |
