Skip to main content

Build

Databricks Jobs

DatabricksOfficialCertified

Develop and deploy Lakeflow Jobs on Databricks via DABs, Python SDK, or the CLI. Use when creating jobs with AI Function tasks, notebooks, Python wheels, SQL, dbt, or pipelines. Invoke BEFORE starting implementation. For configurable compute, also use databricks-serverless.

  • New
  • v1.0.8
  • Reviewed Jul 21
  • No reviews yet

Capabilities

  • Scaffolding a New Job Project

    Use databricks bundle init with a config file to scaffold…

  • Multi-Task Workflows

  • Compute Configuration

    Serverless is the default

  • Job Parameters

Getting started

Full instructions

Example command

Unit Testing

uv run pytest

Instructions: SKILL.mdv1.0.8

Lakeflow Jobs Development

FIRST: Use the parent databricks-core skill for CLI basics, authentication, profile selection, and data exploration commands.

Compute: AI Function tasks manage their own execution and need no compute settings. For other tasks,
before you choose compute or write any cluster setting, use the databricks-serverless skill; it decides
serverless or classic and the performance mode.

Lakeflow Jobs orchestrate data workflows with multi-task DAGs, flexible triggers, and comprehensive monitoring. Jobs support diverse task types and can be managed via Declarative Automation Bundles (DABs), Python SDK, or CLI.

Reference Files

Use Case Reference File
Configure native Document Parsing, AI Extract, and Classification tasks and chain their output tables references/ai-function-tasks.md
Configure task types (notebook, Python, SQL, dbt, pipeline, JAR, run_job, for_each) references/task-types.md
Set up triggers and schedules (cron, periodic, file arrival, table update, continuous) references/triggers-schedules.md
Configure notifications, health rules, retries, timeouts, queues references/notifications-monitoring.md
Complete worked examples (ETL, warehouse refresh, event-driven, ML training, multi-env, streaming, cross-job) references/examples.md

Scaffolding a New Job Project

Use databricks bundle init with a config file to scaffold non-interactively. This creates a project in the <project_name>/ directory:

bash
databricks bundle init default-python --config-file <(echo '{"project_name": "my_job", "include_job": "yes", "include_pipeline": "no", "include_python": "yes", "serverless": "yes"}') --profile <PROFILE> < /dev/null
  • project_name: letters, numbers, underscores only

bundle init also creates an AGENTS.md in the project. Customize that file for the project
instead of creating new agent instruction files.

Project Structure

text
my-job-project/
├── databricks.yml              # Bundle configuration
├── resources/
│   └── my_job.job.yml          # Job definition
├── src/
│   ├── my_notebook.ipynb       # Notebook tasks
│   └── my_module/              # Python wheel package
│       ├── __init__.py
│       └── main.py
├── tests/
│   └── test_main.py
└── pyproject.toml              # Python project config (if using wheels)

Quick Start

yaml
# resources/jobs.yml
resources:
  jobs:
    my_etl_job:
      name: "[${bundle.target}] My ETL Job"
      tasks:
        - task_key: extract
          notebook_task:
            notebook_path: ../src/notebooks/extract.py
      # no cluster block = serverless; compute details: databricks-serverless

Python SDK

python
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.jobs import Task, NotebookTask, Source

w = WorkspaceClient()

job = w.jobs.create(
    name="my-etl-job",
    tasks=[
        Task(
            task_key="extract",
            notebook_task=NotebookTask(
                notebook_path="/Workspace/Shared/etl/extract",
                source=Source.WORKSPACE,
            ),
        ),
    ],
)
print(f"Created job: {job.job_id}")

CLI

bash
databricks jobs create --json '{
  "name": "my-etl-job",
  "tasks": [{
    "task_key": "extract",
    "notebook_task": {
      "notebook_path": "/Workspace/Shared/etl/extract",
      "source": "WORKSPACE"
    }
  }]
}'

Core Concepts

Multi-Task Workflows

Jobs support DAG-based task dependencies:

yaml
tasks:
  - task_key: extract
    notebook_task:
      notebook_path: ../src/extract.py

  - task_key: transform
    depends_on:
      - task_key: extract
    notebook_task:
      notebook_path: ../src/transform.py

  - task_key: load
    depends_on:
      - task_key: transform
    run_if: ALL_SUCCESS  # Only run if all dependencies succeed
    notebook_task:
      notebook_path: ../src/load.py

run_if conditions:

  • ALL_SUCCESS (default) — run when all dependencies succeed
  • ALL_DONE — run when all dependencies complete (success or failure)
  • AT_LEAST_ONE_SUCCESS — run when at least one dependency succeeds
  • NONE_FAILED — run when no dependencies failed
  • ALL_FAILED — run when all dependencies failed
  • AT_LEAST_ONE_FAILED — run when at least one dependency failed

Task Types Summary

Task Type Use Case Reference
notebook_task Run notebooks references/task-types.md#notebook-task
spark_python_task Run Python scripts references/task-types.md#spark-python-task
python_wheel_task Run Python wheels references/task-types.md#python-wheel-task
sql_task Run SQL queries/files/dashboards/alerts references/task-types.md#sql-task
dbt_task Run dbt projects references/task-types.md#dbt-task
pipeline_task Trigger SDP (formerly DLT) pipelines references/task-types.md#pipeline-task
spark_jar_task Run Spark JARs references/task-types.md#spark-jar-task
run_job_task Trigger other jobs references/task-types.md#run-job-task
for_each_task Loop over inputs references/task-types.md#for-each-task

Trigger Types Summary

Trigger Type Use Case Reference
schedule Cron-based scheduling references/triggers-schedules.md#cron-schedule
trigger.periodic Interval-based references/triggers-schedules.md#periodic-trigger
trigger.file_arrival File arrival events references/triggers-schedules.md#file-arrival-trigger
trigger.table_update Unity Catalog table change events references/triggers-schedules.md#table-update-trigger
continuous Always-running jobs references/triggers-schedules.md#continuous-jobs

Compute Configuration

Serverless is the default. Leave out cluster settings (job_clusters, new_cluster, job_cluster_key,
existing_cluster_id); a notebook, Python script, wheel or JAR task without them runs on serverless.
SQL tasks, and the SQL of dbt tasks, run on a SQL warehouse (warehouse_id, see
Task Types); a pipeline task runs on the pipeline's own compute
(serverless: true in the pipeline), and the job's performance_target sets its mode.
If creating or running the job fails because serverless is not available in the workspace, put the
whole job on classic and say so (job clusters for the tasks that run on job compute).

For everything else about compute, use the databricks-serverless skill: the performance mode
(performance_target), libraries (environments), existing code that may not run on serverless, and
the few workloads that need a classic cluster. If that skill is not installed, run
databricks aitools install. Either way, set performance_target on every job: STANDARD to optimize
cost, PERFORMANCE_OPTIMIZED when the job is time-sensitive, interactive, or other workloads depend on it.

Job Parameters

Parameters defined at job level are passed to ALL tasks (no need to repeat per task):

yaml
parameters:
  - name: env
    default: "dev"
  - name: date
    default: "{{start_date}}"  # Dynamic value reference

Access in notebooks:

python
catalog = dbutils.widgets.get("env")
load_date = dbutils.widgets.get("date")

Pass to specific tasks:

yaml
tasks:
  - task_key: my_task
    notebook_task:
      notebook_path: ../src/notebook.py
      base_parameters:
        env: "{{job.parameters.env}}"
        custom_param: "value"

Common Operations

Python SDK

python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

# List jobs
jobs = w.jobs.list()

# Get job details
job = w.jobs.get(job_id=12345)

# Run job now
run = w.jobs.run_now(job_id=12345)

# Run with parameters
run = w.jobs.run_now(
    job_id=12345,
    job_parameters={"env": "prod", "date": "2024-01-15"},
)

# Cancel run
w.jobs.cancel_run(run_id=run.run_id)

# Delete job
w.jobs.delete(job_id=12345)

CLI

bash
# List jobs
databricks jobs list

# Get job details
databricks jobs get 12345

# Run job
databricks jobs run-now 12345

# Run with parameters (must use --json with job_id inside)
databricks jobs run-now --json '{"job_id": 12345, "job_parameters": {"env": "prod"}}'

# Repair a failed run: re-run some of its tasks inside the same run. A repair picks tasks by run
# state, not disabled state: naming a disabled task in rerun_tasks forces it to run, and
# rerun_dependent_tasks also re-runs disabled tasks downstream of the listed ones. Do not enable
# a task in the job just for one repair.
databricks jobs repair-run --json '{"run_id": 67890, "rerun_tasks": ["transform"], "rerun_dependent_tasks": true}'

# Cancel run
databricks jobs cancel-run 67890

# Delete job
databricks jobs delete 12345

Declarative Automation Bundle Operations

bash
# Validate configuration
databricks bundle validate --profile <profile>

# Deploy to a target
databricks bundle deploy -t dev --profile <profile>

# Run a job
databricks bundle run <job_name> -t dev --profile <profile>

# Check run status
databricks jobs get-run --run-id <id> --profile <profile>

# Destroy resources
databricks bundle destroy --auto-approve

Permissions (DABs)

yaml
resources:
  jobs:
    my_job:
      name: "My Job"
      permissions:
        - level: CAN_VIEW
          group_name: "data-analysts"
        - level: CAN_MANAGE_RUN
          group_name: "data-engineers"
        - level: CAN_MANAGE
          user_name: "[email protected]"

Permission levels:

  • CAN_VIEW — view job and run history
  • CAN_MANAGE_RUN — view, trigger, and cancel runs
  • CAN_MANAGE — full control including edit and delete

Unit Testing

Run unit tests locally:

bash
uv run pytest

Development Workflow

  1. Validate: databricks bundle validate --profile <profile>
  2. Deploy: databricks bundle deploy -t dev --profile <profile>
  3. Run: databricks bundle run <job_name> -t dev --profile <profile>
  4. Check run status: databricks jobs get-run --run-id <id> --profile <profile>

Common Issues

Issue Solution
Serverless job startup slow performance_target: PERFORMANCE_OPTIMIZED; see databricks-serverless
Task dependencies not working Verify task_key references match exactly in depends_on
Schedule not triggering Check pause_status: UNPAUSED and valid timezone
File arrival not detecting Ensure path has proper permissions and uses cloud storage URL
Table update trigger missing events Verify Unity Catalog table and proper grants
Parameter not accessible Use dbutils.widgets.get() in notebooks
admins group error Cannot modify admins permissions on jobs
Serverless task fails See the Common Issues of databricks-serverless (libraries, RDD code, DBFS mounts)
  • databricks-dabs — DABs configuration patterns shared by jobs and pipelines
  • databricks-pipelines — SDP (formerly DLT) pipelines triggered by pipeline_task
  • databricks-serverless — compute decisions: serverless, performance mode, classic fallback

Documentation

  • Lakeflow Jobs
  • Task types
  • Declarative Automation Bundles
  • Jobs API Reference
  • Bundle Examples Repository

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from Databricks

View source →
databricks-data-discoveryDiscover, explore, and query Databricks data via Genie — the CLI equivalent of the Genie One MCP. MUST be invoked whenever the user asks to find or locate data ('what tables are in X', 'where does X live', 'which catalog/schema has Y'),…2 installsspark-python-data-sourceBuild custom Python data sources for Apache Spark using the PySpark DataSource API — batch and streaming readers/writers for external systems. Use this skill whenever someone wants to connect Spark to an external system (database, API,…1 installsdatabricks-python-sdkDatabricks development guidance including Python SDK, Databricks Connect, CLI, and REST API. Use when working with databricks-sdk, databricks-connect, or Databricks APIs.1 installsdatabricks-execution-computeExecute code and manage compute on Databricks: run Python/Scala/SQL/R via serverless, classic, or interactive clusters, and create/resize/delete clusters and SQL warehouses.1 installsdatabricks-setup-localPreviews, provisions, or diagnoses a uv-managed local Python .venv with `databricks environments setup-local`. Use when the user wants to set up or fix one for Databricks Connect, cluster or serverless compute, `--job-task`, or a bundle…1 installsdatabricks-serverless-migration-apiMigrate Databricks jobs to serverless through the Compute Migrations API and CLI, then track, review, and approve each migration. Use for automated job migrations managed by this service, scripts that start and track migrations, requests…0 installs

Frequently asked questions about databricks-jobs

What does the databricks-jobs skill do?

Develop and deploy Lakeflow Jobs on Databricks via DABs, Python SDK, or the CLI. Use when creating jobs with AI Function tasks, notebooks, Python wheels, SQL, dbt, or pipelines. Invoke BEFORE starting implementation. For configurable compute, also use databricks-serverless. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the databricks-jobs skill?

Run `npx @skills-hub-ai/cli install databricks-jobs` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/databricks-jobs/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does databricks-jobs work with?

databricks-jobs runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the databricks-jobs skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use databricks-jobs after installing it?

In Claude Code, type `/databricks-jobs` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the databricks-jobs skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/databricks-jobs)](https://skills-hub.ai/skills/databricks-jobs)
HTML
<a href="https://skills-hub.ai/skills/databricks-jobs"><img src="https://skills-hub.ai/api/badges/skill/databricks-jobs" alt="Install on Skills Hub"></a>

More options in the badge docs.