Databricks SDK for JavaScript
    Preparing search index...
    interface TaskSettings {
        compute?: Compute;
        dependsOn?: TaskDependency[];
        description?: string;
        disableAutoOptimization?: boolean;
        disabled?: boolean;
        emailNotifications?: JobEmailNotifications;
        environmentRef?: { $case: "environmentKey"; environmentKey: string };
        health?: JobsHealthRules;
        libraries?: Library[];
        maxRetries?: number;
        minRetryIntervalMillis?: number;
        notificationSettings?: NotificationSettings;
        retryOnTimeout?: boolean;
        runIf?: TaskDependencyType;
        spec?:
            | { $case: "existingClusterId"; existingClusterId: string }
            | { $case: "newCluster"; newCluster: ClusterSpec_NewCluster }
            | { $case: "jobClusterKey"; jobClusterKey: string };
        task?:
            | { $case: "notebookTask"; notebookTask: NotebookTask }
            | { $case: "sparkJarTask"; sparkJarTask: SparkJarTask }
            | { $case: "sparkPythonTask"; sparkPythonTask: SparkPythonTask }
            | { $case: "sparkSubmitTask"; sparkSubmitTask: SparkSubmitTask }
            | { $case: "pipelineTask"; pipelineTask: PipelineTask }
            | { $case: "pythonWheelTask"; pythonWheelTask: PythonWheelTask }
            | { $case: "dbtTask"; dbtTask: DbtTask }
            | { $case: "sqlTask"; sqlTask: SqlTask }
            | { $case: "runJobTask"; runJobTask: RunJobTask }
            | { $case: "conditionTask"; conditionTask: ConditionTask }
            | { $case: "forEachTask"; forEachTask: ForEachTask }
            | {
                $case: "cleanRoomsNotebookTask";
                cleanRoomsNotebookTask: CleanRoomsNotebookTask;
            }
            | { $case: "genAiComputeTask"; genAiComputeTask: GenAiComputeTask }
            | { $case: "alertTask"; alertTask: AlertTask }
            | { $case: "powerBiTask"; powerBiTask: PowerBiTask }
            | { $case: "dashboardTask"; dashboardTask: DashboardTask }
            | { $case: "dbtCloudTask"; dbtCloudTask: DbtCloudTask }
            | { $case: "dbtPlatformTask"; dbtPlatformTask: DbtPlatformTask }
            | { $case: "pythonOperatorTask"; pythonOperatorTask: PythonOperatorTask };
        taskKey?: string;
        timeoutSeconds?: number;
        webhookNotifications?: WebhookNotifications;
    }
    Index

    Properties

    compute?: Compute

    Task level compute configuration.

    dependsOn?: TaskDependency[]

    An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete before executing this task. The task will run only if the run_if condition is true. The key is task_key, and the value is the name assigned to the dependent task.

    description?: string

    An optional description for this task.

    disableAutoOptimization?: boolean

    An option to disable auto optimization in serverless

    disabled?: boolean

    An optional flag to disable the task. If set to true, the task will not run even if it is part of a job.

    emailNotifications?: JobEmailNotifications

    An optional set of email addresses that is notified when runs of this task begin or complete as well as when this task is deleted. The default behavior is to not send any emails.

    environmentRef?: { $case: "environmentKey"; environmentKey: string }

    Type Declaration

    • $case: "environmentKey"
    • environmentKey: string

      The key that references an environment spec in a job. This field is required for Python script, Python wheel and dbt tasks when using serverless compute.

    libraries?: Library[]

    An optional list of libraries to be installed on the cluster. The default value is an empty list.

    maxRetries?: number

    An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the FAILED result_state or INTERNAL_ERROR life_cycle_state. The value -1 means to retry indefinitely and the value 0 means to never retry.

    minRetryIntervalMillis?: number

    An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.

    notificationSettings?: NotificationSettings

    Optional notification settings that are used when sending notifications to each of the email_notifications and webhook_notifications for this task.

    retryOnTimeout?: boolean

    An optional policy to specify whether to retry a job when it times out. The default behavior is to not retry on timeout.

    An optional value specifying the condition determining whether the task is run once its dependencies have been completed.

    • ALL_SUCCESS: All dependencies have executed and succeeded
    • AT_LEAST_ONE_SUCCESS: At least one dependency has succeeded
    • NONE_FAILED: None of the dependencies have failed and at least one was executed
    • ALL_DONE: All dependencies have been completed
    • AT_LEAST_ONE_FAILED: At least one dependency failed
    • ALL_FAILED: ALl dependencies have failed
    spec?:
        | { $case: "existingClusterId"; existingClusterId: string }
        | { $case: "newCluster"; newCluster: ClusterSpec_NewCluster }
        | { $case: "jobClusterKey"; jobClusterKey: string }

    Type Declaration

    • { $case: "existingClusterId"; existingClusterId: string }
      • $case: "existingClusterId"
      • existingClusterId: string

        If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops responding. We suggest running jobs and tasks on new clusters for greater reliability

    • { $case: "newCluster"; newCluster: ClusterSpec_NewCluster }
      • $case: "newCluster"
      • newCluster: ClusterSpec_NewCluster

        If new_cluster, a description of a new cluster that is created for each run.

    • { $case: "jobClusterKey"; jobClusterKey: string }
      • $case: "jobClusterKey"
      • jobClusterKey: string

        If job_cluster_key, this task is executed reusing the cluster specified in job.settings.job_clusters.

    task?:
        | { $case: "notebookTask"; notebookTask: NotebookTask }
        | { $case: "sparkJarTask"; sparkJarTask: SparkJarTask }
        | { $case: "sparkPythonTask"; sparkPythonTask: SparkPythonTask }
        | { $case: "sparkSubmitTask"; sparkSubmitTask: SparkSubmitTask }
        | { $case: "pipelineTask"; pipelineTask: PipelineTask }
        | { $case: "pythonWheelTask"; pythonWheelTask: PythonWheelTask }
        | { $case: "dbtTask"; dbtTask: DbtTask }
        | { $case: "sqlTask"; sqlTask: SqlTask }
        | { $case: "runJobTask"; runJobTask: RunJobTask }
        | { $case: "conditionTask"; conditionTask: ConditionTask }
        | { $case: "forEachTask"; forEachTask: ForEachTask }
        | {
            $case: "cleanRoomsNotebookTask";
            cleanRoomsNotebookTask: CleanRoomsNotebookTask;
        }
        | { $case: "genAiComputeTask"; genAiComputeTask: GenAiComputeTask }
        | { $case: "alertTask"; alertTask: AlertTask }
        | { $case: "powerBiTask"; powerBiTask: PowerBiTask }
        | { $case: "dashboardTask"; dashboardTask: DashboardTask }
        | { $case: "dbtCloudTask"; dbtCloudTask: DbtCloudTask }
        | { $case: "dbtPlatformTask"; dbtPlatformTask: DbtPlatformTask }
        | { $case: "pythonOperatorTask"; pythonOperatorTask: PythonOperatorTask }

    DO NOT ADD ANY NEW FIELDS TO JobTask OUTSIDE OF THIS ONEOF as it will break the TaskRegistry

    Type Declaration

    • { $case: "notebookTask"; notebookTask: NotebookTask }
      • $case: "notebookTask"
      • notebookTask: NotebookTask

        The task runs a notebook when the notebook_task field is present.

    • { $case: "sparkJarTask"; sparkJarTask: SparkJarTask }
      • $case: "sparkJarTask"
      • sparkJarTask: SparkJarTask

        The task runs a JAR when the spark_jar_task field is present.

    • { $case: "sparkPythonTask"; sparkPythonTask: SparkPythonTask }
      • $case: "sparkPythonTask"
      • sparkPythonTask: SparkPythonTask

        The task runs a Python file when the spark_python_task field is present.

    • { $case: "sparkSubmitTask"; sparkSubmitTask: SparkSubmitTask }
      • $case: "sparkSubmitTask"
      • sparkSubmitTask: SparkSubmitTask

        (Legacy) The task runs the spark-submit script when the spark_submit_task field is present. Databricks recommends using the spark_jar_task instead; see Spark Submit task for jobs.

    • { $case: "pipelineTask"; pipelineTask: PipelineTask }
      • $case: "pipelineTask"
      • pipelineTask: PipelineTask

        The task triggers a pipeline update when the pipeline_task field is present. Only pipelines configured to use triggered more are supported.

    • { $case: "pythonWheelTask"; pythonWheelTask: PythonWheelTask }
      • $case: "pythonWheelTask"
      • pythonWheelTask: PythonWheelTask

        The task runs a Python wheel when the python_wheel_task field is present.

    • { $case: "dbtTask"; dbtTask: DbtTask }
      • $case: "dbtTask"
      • dbtTask: DbtTask

        The task runs one or more dbt commands when the dbt_task field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse.

    • { $case: "sqlTask"; sqlTask: SqlTask }
      • $case: "sqlTask"
      • sqlTask: SqlTask

        The task runs a SQL query or file, or it refreshes a SQL alert or a legacy SQL dashboard when the sql_task field is present.

    • { $case: "runJobTask"; runJobTask: RunJobTask }
      • $case: "runJobTask"
      • runJobTask: RunJobTask

        The task triggers another job when the run_job_task field is present.

    • { $case: "conditionTask"; conditionTask: ConditionTask }
      • $case: "conditionTask"
      • conditionTask: ConditionTask

        The task evaluates a condition that can be used to control the execution of other tasks when the condition_task field is present. The condition task does not require a cluster to execute and does not support retries or notifications.

    • { $case: "forEachTask"; forEachTask: ForEachTask }
      • $case: "forEachTask"
      • forEachTask: ForEachTask

        The task executes a nested task for every input provided when the for_each_task field is present.

    • {
          $case: "cleanRoomsNotebookTask";
          cleanRoomsNotebookTask: CleanRoomsNotebookTask;
      }
      • $case: "cleanRoomsNotebookTask"
      • cleanRoomsNotebookTask: CleanRoomsNotebookTask

        The task runs a clean rooms notebook when the clean_rooms_notebook_task field is present.

    • { $case: "genAiComputeTask"; genAiComputeTask: GenAiComputeTask }
    • { $case: "alertTask"; alertTask: AlertTask }
      • $case: "alertTask"
      • alertTask: AlertTask

        The task evaluates a alert and sends notifications to subscribers when the alert_task field is present.

    • { $case: "powerBiTask"; powerBiTask: PowerBiTask }
      • $case: "powerBiTask"
      • powerBiTask: PowerBiTask

        The task triggers a Power BI semantic model update when the power_bi_task field is present.

    • { $case: "dashboardTask"; dashboardTask: DashboardTask }
      • $case: "dashboardTask"
      • dashboardTask: DashboardTask

        The task refreshes a dashboard and sends a snapshot to subscribers.

    • { $case: "dbtCloudTask"; dbtCloudTask: DbtCloudTask }
      • $case: "dbtCloudTask"
      • dbtCloudTask: DbtCloudTask

        Task type for dbt cloud, deprecated in favor of the new name dbt_platform_task

    • { $case: "dbtPlatformTask"; dbtPlatformTask: DbtPlatformTask }
    • { $case: "pythonOperatorTask"; pythonOperatorTask: PythonOperatorTask }
      • $case: "pythonOperatorTask"
      • pythonOperatorTask: PythonOperatorTask

        The task runs a Python operator task.

    taskKey?: string

    A unique name for the task. This field is used to refer to this task from other tasks. This field is required and must be unique within its parent job. On Update or Reset, this field is used to reference the tasks to be updated or reset.

    timeoutSeconds?: number

    An optional timeout applied to each run of this job task. A value of 0 means no timeout.

    webhookNotifications?: WebhookNotifications

    A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications.