New to Kestra?
Use blueprints to kickstart your first workflows.
Detect batch SLA breaches in Kestra and page Squadcast with flow and SLA tags. Runtime is checked against a threshold and healthy runs stay quiet.
A batch that finishes late can be worse than a batch that fails, because nothing errors and nobody looks. This blueprint makes the SLA itself the alarm condition. The flow runs its batch work, then computes elapsed time from {{ execution.startDate }} and compares it against an sla_seconds input inside an If task. A breach opens a Squadcast incident through io.kestra.plugin.squadcast.SquadcastIncomingWebhook, tagged with the flow and the SLA that was blown; a run inside the window writes one log line and raises nothing.
start_batch logs the SLA for the run, and batch_work (io.kestra.plugin.core.flow.Sleep) stands in for the real workload with a duration taken from the batch_duration input.check_sla (io.kestra.plugin.core.flow.If) evaluates (now() | timestamp) - (execution.startDate | timestamp) > inputs.sla_seconds, plain epoch arithmetic on the execution's own start time, no extra state needed.page_sla_breach posts a JSON payload with status: trigger, the execution id as event_id, and tags carrying the flow and the SLA value, so the incident says exactly which contract was broken.log_within_sla records the healthy run, turning the execution history into an SLA compliance trail.errors block reports to Slack when the pager flow itself fails, because an unpaged breach is invisible.Schedule runs the batch at 02:00.The orchestrator already knows when the execution started and what it contains, so SLA measurement costs one Pebble expression instead of an external monitoring stack. Kestra provides the schedule, the branching, the pager integration, and a durable per-run record of SLA compliance in one flow.
SQUADCAST_WEBHOOK_URL: the full Squadcast incoming webhook endpoint, including its token.SLACK_WEBHOOK_URL: Slack incoming webhook URL for the fallback alert.sla_seconds set to 3 and batch_duration at PT5S, and confirm a Squadcast incident opens tagged sla: 3s.batch_work with your real batch tasks and enable the nightly trigger.sla_seconds per environment with namespace variables so production pages harder than staging.