Databricks DE · Topic 7.1

Lakeflow Jobs & Tasks

Orchestrate multiple tasks — notebooks, SQL, and pipelines — as one workflow DAG, scheduled and monitored, defined in the UI or as an Asset Bundle. (Formerly Databricks Workflows / Jobs.) This deep dive walks the model and the config-as-code.

job = workflowtask = stepdepends_on DAGAsset Bundle

The one-liner

Lakeflow Jobs coordinates and runs multiple tasks (notebook / SQL / Python / SDP pipeline) as one workflow, wired into a DAG with dependencies, schedules, retries, and monitoring — defined in the UI or as code (Asset Bundle).
🍳 Analogy: a job is a recipe; tasks are the steps. The DAG is the order — "make the sauce before you plate" — and the runner makes each step wait for the ones it depends on.

Run a job — watch the task DAG

▸ click Run; tasks execute in dependency order

Ingest
notebook
▸
Transform
SDP pipeline
▸
DQ check
SQL
▸
Notify
notebook
Idle.

1 · Task types (mix them in one job)

Task typeYAML keyRuns
Notebooknotebook_taska notebook
SDP pipelinepipeline_taska Lakeflow Declarative Pipeline
SQLsql_taskquery / file / dashboard / alert on a warehouse
Python wheelpython_wheel_taskan entry point in a packaged wheel
Python file / dbt / Run-jobspark_python_task / dbt_task / …scripts, dbt, nested jobs

2 · Config-as-code — a multi-task job (Asset Bundle)

resources.jobs.<key>.tasks[] — each task has a task_key, a task-type block, and depends_on to wire the DAG.

# databricks.yml (resources)
resources:
  jobs:
    nightly_etl:
      name: nightly_etl
      tasks:
        - task_key: ingest                         # task 1
          notebook_task: { notebook_path: ../src/autoloader_ingest.py }
          job_cluster_key: etl_cluster
        - task_key: transform                      # task 2: runs an SDP pipeline
          depends_on: [{ task_key: ingest }]
          pipeline_task: { pipeline_id: ${resources.pipelines.silver_gold.id} }
        - task_key: dq_check                       # task 3: SQL on a warehouse
          depends_on: [{ task_key: transform }]
          sql_task: { warehouse_id: ${var.warehouse_id}, file: { path: ../src/dq_checks.sql } }
        - task_key: notify                         # task 4
          depends_on: [{ task_key: dq_check }]
          notebook_task: { notebook_path: ../src/notify.py }
      job_clusters:                                 # reusable cluster for the job
        - job_cluster_key: etl_cluster
          new_cluster:
            spark_version: 15.4.x-scala2.12
            node_type_id: i3.xlarge
            num_workers: 2

Deploy & run (CLI)

databricks bundle deploy -t prod        # create/update the job
databricks bundle run nightly_etl       # trigger a run

3 · Which cluster runs a task?

4 · Jobs vs SDP — click each

▸ a job can run an SDP pipeline as a task

Lakeflow Jobs
Declarative Pipelines (SDP)
Lakeflow Jobs — orchestrate.
  • Unit = task (notebook / SQL / Python / pipeline)
  • You define the DAG of steps + schedule
  • Runs an SDP pipeline via pipeline_task
SDP — build one pipeline.
  • Unit = dataset (streaming table / MV)
  • You declare desired tables; SDP derives its own DAG
  • Runs inside / alongside Jobs
Lakeflow JobsSDP
RoleOrchestrate tasksBuild a pipeline
UnitTaskDataset
DAGYou define it (depends_on)Derived from datasets

Why it matters

🌙 Real-world use case: a nightly job runs ingest notebook → SDP pipeline → SQL DQ check → notify, as one DAG, retried on failure, deployed via an Asset Bundle.

Uses, edge cases & limitations

Common gotchas