Get an alert when a job loads 0 rows, or far fewer than usual
The nightly import finished, the scheduler says success, and the table has 0 rows. Or 2,140 rows instead of the usual 48,000. Nothing failed, so nothing alerted. Exit codes can't catch this; a row count sent with every run can.
Why "success" says nothing about the rows
A scheduler judges a job by its exit code, and a script's exit code only says whether it crashed. These all end with 0:
- the source file arrived empty, or was yesterday's file again;
- a query's date filter matched nothing because of a time zone or a holiday;
- an API answered with an empty list instead of an error;
- a join or filter in the script dropped most rows after a column was renamed upstream;
- an export ran against a test database left in the connection string.
The job did exactly what it was told. Developers run into the same thing ("Your job succeeded but did nothing – how do you even catch that?" on Reddit, 2025), and the answer is always the same: the job has to report what it did, and something has to compare that with what it usually does.
Send the row count with every run
In TaskBeacon the finishing ping carries the number: ?rows=48210, or JSON. The first time a job sends it, the job gets two rules for it, which you can change on the job page:
- Rows below 1: a run that loaded nothing is Odd data right away.
- Rows drop more than 40% below the recent average: compared with the last normal runs, once there are 3 of them. Runs that broke a rule don't count towards the average, so one bad night doesn't become the new normal.
In Python the default code already sends len(df):
# --- TaskBeacon: top of the script (standard library only) ---
import json, traceback, urllib.request
TB = "https://taskbeacon.io/ping/your-job-id"
def tb_ping(path="", data=None):
body = json.dumps(data).encode() if data else None
req = urllib.request.Request(TB + path, data=body, headers={"Content-Type": "application/json"})
try:
urllib.request.urlopen(req, timeout=10)
except Exception as e:
print("TaskBeacon ping failed:", e)
tb_ping("/start")
try:
# --- your code here ---
df = [1, 2, 3] # example data: replace with your own (e.g. pandas.read_csv)
except Exception as e:
# the error and the last 20 lines of the traceback go with the failure
tb_ping("/fail", {"error": f"{type(e).__name__}: {e}"[:200],
"log": "\n".join(traceback.format_exc().splitlines()[-20:])[-4000:]})
raise
# --- TaskBeacon: end of the script ---
tb_ping("", {"rows": len(df)})In the app, the Code tab of your job gives you this code with the job's own address instead of your-job-id, and you can untick the parts you don't need.
Count what matters: the rows written to the target table, not the rows read. If you load several tables, send several numbers ({"rows": 48210, "orders": 1830}) and add a rule for each (rules on your own numbers are part of Pro, open to everyone for now; the row rules are on every plan); see your own number. The same works in R (nrow(df)), Stata (_N), SAS and SPSS, whose default code sends a count too.
What the alert looks like
The job turns Odd data and the alert says why in one line, for example rows = 2,140, 96% below the recent average of 48,215. The job page shows the rows of each run against the usual level, so you can see whether it was one bad night or a slow slide. If a smaller number is the new normal, change the rule or mark the run as checked.
Without TaskBeacon
Put the check into the job: after loading, count the rows and raise an error (exit non-zero) when the count is 0 or below a fixed minimum, so the failure becomes visible to the scheduler. In a dbt project, a data test on the model does this; Great Expectations has expect_table_row_count_to_be_between. A fixed minimum is easy; "much lower than usual" needs the history of earlier counts, which means storing them somewhere and computing an average, and you still need a way to be told. Related: data freshness checks catch the case where the rows are there but old.
Connected Claude or ChatGPT to TaskBeacon? Ask it "what failed last night, and why?" and it answers from your jobs. How that works.
Related
In the Docs: Number of rows · Statuses · Python.
- Check that a daily table or file is freshA load that "works" but brings yesterday's data again.
- Check that last night's backup exists and isn't emptyThe backup ran; the file it made is 0 KB.
- Get an alert when a Stata do-file fails in batch modeStata /e and -b don't report a failed do-file to the scheduler.
- SQL Server Agent job failure alerts without Database MailAgent emails need Database Mail, an operator and a restart, and say nothing about a job that didn't run.
TaskBeacon is free to start, with every feature open for now and no credit card. Create a job, paste the code, and the first ping shows up on the job page.
Start free View live demoSources
- Great Expectations: expect_table_row_count_to_be_between (undated, © 2026; checked 2026-11-09)
- dbt docs: data tests (undated; checked 2026-11-09)
- Reddit r/laravel: Your job "succeeded" but did nothing – how do you even catch that? (about 2025 (estimated))
Page checked against its sources on 2026-11-09. Menus and limits of other products change; if something here no longer matches, write to support@taskbeacon.io.