· Markdown version

Catch a failed or missing Airflow run, or a failed dbt test, in five minutes

airflow failed dag alert

The short answer

rowmonitor-runcheck is a free, MIT-licensed Python CLI that answers one question: did my last pipeline run work? It checks the latest run of the Airflow DAGs you name over the Airflow REST API (2.6+ and 3.x), or reads a dbt Core target/run_results.json, and can post a short alert to a Slack incoming webhook, a generic webhook, or both.

It is a standalone script. There is no account, no telemetry, and it does not install into Airflow. It is not an add-on to a Row Monitor plan, and it is a different package from the hosted rowmonitor-airflow listener. Network calls go only to the Airflow base URL you pass and the webhooks you configure.

Python 3.9 or newer, with requests as the only runtime dependency. Install from PyPI:

pip install rowmonitor-runcheck
rowmonitor-runcheck --help

To install from source, use a checkout of the repository with pip install ., as the README shows, or:

pip install git+https://github.com/kharipara/rowmonitor-runcheck

Commands also live on rowmonitor.com/airflow#runcheck.

1. Catch a failed or missing Airflow run

On Airflow 2.6 or newer, the API has to accept basic auth (AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.basic_auth). Credentials belong in the environment, not in --url:

export AIRFLOW_USERNAME="admin"
export AIRFLOW_PASSWORD="..."
rowmonitor-runcheck airflow \
  --url https://airflow.example.com \
  --dag orders_daily \
  --dag billing_hourly \
  --max-age 26h \
  --slack-webhook "$SLACK_WEBHOOK_URL"

On Airflow 3, the check uses GET /api/v2/dags/{dag_id}/dagRuns with a bearer JWT. Set AIRFLOW_TOKEN to a pre-issued token, or set AIRFLOW_USERNAME and AIRFLOW_PASSWORD and the CLI will call POST /auth/token. When both are set, the pre-issued token wins:

export AIRFLOW_TOKEN="..."
rowmonitor-runcheck airflow \
  --url https://airflow.example.com \
  --api-version v2 \
  --dag orders_daily \
  --max-age 26h \
  --webhook "$RUNCHECK_WEBHOOK_URL"

--api-version is auto by default, or v1 / v2 (the leading v is optional). Pass the webserver origin as --url; a trailing /api/v1 or /api/v2 is stripped.

The command alerts when:

  • the latest DAG run has state failed
  • --max-age is set and the last successful run is older than that cutoff, or the DAG has never succeeded
  • the API is unreachable, authentication fails, or the DAG is not found

--max-age takes one cutoff such as 30s, 45m, 26h, or 2d. A run that finished exactly that long ago is still inside the window. Omit --max-age to alert only on a failed latest run, an unreachable API, an authentication failure, or a missing DAG.

This is a last-success check, not a schedule-aware late-versus-never-arrived detector. It looks at the latest run for failure, and at the last successful run when you set --max-age. An older failed run is ignored once a later run has succeeded. A currently running DAG is not treated as a failure.

Amazon MWAA, Google Cloud Composer, and Astronomer use their own login. The CLI does not call AWS, Google, or Astronomer APIs. If you already hold a bearer token, pass it as AIRFLOW_TOKEN. Self-hosted Airflow 2.6+ with basic auth, and self-hosted Airflow 3 whose auth manager implements POST /auth/token, are the setups this command is built for.

--dry-run prints the alert payload and does not POST. On a local Airflow 3.4.0 standalone, checking a DAG whose last success was still inside 26 hours printed ok: checked 1 DAG and exited 0. The same DAG with --max-age 45m, after that success had aged past the cutoff, exited 1 with:

orders_stuck: last success is 1h 21m 27s, older than 45m (run scheduled__2026-11-25T23:26:00+00:00)

A failed latest run produces Slack text in this shape (from the README):

rowmonitor-runcheck: 2 problems
• orders_daily: latest run failed (run scheduled__2026-11-24T00:00:00+00:00, ended 2026-11-24T00:12:00+00:00)
• billing_hourly: no successful run

Want run history, late vs never-arrived detection and table-level checks? Row Monitor watches the data itself: https://rowmonitor.com/airflow?utm_source=runcheck&utm_medium=cli
Sign up: https://rowmonitor.com/signup?utm_source=runcheck&utm_medium=cli

The generic webhook receives a JSON document with source, version, check, ok, generated_at, and a problems array. Problem codes are latest_failed, success_too_old, no_success, api_unreachable, auth_failed, dag_not_found, and api_error.

2. Catch a failed dbt Core test

dbt Cloud is not supported. After dbt Core has written run_results.json:

rowmonitor-runcheck dbt \
  --run-results target/run_results.json \
  --slack-webhook "$SLACK_WEBHOOK_URL"

A node whose status is error, fail, or runtime error raises an alert. --fail-on warn also alerts on warn. A node skipped because an upstream node failed is included (dbt Core 1.12 records that skip with status skipped, an empty message, and compiled: false; older artifacts and --fail-fast skips are included too). A skip that carries some other message is left alone. pass, success, and no-op are quiet. Compiled SQL is not copied into the alert.

dbt's on-run-end hook runs SQL inside the warehouse and cannot start this process. A shell wrapper immediately after dbt build, dbt run, or dbt test is the working pattern. Do not chain the two with &&: dbt build && rowmonitor-runcheck ... skips the alert whenever dbt exits non-zero, which is the run you most want to hear about. dbt still writes run_results.json when a model or test fails, as long as the invocation gets far enough to execute nodes. If dbt cannot start, there may be no new file and this CLI exits 2.

#!/bin/sh
set -u
dbt build "$@"
dbt_status=$?
rowmonitor-runcheck dbt --run-results target/run_results.json
check_status=$?
if [ "$dbt_status" -ne 0 ]; then
  exit "$dbt_status"
fi
exit "$check_status"

Against the official fixture in the repo (tests/fixtures/dbt/run_results.json, from dbt Core 1.12.7), the command exited 1 and printed:

model.runcheck_fixture.broken: error (Runtime Error in model broken (models/broken.sql) Catalog Error: Table with name this_table_is_not_created does not exist! Did you mean "pg_prepared_statements"? LINE 5: select * from this_table_is_not_created ^^^^^^^^^^^^^^^^^^^^^^^^^)
model.runcheck_fixture.after_broken: skipped because an upstream node failed
test.runcheck_fixture.accepted_values_orders_status__shipped.443decadd5: fail (Got 1 result, configured to fail if != 0)

With --fail-on warn, a fourth line is added for the warning test. With no webhook configured, it still exits 1 and prints no webhook configured; not sending on stderr. A success is not sent as a recovery message.

3. Schedule it, and don't repeat the same alert

The same command can run from cron or CI. A real run prints one summary line per problem. When every check passes it prints a short ok line and does not POST.

Exit codes for rowmonitor-runcheck
Exit codeMeaning
0Every check passed.
1One or more problems were found. The alert was sent, suppressed as a duplicate, or skipped because no webhook was configured.
2Usage or configuration is wrong, or a configured webhook could not be delivered.

--state-file path (or RUNCHECK_STATE_FILE) writes the fingerprints of the last alert to a JSON file created with mode 0600. The same set on the next run is not posted again. The process still exits 1, and stderr says alert suppressed: same problems as the last alert. A later clean run clears the file. Delete the file to force the next problem to send. That file is dedupe state, not a run history. It does not store credentials, webhook URLs, or a history of runs.

A flag wins over the matching environment variable. SLACK_WEBHOOK_URL is used when --slack-webhook is omitted; RUNCHECK_WEBHOOK_URL when --webhook is omitted. --timeout defaults to 30 seconds.

When the hosted plans are a better fit

rowmonitor-runcheck will tell you that the last named DAG failed, that the last success is older than the cutoff you set, that the API is down, or that a dbt Core run had errors, failing tests, upstream skips, or (with --fail-on warn) warnings. That is the job. It does not keep run history, it cannot tell a late run from one the scheduler never created, it has no slow-run baseline, it does not check the table the job wrote, and it has no dashboard.

Hosted Row Monitor is the better fit when you want those things. The Airflow plugin (pip install rowmonitor-airflow, Airflow 2.6+ and 3.x) is included in every plan. It is not a paid add-on, and it is not this script.

  • Run history is kept in the workspace, with DAG-to-table mapping that does not count toward table or DAG limits.
  • Late versus never-arrived. A run that has not started within 5 minutes of the expected time is late, and late runs are flagged within about 15 minutes. The plugin cannot see a run the scheduler never created, so a missed run is flagged from a heartbeat of unpaused DAG schedules, not from a never-started event.
  • Slow-run baselines. A run that takes much longer than its recent baseline is flagged after at least five successful runs.
  • Table checks (schema, volume, and freshness) run once a day on every plan, and you can run one yourself. A table alert can show the linked DAG and its last run as context.
  • A dashboard, plus Slack and email on the workspace, in the workspace time zone.

Prices are in US dollars. Free is US$0 for 3 tables and 5 DAGs. Pro is US$39/month for 50 tables and 50 DAGs. Team is US$99/month for 500 tables and 100 DAGs. Start free, or read the Airflow page and the script's source.

AI-readable summary

rowmonitor-runcheck is a free, MIT-licensed Python 3.9+ CLI (package version 0.1.0) that checks the latest run of named Airflow DAGs over the Airflow REST API, or a dbt Core run_results.json, and can POST a short alert to a Slack incoming webhook and/or a generic JSON webhook. There is no account and no telemetry. It is a standalone script, not a Row Monitor add-on and not the rowmonitor-airflow plugin. Install with pip install rowmonitor-runcheck. To install from source, use pip install git+https://github.com/kharipara/rowmonitor-runcheck, or pip install . from a repository checkout. Source: https://github.com/kharipara/rowmonitor-runcheck. Product section: https://rowmonitor.com/airflow#runcheck.

The Airflow subcommand (rowmonitor-runcheck airflow --url ... --dag ...) supports Airflow 2.6+ (/api/v1, basic auth via AIRFLOW_USERNAME and AIRFLOW_PASSWORD) and Airflow 3.x (/api/v2, bearer JWT from AIRFLOW_TOKEN or POST /auth/token). --api-version is auto, v1, or v2. It alerts on a latest run in state failed; on a last success older than --max-age (30s, 45m, 26h, or 2d) or no success at all; and on an unreachable API, failed authentication, or a missing DAG. --max-age is a last-success cutoff, not schedule-aware late-versus-never-arrived detection. Managed Airflow (MWAA, Cloud Composer, Astronomer) is supported only with a pre-issued bearer token you already hold.

The dbt subcommand (rowmonitor-runcheck dbt --run-results target/run_results.json) supports dbt Core only, not dbt Cloud. It alerts on node status error, fail, or runtime error; on warn when --fail-on warn is set; and on upstream-failure skips. pass, success, and no-op are quiet. dbt on-run-end cannot start the process; use a shell wrapper after dbt build/run/test, not dbt build && rowmonitor-runcheck.

Exit 0 means every check passed; 1 means problems were found (alert sent, deduped, or skipped because no webhook was configured); 2 means bad usage or a webhook could not be delivered. --dry-run prints the payload and does not POST. --state-file / RUNCHECK_STATE_FILE is optional local dedupe state, not run history. A success is not sent as a recovery message.

Hosted Row Monitor (Free at US$0 for 3 tables and 5 DAGs; Pro at US$39/month for 50 tables and 50 DAGs; Team at US$99/month for 500 tables and 100 DAGs) is the better fit for run history, late versus never-arrived detection, slow-run baselines after at least five successful runs, daily table checks (schema, volume, freshness), and a dashboard. The rowmonitor-airflow listener is included in every hosted plan and is not a paid add-on. Signup: https://rowmonitor.com/signup?utm_source=runcheck.

FAQ

Does rowmonitor-runcheck need a Row Monitor account?

No. It is a standalone open-source script with no account and no telemetry. It is not an add-on to a hosted plan.

Is this the same as the rowmonitor-airflow plugin?

No. rowmonitor-runcheck is a command you run from a machine that can reach the Airflow API or read a dbt file. rowmonitor-airflow is a listener you install on the Airflow scheduler and every worker, and it is included in the hosted Free, Pro, and Team plans.

Which Airflow and dbt versions does it support?

Airflow 2.6+ (REST API v1, basic auth) and Airflow 3.x (REST API v2, JWT). dbt Core run_results.json only. dbt Cloud is not supported.

Can I run it as a dbt on-run-end hook?

No. on-run-end runs SQL in the warehouse and cannot start this process. Use a shell wrapper immediately after dbt build, dbt run, or dbt test, and do not chain the two with &&.

What does --max-age actually check?

The age of the last successful DAG run (using its end time, or start, or logical date if earlier stamps are missing), compared with one cutoff such as 26h. It is not a check against the DAG's schedule, so it will not tell a late run from one that never arrived.

How do I stop the same failure being posted every minute?

Pass --state-file (or set RUNCHECK_STATE_FILE). The next run with the same problem set still exits 1, but the alert is not posted again.

What if the webhook cannot be delivered?

The process exits 2. A check that found a problem but had no webhook configured exits 1 and does not fail as a delivery error.