โ08-17-2026 01:17 AM
Hi,
Is there a plan to have if statement support in DAB YAML file?
For example, I would like to have different schedule for jobs based on the environment (higher frequency in PROD, lower frequency in DEV, QA). How can I do it in Databricks via workflow yml files?
โ08-17-2026 02:29 AM
Hi QuanDo1,
targets:
dev:
default: true
mode: development
variables:
job_schedule_cron: "0 0 9 ? * MON" # Weekly on Mondays at 9am
environment: "dev"
qa:
mode: development
variables:
job_schedule_cron: "0 0 6 * * ?" # Daily at 6am
environment: "qa"โ08-17-2026 02:50 AM
Hi @QuanDo1
You don't need to use if/else for this use case. Databricks Asset Bundles (DAB) already supports variables that can be overridden per target environment.
You can define your variables once and then assign different values for each target (dev, qa, prod). This keeps your bundle clean and avoids conditional logic in the YAML.
bundle:
name: dynamic-scheduler-demo
variables:
job_cron_schedule:
description: "The cron expression for running the workflow"
default: "0 0 12 * * ?"
job_timezone:
description: "The timezone for the schedule"
default: "UTC"
targets:
dev:
mode: development
default: true
variables:
job_cron_schedule: "0 0/15 * * * ?" # Every 15 minutes
resources:
jobs:
my_scheduled_job:
name: "My Scheduled Data Pipeline"
schedule:
quartz_cron_expression: "${var.job_cron_schedule}"
timezone_id: "${var.job_timezone}"
pause_status: "UNPAUSED"
โ08-17-2026 02:53 AM - edited โ08-17-2026 02:53 AM
Hi balajij8, Niyojit
I understand the approach. In my opinion, this is suitable only for small number of pipelines, or local development, what if I have many pipelines, I wouldn't want them to run all at the same time, having the flexibility to customize each pipeline is I think more suitable for professional use cases?
โ08-17-2026 02:59 AM
What i think is for many pipelines or production-scale deployments, you would typically define pipeline-specific variables (or separate variables per workflow) and override them per target (dev, qa, prod). This gives each pipeline its own schedule while still keeping the configuration centralized.
โ08-17-2026 03:25 AM
Quan,
Instead of using global variables that apply the same schedule to all jobs, you override the schedule individually for each pipeline within each environment target. It gives you full control over every pipeline's timing in every environment.
โ08-17-2026 03:50 AM
balajij8,
Sounds promising, could you elaborate on this? Perhaps a quick example
โ08-17-2026 04:07 AM
Quan,
You can follow below
targets:
prod:
resources:
jobs:
job1:
schedule:
quartz_cron_expression: "0 0 */2 * * ?" # Every 2 hours
job2:
schedule:
quartz_cron_expression: "0 0 6 * * ?" # Daily at 6am