Library /
Rule
Failsafe deadline
A scheduling rule that rebuilds a sales mart once its sources settle, or at 07:30 if no load came.
Use it when A mart is event-driven, but a morning report needs it built by a fixed time even when a source is late.
- name: Refresh the daily sales mart after the warehouse loads
code_id: marts/mart-sales-daily
description: Rebuilds mart_sales_daily once its source tables have settled.
priority: 5
status: active
status_by_env:
dev: paused
tags:
- marts
- sales
applies_to:
node_type: DataformAction
node_ids:
- DataformAction_acme-mart-{ENV}.marts.mart_sales_daily
when:
events:
- origin: ancestors
ancestor_depth: direct_materialized
types:
- BIGQUERY_INSERT
- BIGQUERY_MERGE
wait_for_all_ancestors: true
wait_for_all_ancestors_timeout_seconds: 5400
wait_for_all_ancestors_timeout_alert: true
if:
quiet_period_seconds: 600
then:
target:
same_as_applies_to: true
scope: node
do:
kind: single
action:
type: dataform_run
parameters:
release: projects/acme-mart-{ENV}/locations/europe-west1/repositories/acme-marts/releaseConfigs/daily
failsafe:
enabled: true
deadline_cron: "30 7 * * *"
time_zone: Europe/London
- Line 2the rule's stable identity when it is kept as a file
- Line 6file-only: the status per environment
- Line 17events on the nodes this one reads from
- Line 19matched exactly; list every write type you care about
- Line 22fire once every source has produced a new event
- Line 26wait for 10 quiet minutes before running
- Line 37acts on machines: run the rule if no trigger came
Taken from docs/concepts/scheduling.md
The scheduling docs' example rule, without its limits and retries (see Retry with backoff)
and its freshness expectation (see Freshness expectation). The acme names are
fictional.
The rule waits for every source of the mart, then for ten quiet minutes. The failsafe acts on machines: if no trigger
came by 07:30, London time, Nistor runs the action itself, and raises no alert. Set exactly one of deadline_cron and
deadline_after_seconds; the second also needs window: rolling.
Feeds fromGoogle Cloud