What you will be able to do
- Build a multi-task Lakeflow Job whose task graph uses depends_on and the right run_if condition
- Choose a trigger (schedule, file arrival, table update, continuous) and explain how concurrency and pausing affect runs
- Define job parameters and pass them, and run metadata such as {{job.start_time}}, into tasks with dynamic value references
- Create, update and trigger a job with the Databricks CLI, the Jobs REST API and Declarative Automation Bundles, and say when to use run-now instead of submit
Key concept
Lakeflow Job — A job is a saved, named resource that holds a graph of tasks plus the settings that control when and how the graph runs: its trigger, its parameters, notifications and Git source. The UI, the CLI, the REST API and bundles all read and write this same definition.
1.Jobs, tasks and the task graph
Lakeflow Jobs is the Databricks orchestrator. It turns a set of notebooks, pipelines and queries into a single workflow that runs on its own schedule. A job can be one notebook, or it can be hundreds of tasks with dependencies between them. In both cases the job itself carries the settings that apply to the whole workflow: a trigger that decides when it runs, parameters that are pushed to its tasks at run time, notifications for failures or slow runs, and Git settings for task source code.
A task is one unit of work. Each task has a task_key that is unique within the job, a type-specific block such as notebook_task, and a compute resource. With serverless compute, Databricks configures that compute for you. Tasks point at each other through depends_on, which forms a directed acyclic graph (DAG). Databricks runs upstream tasks before downstream ones, and runs as many in parallel as the graph allows. A job can hold up to 1,000 tasks.
| Task type | What it runs |
|---|---|
| Notebook | A Databricks notebook at a given path, with optional parameters read as widgets |
| Pipeline | An existing Lakeflow pipeline, such as one that maintains streaming tables or materialized views |
| Python script | A Python file, with parameters passed as command-line arguments |
| Python wheel | A packaged wheel; job-level parameters reach it as keyword arguments when it is configured to accept them |
| SQL | A SQL query, file or alert on a SQL warehouse |
| If/else, For each, Run Job | Control flow: branching, looping over an input array, or triggering another job |
In the workspace UI, you create a job by configuring its first task:
- Click Jobs & Pipelines in the sidebar, then Create > Job.
- Click the Notebook tile (or Add another task type), enter a task name, and pick the notebook for Path.
- Click Save task. The job appears as
New Job <date> <time>until you rename it. - Click Add task in the task graph to add more tasks. A task that is selected in the graph becomes the new task's default dependency.
Without a trigger, a job runs only when someone starts it. Run now with different settings lets you change parameter values for a single run. The kebab menu next to Run now opens the job as YAML, and the job page shows the JSON definition used by the REST API get, create and reset endpoints. The If/else and For each task types are covered in control-flow tasks.
Checkpoint 1 of 9· Match them up
An ETL job needs several kinds of work. Match each task type to what it runs.
Tap a term, then the definition that fits it.
Each task type runs a different kind of work. Refreshing streaming tables or materialized views takes a Pipeline task that points at an existing Lakeflow pipeline. A Notebook task is the wrong choice for that.
“A pipeline task runs a pipeline. You can specify existing Lakeflow pipelines, such as a materialized view or streaming table.”Source: docs.databricks.com
2.Dependencies and Run if conditions
A task's run_if setting decides whether it runs once its upstream tasks have finished. In the UI this field is called Run if dependencies, and it only appears when the job has more than one task. The condition looks at the result of every task listed in depends_on, so one setting covers a task with two parents.
| UI name | run_if value | Runs when | If unmet |
|---|---|---|---|
| All succeeded (default) | ALL_SUCCESS | Every dependency ran and succeeded | Upstream failed |
| At least one succeeded | AT_LEAST_ONE_SUCCESS | Any dependency succeeded | Upstream failed |
| None failed | NONE_FAILED | No dependency failed and at least one ran | Upstream failed |
| All done | ALL_DONE | All dependencies have finished, whatever their outcome | Not applicable |
| At least one failed | AT_LEAST_ONE_FAILED | Any dependency failed | Excluded (skipped) |
| All failed | ALL_FAILED | Every dependency failed | Excluded (skipped) |
To report on a run whatever its outcome, use ALL_DONE. It runs the task once every parent has finished and ignores whether they succeeded. NONE_FAILED looks similar but is the wrong choice for this: if either parent fails, the reporting task never runs. AT_LEAST_ONE_FAILED is the opposite case. It suits an alerting or cleanup task that should run only when something went wrong. When a task is canceled, the cancellation propagates downstream, but tasks whose Run if condition handles failure still run. That is how a cleanup task survives a canceled run.
Exclusion cascades through the graph. Upstream tasks marked Excluded count as successful when Run if conditions are evaluated. Upstream failed and Upstream canceled count as failed. A task whose dependencies are all excluded is itself excluded, whatever its own condition says. So in a chain A → B → C, excluding A means none of the three run.
{
"depends_on": [
{
"task_key": "success"
}
],
"disable_auto_optimization": true,
"email_notifications": {},
"max_retries": 3,
"min_retry_interval_millis": 300000,
"notebook_task": {
"notebook_path": "/Workspace/Users/someone@example.com/directory",
"source": "WORKSPACE"
},
"retry_on_timeout": false,
"run_if": "ALL_SUCCESS",
"task_key": "fail",Checkpoint 2 of 9· Fill the gap
In this task from databricks jobs get output, the task fail should run only when every task in depends_on ran and succeeded. That is also what you get if you never change Run if. Which value fills the blank?
"depends_on": [
{
"task_key": "success"
}
],
"disable_auto_optimization": true,
"email_notifications": {},
"max_retries": 3,
"min_retry_interval_millis": 300000,
"notebook_task": {
"notebook_path": "/Workspace/Users/someone@example.com/directory",
"source": "WORKSPACE"
},
"retry_on_timeout": false,
"run_if": " ? ",
"task_key": "fail",ALL_SUCCESS is the default, and it requires every dependency to run and succeed. If that doesn't happen, the task is marked Upstream failed. NONE_FAILED only needs no failures and at least one dependency that ran. ALL_DONE ignores the outcome, which is why it is the right choice for a reporting task.
Source: docs.databricks.comCheckpoint 3 of 9· Exam question
A Lakeflow Job has a send_notification task that depends on the upstream validate_data and transform_data tasks. The team wants send_notification to run and report the job outcome after both upstream tasks finish, whether they succeeded or failed. Which run_if condition should be configured on send_notification's dependency on the two upstream tasks?
Correct answer: A — Configure run_if: ALL_DONE on the dependency so the task executes once both upstream tasks have finished running, independent of whether either task succeeded or failed.
- A. This is the correct setting: it makes the dependent task run once its dependencies have completed regardless of their outcome, which is exactly what an unconditional notification task needs.
- B. This is the default dependency behavior, but it means the notification task is skipped entirely whenever either upstream task fails, defeating the goal of always reporting the outcome.
- C. This condition only triggers the task when a failure occurred, so a fully successful run would never produce a notification, which does not match the requirement.
- D. This condition still skips the task whenever an upstream failure occurs, so it cannot guarantee a notification is sent for every possible outcome.
3.Schedules and triggers
A trigger turns a job that someone has to start by hand into one that runs on its own. You add one under Schedules & Triggers in the Job details pane, then pick a type. A schedule runs on the clock. The other types react to events: files landing, tables changing, or the previous run ending.
| Trigger | Starts a run when | Use it when |
|---|---|---|
| Scheduled | A time-based schedule fires (Quartz cron plus a timezone) | Data arrives on a known cadence, such as a nightly batch |
| File arrival | New files arrive in a monitored Unity Catalog storage location | Upstream systems drop files at unpredictable times |
| Table update | Source tables are updated | The job should follow upstream table commits rather than the clock |
| Continuous | The previous run completes or fails | The job must always be running |
| None (manual) | Someone clicks Run now or calls the API | Ad hoc runs or an external orchestrator |
"schedule": { "quartz_cron_expression": "46 0 9 * * ?", "timezone_id": "America/Los_Angeles", "pause_status": "UNPAUSED"},"max_concurrent_runs": 1,Concurrency is the setting most likely to catch you out. By default only one run of a job can be active at a time, and a run that would exceed max_concurrent_runs is skipped, not queued. If an hourly schedule fires while a slow run from the previous hour is still going, the new run is dropped unless you raise the limit in Advanced settings.
Multiple triggers on one job are in Beta, with up to five per job. A common pattern is a table update trigger that starts the run as soon as data is ready, plus a scheduled trigger as a backup. Any active trigger that fires starts a run. Each trigger can be paused and resumed on its own. Pausing stops new runs but lets active runs finish. A continuous trigger cannot be combined with any other trigger. In the API, multiple triggers go in the triggers array, and that array must not be sent in the same request as the legacy schedule, trigger or continuous fields.
Checkpoint 4 of 9· Check yourself
A job should start as soon as its upstream source tables are updated. If no update arrives, it should still run once a day. Which trigger setup meets this requirement?
Any active trigger that fires starts a run, so a table update trigger paired with a scheduled backup covers both cases. A continuous trigger cannot be combined with any other trigger. The triggers array must not be sent together with the legacy schedule field.
“you can use a table update trigger to start a job run when data is ready, and add an additional scheduled trigger as a backup”Source: docs.databricks.com
Checkpoint 5 of 9· Check yourself
A job runs on an hourly schedule and keeps the default concurrency setting. At 10:00 the schedule fires, but the 09:00 run is still processing. What happens to the 10:00 run?
By default only one run of a job can be active at a time. A run that would go over max_concurrent_runs is skipped, not queued. To let runs overlap, raise the limit in Advanced settings.
“Runs are skipped when they exceed the configured max concurrency for a job.”Source: docs.databricks.com
Sources5
4.Job parameters and dynamic value references
Job parameters are key-value pairs set once at the job level. They are pushed to every task that accepts key-value parameters, so one catalog or run_date setting reaches all tasks without being repeated on each. The value you configure is only a default. Run now with different parameters, or a run triggered through the REST API, can override it for that run. A task parameter with a static value, by contrast, can only change if you edit the task definition. Overriding a default is not locked down: anyone with CAN MANAGE RUN or higher on the job can do it, so restrict permissions if a value must not change.
Dynamic value references are placeholders in double curly braces that are filled in when the job runs. They give you job metadata, such as {{job.id}}, {{job.run_id}}, {{job.trigger.type}} and {{job.start_time.<argument>}} (the UTC run start time in a format you choose, such as iso_date). They also give you parameters, through {{job.parameters.<name>}}, and results from other tasks, such as {{tasks.<task_name>.values.<value_name>}}. Event triggers add their own references. {{job.trigger.file_arrival.location}}, for example, tells a task which storage location fired the run.
{
"parameters": [
{
"name": "my_job_id",
"default": "{{job.id}}"
},
{
"name": "run_date",
"default": "{{job.start_time.iso_date}}"
}
]
}References are resolved in the job and task configuration, not in your code. A notebook cannot read {{job.run_id}} directly. The reference has to sit in a parameter or field, which then passes the resolved value in, for example as a widget value for a notebook task. Resolution is plain text substitution: a task parameter set to job_{{job.run_id}} becomes job_550315892394120. You cannot run operations or call functions inside the braces.
Loops have their own reference. A For each task passes each element of its input array to one iteration of its nested task. The nested task reads that element by setting a parameter value to {{input}}, or to {{input.<key>}} when the elements are objects. For an input of ["s3://raw/orders/", "s3://raw/customers/"], a notebook parameter source_path = {{input}} gets a different path on each iteration. Task values and job parameters feed the loop's Inputs box as a whole array, for example {{tasks.list_sources.values.paths}}. They do not feed individual iterations. The loop is covered in full in For each loops.
Checkpoint 6 of 9· Check yourself
Two notebook tasks and a Python wheel task (set up to accept keyword arguments) all need the same catalog value. An operator must be able to point a single run at a different catalog without editing the job. What should you configure?
Job parameters are passed to every task that accepts key-value parameters, and that includes wheels set up for keyword arguments. Their configured value is only a default, so it can be overridden for a single run. A static task parameter changes only when you edit the task. A reference such as {{job.parameters.catalog}} is resolved in the job and task configuration, not inside code.
“Parameters configured at the job level are passed to the job's tasks that accept key-value parameters, including Python wheel files configured to accept keyword arguments.”Source: docs.databricks.com
Checkpoint 7 of 9· Exam question
An engineer builds a Lakeflow Job with a For each task whose input is a JSON array of ingestion source paths, for example ["s3://raw/orders/", "s3://raw/customers/", "s3://raw/products/"]. The nested task is a notebook task that reads the source path from a task parameter. How should that parameter be configured so each loop iteration processes its own array element?
Correct answer: A — Set the nested notebook task's parameter value to {{input}}, which Lakeflow Jobs resolves to the current iteration's array element each time the loop invokes the nested task.
- A. The
{{input}}reference is the mechanism Lakeflow Jobs provides specifically for a nested task to receive the current loop iteration's value from theFor eachtask's array. - B. A job-level parameter holds one fixed value for the whole run, so it cannot vary per iteration and would pass the same path to every loop execution.
- C. The
For eachtask orchestrates iterations rather than executing arbitrary code, so it cannot calltaskValues.set, and this adds an unnecessary indirection over the built-in{{input}}reference. - D. Passing the entire array to every iteration and filtering inside the notebook requires the notebook to know its own iteration index, which the nested task is not given, making this approach unworkable.
5.Creating and running jobs with the CLI, REST API and bundles
Every job is a JSON document. The UI, the Databricks CLI, the SDKs and the Jobs REST API all read and write that same document. The CLI wraps the REST API, so databricks jobs get maps to GET /api/2.2/jobs/get, and the jobs command group's create, get, delete and run-now commands map to the matching endpoints in the same way. databricks jobs <command-name> -h prints the syntax for any of them. Databricks recommends the CLI or an SDK over raw REST calls, unless your language has no SDK.
{ "name": "My hello notebook job", "tasks": [ { "task_key": "my_hello_notebook_task", "notebook_task": { "notebook_path": "/Workspace/Users/someone@example.com/hello", "source": "WORKSPACE" } } ]}After databricks jobs create --json @<file-path>, there are three ways to run the job from the command line or the API:
- Scheduled: if the JSON includes a
schedule, the job runs on it automatically. - run-now (
databricks jobs run-now, orjobs.run_nowin the API): triggers a run of a job you have already created. Parameter overrides go here. - submit (
databricks jobs submit, orjobs.runs.submitin the API): takes a job definition and runs it once. The job is never saved.
To update an existing job, edit its JSON and send it to the reset endpoint. Reset replaces the settings wholesale, the same way an update to triggers replaces the whole array.
Submitted runs are not saved as jobs. They do not appear in the UI and stop existing once they finish. Because they are not saved, serverless cannot auto-optimize them after a failure. For a recurring workload, use jobs create once and then jobs run-now, or give the submit call classic compute.
For CI/CD, define the job as code instead of calling create from scripts. Declarative Automation Bundles describe jobs under resources.jobs in YAML, using the same task keys as the JSON, and keep them in source control next to the code they run. The deploy workflow is covered in deploying with bundles. Terraform is the other supported infrastructure-as-code route.
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-111111111111Automation also runs into workspace limits. A workspace allows 2,000 concurrent task runs, and a run that cannot start immediately gets a 429 Too Many Requests response. A workspace can create at most 10,000 jobs per hour, and runs submit counts toward that limit. A workspace can hold up to 12,000 saved jobs. A pipeline that creates a new job on every commit, instead of updating one, will reach these limits.
Checkpoint 8 of 9· Match them up
A CI script manages an ETL job from the command line. Match each CLI command or API endpoint to what it does.
Tap a term, then the definition that fits it.
Only create saves a job that can be rerun and scheduled. Submit runs a definition once and then it no longer exists. Run-now triggers an existing job and is where per-run overrides go. Reset replaces a saved job's settings wholesale, so a recurring workload uses create once and then run-now.
“With submit, the job is not saved, and isn't visible in the UI. It runs once”Source: docs.databricks.com
Checkpoint 9 of 9· Exam question
A platform team wants to automate the creation and updates of Lakeflow Jobs from a CI/CD pipeline instead of configuring jobs by hand in the Jobs UI. Which of the following are valid, currently supported ways to do this? (Choose all that apply.)(Select 3)
Correct answers: A, B, C — Run databricks jobs create --json @job-config.json from the Databricks CLI, passing a JSON job specification that the pipeline generates as a build artifact.; Send an authenticated POST request to the /api/2.2/jobs/create REST API endpoint, with the job definition supplied as the request body.; Define the job as a resources.jobs entry in a databricks.yml bundle configuration, then deploy and update it with databricks bundle deploy.
- A. This CLI subcommand wraps the Jobs REST API create call and is a documented, supported way to script job creation from a JSON specification.
- B. Calling this REST endpoint directly with a job definition payload is the underlying mechanism the CLI and SDKs use, and it is fully supported for automation.
- C. Declaring the job as a bundle resource and deploying it is the recommended pattern for CI/CD, since the bundle tracks the job's state and supports environment targets.
- D. There is no hidden sync directory that the workspace polls to auto-apply job changes; job definitions must be created or updated through the CLI, API, bundles, or UI.
- E. Placing a notebook file in workspace or DBFS storage does not register a job; a job resource must be explicitly created through the CLI, API, UI, or a bundle deployment.
- F. The newer Jobs API version, not the older deprecated one, is the version documented for current job management, and control-flow task types are not gated behind the deprecated endpoint.
Practise it for real
Create a one-task notebook job from a JSON file with the Databricks CLI, trigger it, and read back its definition.
1.Save the minimal job JSON (name "My hello notebook job", one notebook_task) to a file, pointing notebook_path at a notebook you own.
Why: Every creation route takes the same job document, so the file is a reusable build artifact.
You should see: A local JSON file with a name and a tasks array containing one task_key.
2.Run databricks jobs create --json @<file-path>.
Why: The CLI wraps the jobs create REST endpoint and saves the job in the workspace.
You should see: A response containing the new job_id. The job also appears under Jobs & Pipelines.
3.Run databricks jobs run-now with the job ID returned by create.
Why: run-now triggers a run of a saved job, unlike submit, which runs an unsaved definition once.
You should see: A run starts and is listed on the job's Runs tab.
4.Run databricks jobs get <job-id>.
Why: get returns the stored settings, including defaults you did not set, such as run_if and max_concurrent_runs.
You should see: JSON with settings.tasks[0].run_if set to ALL_SUCCESS and max_concurrent_runs set to 1.
Stuck? Get a nudge
If a command's syntax is unclear, run databricks jobs <command-name> -h.
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.databricks.com/aws/en/jobsOfficial docs
“The tasks in a job are visually represented by a Directed Acyclic Graph (DAG).”
↩︎ Jobs, tasks and the task graph“When tasks use dynamic values in their parameters, job parameters are limited to 10,000 characters.”
↩︎ Job parameters and dynamic value references“A 429 Too Many Requests response is returned when you request a run that cannot start immediately.”
↩︎ Creating and running jobs with the CLI, REST API and bundles“A job is the primary resource for coordinating, scheduling, and running your operations.”
↩︎ Key concept“A pipeline task runs a pipeline. You can specify existing Lakeflow pipelines, such as a materialized view or streaming table.”
↩︎ Checkpoint - 2.
“Parameters configured at the job level are passed to the job's tasks that accept key-value parameters, including Python wheel files configured to accept keyword arguments.”
↩︎ Jobs, tasks and the task graph“If you prefer an infrastructure-as-code (IaC) approach to configuring jobs, you can use Declarative Automation Bundles.”
↩︎ Creating and running jobs with the CLI, REST API and bundles“Parameters configured at the job level are passed to the job's tasks that accept key-value parameters, including Python wheel files configured to accept keyword arguments.”
↩︎ Checkpoint - 3.https://docs.databricks.com/aws/en/jobs/run-ifOfficial docs
“Databricks runs upstream tasks before running downstream tasks, running as many of them in parallel as possible.”
↩︎ Jobs, tasks and the task graph“None failed: None of the dependencies failed, and at least one dependency was run.”
↩︎ Dependencies and Run if conditions“Upstream tasks with the Excluded result state are treated as successful when evaluating Run if conditions.”
↩︎ Dependencies and Run if conditions“All done: The task is run after all its dependencies have run, regardless of the status of the dependent runs.”
↩︎ Exam trap 1“All succeeded: All dependencies have run and succeeded. This is the default setting. The task is marked as Upstream failed if the condition is unmet.”
↩︎ Prediction - 4.
“ALL_DONE: Run when all dependencies complete, regardless of outcome.”
↩︎ Dependencies and Run if conditions - 5.https://docs.databricks.com/aws/en/jobs/triggersOfficial docs
“By default, only a single run of a job can be active at a time.”
↩︎ Schedules and triggers“Runs are skipped when they exceed the configured max concurrency for a job.”
↩︎ Schedules and triggers“Don't set triggers in the same request as the legacy schedule, trigger, or continuous fields.”
↩︎ Schedules and triggers“A continuous trigger cannot be combined with any other trigger because the job already runs continuously.”
↩︎ Exam trap 4“you can use a table update trigger to start a job run when data is ready, and add an additional scheduled trigger as a backup”
↩︎ Checkpoint - 6.https://docs.databricks.com/aws/en/jobs/parametersOfficial docs
“Job parameters are pushed down to tasks that use key-value parameters. Other tasks can reference job parameters using dynamic value references.”
↩︎ Job parameters and dynamic value references - 7.
“Dynamic value references must be defined using parameters or fields that pass context into tasks.”
↩︎ Job parameters and dynamic value references“Contents of the double curly braces are not evaluated as expressions.”
↩︎ Exam trap 2“Syntax errors, including non-existent dynamic reference values and missing braces, are silently ignored and treated as literal strings.”
↩︎ Prediction - 8.
“Use the {{input}} reference to set the value to the array value of each iteration”
↩︎ Job parameters and dynamic value references - 9.https://docs.databricks.com/aws/en/jobs/automateOfficial docs
“Because the CLI wraps the Databricks REST API, most CLI commands map to a REST API request.”
↩︎ Creating and running jobs with the CLI, REST API and bundles“Because they are not saved, submitted jobs can't be auto-optimized for serverless compute in case of failure.”
↩︎ Creating and running jobs with the CLI, REST API and bundles“With submit, the job is not saved, and isn't visible in the UI.”
↩︎ Exam trap 3“With submit, the job is not saved, and isn't visible in the UI. It runs once”
↩︎ Checkpoint