Docs › Apache Airflow with RunVouch

Apache Airflow with RunVouch

Airflow is very good at telling you a task failed. A task that succeeds with an empty DataFrame, a DAG that is paused, or a scheduler that stopped scheduling all look like silence.

How it runs on Apache Airflow

Wrap the command of a BashOperator, or use the Python client inside a PythonOperator / @task. One RunVouch agent per DAG (or per critical task) is the usual shape.

Store the key

An Airflow Variable or Connection backed by your secrets backend; pass it into the task environment (env={"RUNVOUCH_KEY": ...}) rather than hardcoding.

Wrap the job

from airflow.decorators import dag, task
from airflow.operators.bash import BashOperator
from airflow.models import Variable
import pendulum, runvouch

@dag(schedule="0 2 * * *", start_date=pendulum.datetime(2026, 1, 1, tz="UTC"), catchup=False)
def nightly_report():
    build = BashOperator(task_id="build",
        env={"RUNVOUCH_KEY": Variable.get("runvouch_key")},
        bash_command="rv run nightly-report --evidence-file /out/report.html -- python /opt/report.py")

    @task
    def summarise():
        with runvouch.vouch("nightly-summary", evidence=lambda: {"rows": n > 0}) as run:
            n = summarise_rows(run)   # run.tool(...) per LLM call for cost and loop detection

    build >> summarise()

nightly_report()

rv fails open: if RunVouch is unreachable the job still runs and you get one warning line.

Register the cadence and caps

rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2

Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.

What goes silent on Apache Airflow

What RunVouch detects

AlertWhat it means here
MISSEDcadence plus grace passed and no run started
FAILEDnon-zero exit or a reported failure, with the stderr excerpt
NO_EVIDENCEthe run said ok but the file, URL or assertion you required is missing
STALLEDa run started and never ended within max runtime
RETRY_STORMthe same tool called with identical input many times in one run
BUDGET_RUN / BUDGET_DAYcost cap crossed; the agent is paused until you resume it
DRIFTduration or output size far off its 7-run baseline

Need a key? Get a free key · Stuck? contact