Triggers & Schedules

Databricks · Lakeflow Jobs

Theory

A job's trigger decides when it runs. In the Job details pane, under Schedules & Triggers, click Add trigger and pick a type. Scheduled runs on a time-based schedule, using a simple interval or a Quartz cron expression with a time zone. File arrival starts a run when new files land in a Unity Catalog volume or external location. Table update starts a run when one or more source tables are updated, so downstream work follows the data instead of the clock. Continuous starts a new run as soon as the previous one ends, for always-on streaming jobs. Without a trigger, a job runs only with Run now or from the API.

Example: build_gold runs Scheduled at 0 30 6 * * ? Asia/Kolkata (6:30 every morning IST). A separate job uses File arrival on /Volumes/main/sales/raw/orders/ so new files are processed within minutes.

Why we use it

Fixed schedules either run too early (data not there yet) or waste compute (nothing new arrived). Data-driven triggers start work exactly when inputs change, and cron schedules cover reports that must be ready at a set time.

When to use it

Use Scheduled for time-bound outputs like a 7 AM report. Use File arrival or Table update when timing depends on upstream data. Use Continuous only for streaming jobs that should never stop. Pause a trigger instead of deleting it during maintenance.

How it works

  1. Open the job → Job details → Schedules & Triggers
  2. Click Add trigger
  3. Must output be ready at a fixed time? Yes: Scheduled: set interval or cron and time zone. No: Next question.
  4. Does the work follow new files or table changes? Yes: File arrival or Table update. No: Continuous for always-on streams.
  5. Save the trigger and check the next run time

Syntax

UI: Job details → Schedules & Triggers → Add trigger → Trigger type:
  Scheduled (interval or Cron syntax + time zone) | File arrival (storage location) |
  Table update (tables, any/all updated) | Continuous | Upstream job completion | Model update
Quartz cron: sec min hour day-of-month month day-of-week   e.g. 0 30 6 * * ?

Example

# In a Declarative Automation Bundle job definition
resources:
  jobs:
    build_gold_daily:
      name: build_gold_daily
      schedule:
        quartz_cron_expression: "0 30 6 * * ?"     # 06:30 every day
        timezone_id: Asia/Kolkata
        pause_status: UNPAUSED

    process_new_orders:
      name: process_new_orders
      trigger:
        file_arrival:
          url: /Volumes/main/sales/raw/orders/

    refresh_customer_marts:
      name: refresh_customer_marts
      trigger:
        table_update:
          table_names: [main.sales.orders, main.sales.customers]
          condition: ANY_UPDATED

Key points

Databricks topics

Databricks Fundamentals

Compute

Notebooks & Development

Apache Spark on Databricks

Delta Lake

Unity Catalog & Governance

Data Ingestion

Declarative Pipelines (Lakeflow)

Lakeflow Jobs

Databricks SQL & BI

Architecture, Performance & Cost

Machine Learning & AI

Certification & Interview

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Master Databricks

The lakehouse platform from the ground up: Apache Spark, Delta Lake, Unity Catalog, Lakeflow pipelines and jobs, Databricks SQL and MLflow. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice SQL / Spark SQL Sharpen the SQL you use in Databricks SQL and Spark SQL: 150 query problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Databricks  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

{{ sec.h }}

{{ sec.body }}

{{ sec.body }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
Want to run this yourself? Databricks needs a real workspace — there's no in-browser engine for it. Click Copy above, then paste it into a notebook or the SQL editor in Databricks Free Edition (free, no credit card) and run it on serverless compute.
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic