Routines

When a Scheduled Routine Reports Success but Produces Nothing

A run that exits cleanly with an empty result is the hardest workflow failure to notice, because every dashboard stays green. Here is how to detect the three shapes of an empty success, how to replay the missed window without doubling the records, and where to put the expectation that would have caught it.

The morning report went out at 7:00 as always. It was one page long, correctly formatted, addressed to the right eleven people, and completely empty below the header. The status page showed a green check next to the job. Nobody wrote a ticket, because nothing had failed. Two days later a manager asked why the daily numbers had stopped moving, and the answer turned out to be a source export that had changed its column names on Monday.

That is the failure mode this piece is about: the routine that runs, finishes, reports success, and delivers nothing. It is more dangerous than a crash, because a crash produces a person who knows something is wrong within minutes. An empty success produces no such person. It leaves a green light, a delivered email, and a quiet drift in decisions built on data that stopped arriving.

Three shapes of an empty success

The zero-row payload is the obvious one. A filter matched nothing, a query returned no records, a webhook sent an empty array. The job did exactly what it was told with the input it received.

The unchanged artifact is quieter. The file was rewritten with byte-identical content, or the sheet was touched but no new rows were appended. If two consecutive runs produce the same fingerprint, one of them usually did nothing, and the second one is a candidate for that honor.

The partial structure is the most deceptive. The report has rows, but a column is blank because the field moved upstream. The export has records, but the date range collapsed to one day after a timezone reset. Everything passes a non-empty check and still fails the reader.

Each shape needs a different check, and a single "did it run" signal catches none of them. A status field can only tell you that a process returned, not that it returned something worth sending.

Why exit codes cannot see emptiness

A script exits non-zero when it hits an error it did not handle. An empty result is not an error. The call succeeded, the response parsed, the loop iterated zero times, and the writer wrote a valid file with no data rows in it. From the process's point of view, the work is complete.

No-code tools have the same gap. A filter step that matches nothing is a successful step, and the run history shows green boxes from start to finish.

This is why so many teams discover empty runs from humans rather than monitors. The monitor watches for exceptions, and emptiness is not an exception. Google's SRE workbook makes the general point when it discusses tuning alert rules: an alert strategy is judged on precision, recall, detection time, and reset time, and a rule that only watches for hard errors has poor recall for exactly the failures that do not raise errors. You can read the chapter at sre.google/workbook/alerting-on-slos, and the framing applies well beyond infrastructure.

The practical consequence is that detection has to be built as a statement about expected output, not about process state. "The job ran" and "the job produced what the next step needs" are different claims, and only the second one protects the reader.

Put an expectation on every run

The cheapest version of this is four numbers recorded at the end of each run, written into the same log line: rows produced, the expected range, the newest record timestamp in the output, and a fingerprint of the output file.

Rows produced against an expected range catches the zero-row case and the collapse case. A weekly report that usually carries 400 to 600 rows and shows 3 is failing, whatever the status says. A range beats an exact number, because exact counts break on holidays and teach people to ignore the alert.

Newest record timestamp catches staleness hiding behind a correct row count. If the output has 500 rows and the newest is nine days old, the pipeline is re-sending history, a pattern common after a source change.

The file fingerprint catches the unchanged artifact. If today's hash matches yesterday's, either nothing new happened upstream or the writer failed silently. On an hourly routine, wait for two identical runs before paging anyone.

None of these checks require a data platform. A spreadsheet formula, a shell one-liner, or one "if" step at the end of a no-code flow can compute all four, for about fifteen minutes of setup per routine.

One design note worth stating plainly. These checks describe the output, not the process, and that is the whole point. A process monitor answers whether the machinery moved. An output check answers whether anything arrived at the other end, which is the only question the person waiting on the report actually cares about. Teams that monitor only the machinery tend to have excellent uptime numbers and a long trail of quiet misses, because the failure they built for is the one where something stops, and the failure they got is the one where something keeps going with nothing in it.

Recovering the window

Once you know a run produced nothing, the repair has two parts: regenerate the missing period, and stop the same emptiness from reaching readers again.

Regeneration is a replay. In scheduler terms, you create runs for past dates, and the important decision is what to do about runs that already exist. Apache Airflow's backfill documentation lays out three options clearly: skip any date that already has a run regardless of its state, recreate only dates whose run failed, or recreate every date in the range including completed ones. Choose deliberately. For an empty-success incident, the skip-existing rule is the trap, because the broken run looks completed, so a replay that skips completed runs will cheerfully do nothing and report success again, which is the same failure one layer up.

Before you replay, print the dates the replay would touch and check them by hand. Airflow calls this a dry run, and its value is that the set of runs actually created depends on the state of existing runs at the moment you press go.

Order matters too. If the newest window is what people are reading, run the replay backwards so today's data lands first. And cap concurrency, because a replay competes with scheduled work for the same capacity. Airflow separates the replay's own limit from the routine's normal limit for exactly that reason.

The duplicate trap

A replay that re-sends data is a replay that can double-count. If the destination appends whatever it receives, replaying three days writes three days twice. If it upserts on a key, the same replay is harmless.

So the first question before any replay is whether the write is keyed. If it is keyed on a date or an order id, replay freely. If it appends, replay into a staging area, compare against what is already there, and merge with a dedupe step. An empty report costs a day; a duplicate write can cost a week of reconciliation with finance or with a customer.

Tell the readers first

The instinct is to fix quietly and say nothing. Resist it for anything other people read. A short note at the start, naming the affected dates and when a corrected version is due, prevents the second incident, the one where six people rebuild the same numbers and then disagree about them.

Keep it factual: which routine, which dates, what is missing, when a corrected copy is expected, and who to ask. Send a second note when the replay lands. Two messages, four lines each.

Close the loop

The last step is the one that stops the repeat. Add the expectation you wished you had to the routine itself, so the next empty success trips a red light. If the platform allows only a status code, put the check in a small separate job that reads yesterday's output and fails when the count is out of range. A five-line checker on the output beats a long list of monitors on the process.

Then write one line in the routine's own notes: the date, the shape of the failure, the check that now catches it. The next owner will read it the day the source changes its columns again.

Sources

  1. BackfillApache Airflow Documentation · accessed
  2. Alerting on SLOs (The Site Reliability Workbook, Chapter 5)Google SRE · accessed

Automation Design

How to Prove a Scheduled Automation Actually Ran Last Night

A missing row can mean the schedule never fired, the trigger found nothing, or the run failed after it started. A heartbeat record and a count against the calendar separate the three, so recovery starts in the right place.