Hi @rwalrondNHS,
You can set these thresholds and notifications programmatically. They’re part of the normal Jobs definition, not a UI‑only feature. I've just tested this for a sample job and it works perfectly.
Under the hood, the run longer than X --> send email UI maps to the below
- health.rules with metric = RUN_DURATION_SECONDS, op = GREATER_THAN, value = <seconds>
- email_notifications.on_duration_warning_threshold_exceeded = [ "you@example.com", ... ]
For example (Jobs API 2.1/2.2): This is the output I had from my sample job notification setting
{
"health": {
"rules": [
{
"metric": "RUN_DURATION_SECONDS",
"op": "GREATER_THAN",
"value": 60
}
]
},
"email_notifications": {
"on_duration_warning_threshold_exceeded": [
"ashXX.XXX@XXX.com"
]
}
}
If your deployment pipeline uses jobs/create or jobs/reset and doesn’t include these fields in the JSON/YAML it sends, those UI‑configured values get overwritten by whatever is in code (which in that case is "nothing"). That’s not a limitation of the feature, it’s just “"nfra as code" doing what it’s supposed to do: the code is treated as the source of truth.
So..it’s not true that you can’t set them via code. You absolutely can (and should, if you have weekly deploys). However, manual UI tweaks will be wiped if your job‑as‑code definition omits them on each deploy.
The UI is still useful for interactive editing and discovery, but in a CI/CD setup you’ll want to copy those settings into your job JSON/Terraform/Bundles config so they persist across rebuilds.
Hope this helps.
If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.
Regards,
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***