Scheduling
schedule starts runs at cron times or at one-off timestamps. The scheduler process fires them: it runs inside dagu start-all, or alone with dagu scheduler. Each fire is a slot with a scheduled time and a window back to the previous fire, which the run can read.
working_dir: .
schedule: "0 2 * * *" # every day at 02:00
steps:
- id: load
run: ./load.shworking_dir: . runs ./load.sh from the DAG file's folder; without it, steps run in a fresh directory per run. See Working Directory. The workflow page's Cron launcher lists the next runs before the first one fires. See Preview Upcoming Runs.
How a Schedule Fires
- Every minute. The scheduler checks the schedules on each whole minute.
- One scheduled run at a time. A fire that comes while the DAG has a running or queued run is skipped, as at 11:00 on an hourly schedule.
- Missed slots. Fires that pass while no scheduler runs, the DAG is suspended, or the scheduler is paused are not run, unless
catchup_windowreplays them. Herecatchup_window: 6hreplays 12:00 and 13:00 when the scheduler restarts at 13:30. - Zone. A cron expression without a zone prefix is read in the server's
tz, or the host's local time when it is unset.
Cron Expressions
A cron expression has five fields: minute, hour, day of month, month, and day of week.
| Expression | Fires |
|---|---|
0 2 * * * | Every day at 02:00 |
*/15 * * * * | Every 15 minutes |
0 9 * * MON-FRI | Weekdays at 09:00 |
*/30 8-17 * * MON-FRI | Every 30 minutes from 08:00 to 17:30 on weekdays |
0 0 1 * * | Midnight on the first day of each month |
A step that does not divide its field evenly, such as */33 in the minute field, fires at :00 and :33, not every 33 minutes. The DAG loads with a warning that names the divisors that work.
Schedule Aliases
| Alias | Equivalent cron | Fires at |
|---|---|---|
@hourly | 0 * * * * | The start of each hour |
@daily, @midnight | 0 0 * * * | Midnight each day |
@weekly | 0 0 * * 0 | Midnight on Sunday |
@monthly | 0 0 1 * * | Midnight on the first day of each month |
@yearly, @annually | 0 0 1 1 * | Midnight on January 1 |
Aliases are case-sensitive and must be quoted in YAML. They work wherever a cron expression does, with a zone prefix such as "CRON_TZ=Asia/Tokyo @daily". The API and the schedule badges show the equivalent cron expression; the YAML keeps the alias.
"@every 90m" fires once per interval on a grid aligned to the Unix epoch. The interval must be a whole number of minutes, and @every takes no zone prefix.
Multiple Schedules
working_dir: .
schedule:
- "0 9 * * MON-FRI" # weekdays at 09:00
- "0 14 * * SAT,SUN" # weekends at 14:00
steps:
- id: sync
run: ./sync.shWhen several entries fire in the same minute, the DAG gets one run.
Time Zones
Prefix an expression with CRON_TZ= or TZ= and a tz database name:
working_dir: .
schedule: "CRON_TZ=Asia/Tokyo 0 9 * * *" # 09:00 in Tokyo
steps:
- id: report
run: ./report.shThe prefix applies to that expression only and does not set TZ for the steps. Without a prefix, schedules use the server's tz.
One-Off Runs
An at entry runs the DAG once at a timestamp:
working_dir: .
schedule:
- "0 9 * * MON-FRI"
- at: "2026-03-29T09:30:00+09:00"
steps:
- id: migrate
run: ./migrate.sh- The timestamp is RFC 3339 with an offset or
Z, and seconds of:00. - After it fires, Dagu marks it consumed, so it never fires again.
atentries go in a top-levelschedulelist or underschedule.start, with or withoutkind: at. Stop and restart schedules do not take them.- A one-off whose time passes while the scheduler is paused fires once it resumes.
Start, Stop, and Restart
For a long-running DAG, stop stops the active run at set times:
working_dir: .
schedule:
start: "0 8 * * *" # start at 08:00
stop: "0 18 * * *" # stop at 18:00
steps:
- id: consumer
run: ./consume-events.shEach of start, stop, and restart takes one expression or a list. stop and restart are cron only.
Restart Schedule
restart stops the active run and starts a new one, waiting restart_wait_sec in between:
working_dir: .
schedule:
start: "0 8 * * *"
restart: "0 12 * * *" # restart at noon
stop: "0 18 * * *"
restart_wait_sec: 60
steps:
- id: consumer
run: ./consume-events.shTo keep a DAG running without a schedule, starting a new run whenever one ends, use restart_policy.
Parameters per Schedule
A start entry, recurring or one-off, can set params for the runs it starts. Keys it leaves out keep the DAG's defaults:
working_dir: .
params:
mode: full
region: us
schedule:
- expression: "0 5 * * *"
params: {mode: incremental}
- expression: "0 23 * * SUN"
params: {mode: full, region: eu}
steps:
- id: sync
run: ./sync.sh --mode "${params.mode}" --region "${params.region}"The values are literal and are checked against params when the DAG loads, so a value outside an enum fails validation.
- Scheduled and catch-up runs use the entry that fired. When several fire at once, a due one-off entry wins, then the first matching recurring entry in YAML order.
- Backfill runs use the recurring entry that fires at their slot, unless the backfill passes
--params. - Retries reuse the run's saved inputs. Manual starts use their own inputs and the defaults.
The Cron launcher shows a field for each named parameter under each plain entry, with the default in grey. A value is saved to the entry's params when the field loses focus; emptying the field or the reset button removes it. Entries with calendar, profile, or at keep their params in the YAML only.
Profile-Scoped Schedules
profile makes an entry active only where the DAG's default runtime profile matches it:
working_dir: .
schedule:
- expression: "*/20 * * * *"
profile: prod
- expression: "30 */2 * * *"
profile: dev
steps:
- id: sync
run: ./sync-data.shThe default runtime profile comes from the server-side DAG settings. Unscoped entries are always active, and a DAG with no default profile ignores scoped entries. profile only filters entries; it does not choose the profile of the run.
Business Days
Name a business calendar to skip holidays, and add business_days to keep chosen business days of each month:
working_dir: .
calendar: weekdays # built in: Monday to Friday, no holidays
schedule:
- "0 9 * * *" # every business day at 09:00
- expression: "0 18 * * *"
business_days: [1, -1] # first and last business day of the month
steps:
- id: report
run: ./report.shA fire that falls on a holiday is dropped, not moved.
Preview Upcoming Runs
Select the Cron launcher on the workflow canvas to list the next runs of the start schedules: five, then up to ten with Show more. The list follows the YAML as it changes, reads each run in its schedule's zone, and names the holidays a calendar skipped.
The list comes from the definition alone. When the DAG is suspended or the scheduler is paused, the launcher says that none of the listed runs will start.
The same list is upcomingRuns in the DAG details API and in the MCP dagu_read result for a DAG. On the command line, dagu calendar fires <DAG> lists the next fires, and dagu ls -n shows each DAG's next run.
Skip Redundant Runs
skip_if_successful skips a scheduled run when the DAG already succeeded since the previous scheduled time, for example after a manual run:
working_dir: .
schedule: "0 * * * *"
skip_if_successful: true
steps:
- id: sync
run: ./sync.shManual runs always run.
Catchup (Missed Run Replay)
With catchup_window, a scheduler that starts after downtime replays the slots it missed within the window, oldest first:
working_dir: .
schedule: "0 * * * *"
catchup_window: "6h"
overlap_policy: all
steps:
- id: hourly_job
run: ./hourly-job.shIf the scheduler was down from 10:00 to 14:00, it replays 10:00, 11:00, 12:00, and 13:00, then the 14:00 slot.
- Queues must be enabled (
queues.enabled,trueby default). Catch-up runs go through the DAG's queue. With queues off, the scheduler logs a warning and replays nothing. - One slot per minute. The scheduler queues one replayed slot per tick, and only while the DAG has no running or queued run. Catch-up goes before the live schedule.
- Window. A Go duration with
dfor days, such as30m,6h, or2d12h. Replay starts from the latest of now minus the window, the scheduler's last tick, and the DAG's last scheduled slot. Omitted or zero: no replay. - At most 1,000 missed slots per DAG, the newest ones.
- No duplicates. A slot's run ID is derived from the DAG and the slot time, so a slot that already has a run, live or replayed, is not run again, even across restarts.
overlap_policy decides what happens to a replayed slot that is due while the DAG is still busy:
overlap_policy | Replayed slot while the DAG is busy |
|---|---|
skip (default) | Dropped; the next slot is tried on the next tick |
all | Kept and tried again on the next tick, so every slot runs in order |
latest | Every slot but the newest is dropped, and only that one runs |
A scheduler that takes over from a failed one replays slots missed in the last scheduler.failover_recovery_window (2 minutes by default), even without catchup_window. See Scheduler High Availability.
Running a Past Slot
To run a slot again, for example after fixing a bug, start a run for it:
dagu start --scheduled-at latest etl.yaml
dagu start --scheduled-at 2026-11-09 etl.yaml # the only fire that day
dagu start --scheduled-at 2026-11-09T02:00 etl.yaml # in the schedule's zone
dagu start --scheduled-at 2026-11-09T02:00:00+09:00 etl.yamlThe run gets the scheduled time, window, and dates that the scheduled run of that slot got, so the DAG needs no date parameters. dagu enqueue --scheduled-at, the scheduleTime field of the start and enqueue API and of the MCP execute tool, and Scheduled at in the run dialog do the same.
- A slot later than now is refused.
dagu dry --scheduled-ataccepts one and prints the slot and its window. - A date names the only fire of that day. A schedule that fires zero or several times that day fails the command, which lists the fires.
- A time without an offset is read in the schedule's zone. If the schedules use different zones, give an offset.
- A time that is not a fire time is accepted with a warning naming the nearest fires.
- The run is manual. It never stands in for the scheduled run of its slot.
- Reruns keep the slot.
dagu restart,dagu start --from-run-id, and Retry as a new run use the historic run's slot. A child DAG takes its parent's slot.
To run every slot of a range, skipping those that already ran, use a backfill.
Scheduler Process
High Availability
Several schedulers can share one data directory and DAG directory on shared storage. One holds a directory lock and runs the schedules; the others wait as standbys and take over when it stops, within about 5 seconds after a clean stop, or once the lock goes stale (30 seconds by default) after a crash. See Scheduler High Availability for storage requirements and setup.
dagu scheduler serves GET /health on scheduler.port (8090 by default; 0 disables it). The response's role is active or standby, and /health?role=active answers 503 on a standby. dagu start-all does not serve it.
Zombie Detection
A run whose status says running but whose process died, after kill -9, a crash, or an out-of-memory kill, is a zombie. Each run process writes a heartbeat file every proc.heartbeat_interval. The scheduler checks running runs every scheduler.zombie_detection_interval, and marks a run failed after scheduler.failure_threshold checks in a row find its heartbeat older than proc.stale_threshold. The run is not resumed; a DAG-level retry_policy can run it again.
# config.yaml (defaults shown)
proc:
heartbeat_interval: "5s"
stale_threshold: "90s"
scheduler:
zombie_detection_interval: "45s" # "0" disables the scheduler's check
failure_threshold: 3- Worst case with the defaults: 90s + 3 × 45s = 225 seconds. Opening the run in the UI or reading it with
dagu statusrepairs it as soon as its heartbeat is stale. - Faster detection:
heartbeat_interval: 2s,stale_threshold: 20s, andzombie_detection_interval: 10sdetect a dead process in about 50 seconds, at the cost of more frequent writes. proc.heartbeat_intervalmust be less thanproc.stale_threshold, or Dagu refuses to start.scheduler.heartbeat_intervalandscheduler.stale_thresholdare deprecated aliases.- Runs on a distributed worker are checked by the coordinator through worker heartbeats instead.
Pausing the Scheduler
Pausing the scheduler stops scheduled run creation for every DAG at once, for a maintenance window or an incident, without stopping the process. An administrator pauses and resumes it with Pause and Resume on the System Status page, or through the API:
curl -X POST "http://localhost:8080/api/v1/services/scheduler/pause" \
-H "Authorization: Bearer $DAGU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"paused": true, "reason": "database migration"}'Send {"paused": false} to resume. While paused, a banner on every page shows who paused it and why. The state is stored in scheduler/paused.json under data_dir and survives a restart.
| Trigger | While paused |
|---|---|
| Schedule, catch-up, automatic retry | No runs are created |
| Service | The active run keeps going; no new run is queued |
| Watched folder | Arrived files wait and run after the resume |
| Manual, webhook, sub-DAG | Unaffected |
| Queue processing, zombie detection, notifications | Continue |
A pause discards work as suspending every DAG would:
- Queued scheduled runs are aborted with the reason
dag schedule suspended before dispatch. - Catch-up windows are consumed. Slots inside the pause are not replayed after it. A two-hour pause with
catchup_window: "6h"loses those two hours. - Automatic retries are lost for failed runs that age out of
scheduler.retry_failure_window(24 hours by default) during the pause.
To keep missed runs for most DAGs, suspend the specific DAGs instead. After a resume, scheduling picks up from the next tick. While paused, NEXT_RUN in dagu ls reads -.
Wake Hold
After the host wakes from sleep, the scheduler's first tick fires the slot of that minute and every one-off schedule whose time has passed. scheduler.wake_hold makes it wait first, so the DAG definitions can be refreshed:
# config.yaml
scheduler:
wake_hold: "5m" # default "0": never holdWhen a tick comes more than a minute late, the scheduler pauses itself, with scheduler as the actor. The hold ends when the pause is cleared or wake_hold passes, and the held ticks then run in order. Unlike an operator's pause, a wake hold aborts no queued run, keeps retries going, and consumes no catch-up window. DAGU_SCHEDULER_WAKE_HOLD sets the same value; see the configuration reference.
Related
- Business Calendars for holidays and business days
- Schedule Dates for the dates a slot loads
- Backfill for running a range of past slots
- Queue Assignment for limiting concurrent runs
- Watched Folders for starting a run per arriving file



