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***