From cron to event-driven
Rules that start a job when its data lands, replayed in the Rule Lab before they replace a cron trigger.
Today
- A cron trigger fires at its time, late load or not.
- An early load waits for nothing.
- Triggers live in different places, and nobody is sure what each starts.
With Nistor
- Composer, Airflow and Cloud Scheduler jobs read as assets of the graph.
- Rules that fire once every source has new data.
- A failsafe and a freshness expectation for the morning a source is late.
Three outcomes. Each links to the part of Nistor that does it.
See what each trigger starts
A Cloud Scheduler job linked to its target, an Airflow task to its tables.
Lineage you never had to draw. →Fire on data
A rule waits for every source, then for a quiet period.
Run when the data is ready, not when the clock says. →Hear when it is late
A freshness expectation opens a delivery incident.
From red to root cause on one screen. →
Your first week. One step a day; the quickstart has the commands.
- Day 1
Map the triggers
Find each Cloud Scheduler job and Airflow task in the lineage.
- Day 2
Write one rule
On the tables the job reads, kept as a file.
- Day 3
Validate it
Check the file against the rule schema before syncing it.
- Day 4
Keep a failsafe
A deadline that runs the rule if its trigger never came.
The commands for each day are in the quickstart →
Details. How each part works, in more depth.
The example rule from the scheduling docs rebuilds a mart once its sources have settled:
- name: Refresh the daily sales mart after the warehouse loads
code_id: marts/mart-sales-daily # the rule's stable identity when it is kept as a file
description: Rebuilds mart_sales_daily once its source tables have settled.
priority: 5
status: active
status_by_env: # file-only: the status per environment
dev: paused
tags:
- marts
- sales
applies_to:
node_type: DataformAction
node_ids:
- DataformAction_acme-mart-{ENV}.marts.mart_sales_daily
when:
events:
- origin: ancestors # events on the nodes this one reads from
ancestor_depth: direct_materialized
types: # matched exactly; list every write type you care about
- BIGQUERY_INSERT
- BIGQUERY_MERGE
wait_for_all_ancestors: true # fire once every source has produced a new event
wait_for_all_ancestors_timeout_seconds: 5400
wait_for_all_ancestors_timeout_alert: true
if:
quiet_period_seconds: 600 # wait for 10 quiet minutes before running
max_runtime_seconds: 7200
run_limit:
max: 3
period: day
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
retry:
mode: exponential
max_retries: 3
failsafe: # acts on machines: run the rule if no trigger came
enabled: true
deadline_cron: "30 7 * * *"
time_zone: Europe/London
freshness_expectation: # acts on people: open an incident if still late
days: weekdays
before: "08:00"
time_zone: Europe/London
incident_severity: high
The Rule Lab shows what a draft rule would do before you save it. Nothing is stored until you save. Its replay shows when the rule would have fired over past days, next to what ran. A rule in test status is evaluated, but its action is only simulated. Rules live as files: nistor rules validate checks them without an API, and nistor rules sync pushes them. Rules, events, cron, conditions, rules as code and the Rule Lab are open source.
Where the triggers live today
The Google Cloud tool reads Composer environments, Airflow DAGs and Cloud Scheduler jobs as nodes. Lineage links a Cloud Scheduler job to its target, and an Airflow task to the BigQuery tables its operator names. Events reach Nistor through Cloud Logging, BigQuery job completions and table data changes among them. A source that sends no audit-log events, such as a table in another organisation, can be polled for its last-modified time instead, every 900 seconds by default.
Before the rule replaces the cron
A rule can have events and a schedule at once. With wait_for_new_data, a cron rule fires only if new events arrived since its last run. In the Rule Lab, the blast radius lists the nodes a draft would match, and whether it wins, loses or shares each one with the rules already there. The replay covers the last 7 to 90 days, for up to three nodes. A failsafe runs the action and raises no alert. A freshness_expectation runs nothing and opens a delivery_slo incident, resolved once the target is fresh. A synced rule is locked: the API refuses to edit or delete it, so the file stays the one place to change it.







