Databricks SDK for JavaScript
    Preparing search index...

    Used when outputting a child run, in GetRun or ListRuns.

    interface RunTask {
        attemptNumber?: number;
        cleanupDuration?: bigint;
        clusterInstance?: ClusterInstance;
        compute?: Compute;
        dependsOn?: TaskDependency[];
        description?: string;
        disableAutoOptimization?: boolean;
        disabled?: boolean;
        effectivePerformanceTarget?: PerformanceTarget_PerformanceTarget;
        emailNotifications?: JobEmailNotifications;
        endTime?: bigint;
        environmentRef?: { $case: "environmentKey"; environmentKey: string };
        executionDuration?: bigint;
        gitSource?: GitSource;
        health?: JobsHealthRules;
        libraries?: Library[];
        maxRetries?: number;
        minRetryIntervalMillis?: number;
        notificationSettings?: NotificationSettings;
        queueDuration?: bigint;
        resolvedValues?: ResolvedValues;
        retryOnTimeout?: boolean;
        runDuration?: bigint;
        runId?: bigint;
        runIf?: TaskDependencyType;
        runPageUrl?: string;
        setupDuration?: bigint;
        spec?:
            | { $case: "existingClusterId"; existingClusterId: string }
            | { $case: "newCluster"; newCluster: ClusterSpec_NewCluster }
            | { $case: "jobClusterKey"; jobClusterKey: string };
        startTime?: bigint;
        state?: RunState;
        status?: RunStatus;
        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

    attemptNumber?: number

    The sequence number of this run attempt for a triggered job run. The initial attempt of a run has an attempt_number of 0. If the initial run attempt fails, and the job has a retry policy (max_retries > 0), subsequent runs are created with an original_attempt_run_id of the original attempt’s ID and an incrementing attempt_number. Runs are retried only until they succeed, and the maximum attempt_number is the same as the max_retries value for the job.

    cleanupDuration?: bigint

    The time in milliseconds it took to terminate the cluster and clean up any associated artifacts. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The cleanup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

    clusterInstance?: ClusterInstance

    The cluster used for this run. If the run is specified to use a new cluster, this field is set once the Jobs service has requested a cluster for the run.

    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 successfully before executing this task. 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.

    effectivePerformanceTarget?: PerformanceTarget_PerformanceTarget

    The actual performance target used by the serverless run during execution. This can differ from the client-set performance target on the request depending on whether the performance mode is supported by the job type.

    • STANDARD: Enables cost-efficient execution of serverless workloads.
    • PERFORMANCE_OPTIMIZED: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance.
    emailNotifications?: JobEmailNotifications

    An optional set of email addresses notified when the task run begins or completes. The default behavior is to not send any emails.

    endTime?: bigint

    The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This field is set to 0 if the job is still running.

    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.

    executionDuration?: bigint

    The time in milliseconds it took to execute the commands in the JAR or notebook until they completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The execution_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

    gitSource?: GitSource

    An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. If git_source is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting source to WORKSPACE on the task. Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, git_source must be defined on the job.

    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 run.

    queueDuration?: bigint

    The time in milliseconds that the run has spent in the queue.

    resolvedValues?: ResolvedValues

    Parameter values including resolved references

    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.

    runDuration?: bigint

    The time in milliseconds it took the job run and all of its repairs to finish.

    runId?: bigint

    The ID of the task run.

    An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to ALL_SUCCESS. See :method:jobs/create for a list of possible values.

    runPageUrl?: string
    setupDuration?: bigint

    The time in milliseconds it took to set up the cluster. For runs that run on new clusters this is the cluster creation time, for runs that run on existing clusters this time should be very short. The duration of a task run is the sum of the setup_duration, execution_duration, and the cleanup_duration. The setup_duration field is set to 0 for multitask job runs. The total duration of a multitask job run is the value of the run_duration field.

    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.

    startTime?: bigint

    The time at which this run was started in epoch milliseconds (milliseconds since 1/1/1970 UTC). This may not be the time when the job task starts executing, for example, if the job is scheduled to run on a new cluster, this is the time the cluster creation call is issued.

    state?: RunState

    Deprecated. Please use the status field instead.

    status?: RunStatus
    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 the run begins or completes. The default behavior is to not send any system notifications. Task webhooks respect the task notification settings.