You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow a job to declare a single parent job as a dependency. The job is skipped at execution time if the parent did not succeed within a configurable time window.
Motivation / Use Case
Common for sequential workflows: a "verify backup" job should only run if the preceding "create backup" job succeeded. Currently this requires external scripting or manual scheduling gaps.
Proposed Behaviour
Each job can optionally specify one parent job and a "must have succeeded within N minutes" window
At execution start, cron-wrapper.sh checks the parent's last execution result
No change to the cron schedule itself — the dependency check is runtime, not schedule-level
Circular dependency detection at save time (UI + agent validation)
Affected Component
cron-wrapper.sh
Agent
Web UI
First Implementation Idea
Schema — add depends_on_job_id (nullable FK → cronjobs.id) and depends_on_max_age_minutes (int, default 60) to the cronjobs table; new migration file.
New agent endpoint — GET /crons/{id}/dependency-check returns {"satisfied": true/false, "reason": "..."} based on querying the most recent successful root execution (retry_attempt = 0, exit_code = 0) of the parent within the configured window.
cron-wrapper.sh — after the singleton check and before fetching the command, call the dependency-check endpoint. On satisfied: false, POST /execution/start + /execution/finish with exit code -7 ("Skipped – dependency not met") and exit.
CronGetEndpoint — include depends_on_job_id and depends_on_max_age_minutes in the job payload.
Web UI — job form gains a "Depends on" dropdown (job selector) and a "within N minutes" input; only shown when a parent is selected. Circular dependency validated on save.
Summary
Allow a job to declare a single parent job as a dependency. The job is skipped at execution time if the parent did not succeed within a configurable time window.
Motivation / Use Case
Common for sequential workflows: a "verify backup" job should only run if the preceding "create backup" job succeeded. Currently this requires external scripting or manual scheduling gaps.
Proposed Behaviour
cron-wrapper.shchecks the parent's last execution resultAffected Component
First Implementation Idea
depends_on_job_id(nullable FK →cronjobs.id) anddepends_on_max_age_minutes(int, default 60) to thecronjobstable; new migration file.GET /crons/{id}/dependency-checkreturns{"satisfied": true/false, "reason": "..."}based on querying the most recent successful root execution (retry_attempt = 0,exit_code = 0) of the parent within the configured window.satisfied: false, POST/execution/start+/execution/finishwith exit code-7("Skipped – dependency not met") and exit.CronGetEndpoint— includedepends_on_job_idanddepends_on_max_age_minutesin the job payload.