New to Kestra?
Use blueprints to kickstart your first workflows.
Enforce a runtime SLA on Hex notebooks with Kestra. maxDuration fails runs that overshoot the budget and pages Discord as a breach, with timing on success.
A notebook that normally takes four minutes and suddenly takes forty is telling you something, a query regressed, a table exploded, an upstream source is limping. Without a budget, that signal arrives as a vague "the dashboard feels slow lately" weeks later. This blueprint gives the run a contract: io.kestra.plugin.hex.projects.Run executes with maxDuration bound to a flow input, so any run that overshoots the SLA fails the task and pages Discord as a breach, while healthy runs report their actual elapsed time against the budget.
sla input (type DURATION, default ten minutes) defines the runtime budget, and run_within_sla passes it straight into the Run task's maxDuration.wait: true, the task polls the run every ten seconds; if the run has not reached a terminal state when maxDuration elapses, the task fails, and a run that errors in Hex fails it too.errors block, where page_sla_breach posts an explicit incident-style message to Discord naming the budget that was broken.report_healthy posts the run's elapsedTime next to the SLA, so the channel watches the margin shrink over weeks instead of discovering the breach cold.Schedule exercises the guard so regressions surface the hour they appear.Hex runs the notebook as long as it takes; it has no concept of how long it should take. Kestra imposes the contract from outside: maxDuration turns time into a failure condition, the errors block turns that failure into a page, and the execution history holds every run's timing for the postmortem. The same guard pattern then applies unchanged to any other task in your stack with a runtime promise.
HEX_API_TOKEN: Hex API token used to run the project.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.HEX_API_TOKEN and DISCORD_WEBHOOK_URL secrets to your Kestra namespace.project_id, leave the default ten-minute SLA, and execute the flow; Discord should report the elapsed time against the budget.sla set below the notebook's real runtime to see the breach page, then set a budget with sensible headroom and enable the hourly trigger.ForEach, each against the same or a per-project budget.elapsedTime into a metrics store from a downstream task to alert on trend, not only on breach.