Alert Rules
Alert rules let you fire a silent failure alert based on the output of a successful job — without your job needing to throw an error.
The problem they solve
Some jobs succeed technically but produce a bad outcome. A database sync job that connects fine but processes zero rows is a success from the process's perspective, but it probably shouldn't be silent.
With alert rules, you can configure Crontify to fire an alert whenever a job succeeds but the result doesn't look right.
How they work
- Your job sends a
/successping and includes ametaobject with numeric fields - Crontify evaluates each alert rule against the
metaobject - If a rule's condition is true, a
silent_failurealert fires on all attached channels - The run retains
successstatus — a silent failure is not a crash
Rule structure
Each rule has three parts:
| Field | Description |
|---|---|
| Field | A key from the meta object — alphanumeric and underscores, max 50 characters |
| Operator | One of lt, gt, eq, ne |
| Threshold | A numeric value to compare against |
Operators
| Operator | Meaning | Example |
|---|---|---|
lt | Less than | rows_processed lt 100 — alert if fewer than 100 rows |
gt | Greater than | error_count gt 0 — alert if any errors occurred |
eq | Equals | rows_processed eq 0 — alert if exactly zero rows |
ne | Not equals | exit_code ne 0 — alert if exit code is non-zero |
A rule fires when the condition evaluates to true. rows_processed eq 0 fires when the value is zero — not when it fails to be zero.
What happens if the field is missing?
If the field named in a rule is absent from the meta payload, the rule is silently skipped — no alert fires. A missing field and a zero value are treated as different things by design.
SDK usage
await monitor.success({
meta: {
rows_processed: 0, // A rule of `rows_processed eq 0` would fire
emails_sent: 0,
duration_ms: 1200,
},
});
await monitor.fail({
message: 'Query timed out',
meta: { exit_code: 1 },
});
Configuring rules
Rules are configured per monitor from the monitor form (New Monitor or Edit Monitor). Each monitor supports up to 5 rules.
To add a rule:
- Scroll to the Alert Rules section of the monitor form
- Enter a field name, choose an operator, and set a threshold
- Click + Add Rule
- Save the monitor
Rules take effect immediately — the next success ping that includes the relevant field will be evaluated.
Alert deduplication
Silent failure alerts follow the same cooldown rules as other alert types. If your job fires a silent_failure alert every minute, the cooldown (default 60 minutes) ensures you're not flooded with notifications.