Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hi QuanDo1,
DABs handle environment-specific schedules natively through declarative target variable overrides instead of relying on procedural if statements. You define top-level variables in yml (job_schedule_cron,job_schedule_timezone) and assign baseline defaults that act as fallbacks. Under each target definition (dev, qa, prod), you override these values according to environment requirements - setting job_schedule_cron to a weekly cron expression for dev, daily for qa and every two hours for prod. In the job definition under resources/jobs.yml, you can reference the variable directly as var.job_schedule_cron allowing DABs to resolve and substitute the schedule dynamically from variables.
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"When executing bundles the CLI reads the relevant dev/qa/prod substitutes the cron expression wherever var.job_schedule_cron is referenced in the resources, and provisions a job scheduled based on it. It provides type-safety through default values, keeps schedule differences transparent during code reviews and scales cleanly to parameterize other scheduling attributes such as execution timezones or the pause_status toggle without introducing conditional template logic.