Your Scheduled Agent Fired Late and Then All at Once

A nightly agent runs on a cron for months, then the model provider has a bad hour and the fire time passes with nobody home. The run is skipped, or it fires two hours late, or every missed run wakes at once the moment the provider recovers and buries it again.

Viral RuparelNo. 96 of 9611 min read

A team I was helping ran a reconciliation agent on a plain cron. Every night at 02:00 it pulled the day's transactions, checked them against a ledger, and wrote a short exceptions report the finance team read with their coffee. It had done this without a hiccup for most of a year. Then one night the model provider had a bad hour right at 02:00. The run started, made three calls, got timeouts on all of them, and the process exited. The scheduler noticed nothing, because from its point of view the job had run. The next night the agent ran normally against a fresh day, and the gap from the bad night sat there unreconciled. Nobody saw it until a week later, when a dispute turned up a transaction the missing report would have flagged.

Nothing in that story is a bug in the agent. The prompt was fine, the tools were fine, the schedule was correct. What was missing is any answer to a question the cron never asks: what should happen when the run that was supposed to fire did not. That question stopped being academic this month. During the correlated outages across major platforms in mid November 2026, a research note from the Cloud Security Alliance recorded that scheduled tasks and routines ran more than two hours late and some were skipped outright, and argued that teams running unattended agents should treat late and skipped runs as a reconciliation problem, not an availability footnote. That is exactly right, and it is the gap most schedules have.

Left, a cron fires three agent runs straight through, one is skipped during an outage with no record and the next runs against fresh state leaving a gap; right, a misfire gate records every planned slot, skips or catches up by policy, and emits a reconciliation record for the missed window.
Figure. A scheduled agent with no misfire policy versus one with a misfire gate and reconciliation

A cron is a clock, not a promise

A cron expression tells a scheduler when to try. It says nothing about what a try means when the attempt cannot happen, which is the only interesting case. For a long time that was fine, because the jobs on crons were cheap, idempotent, and local: rotate a log, clear a cache, send a digest. If one was missed, the next one covered for it, and the cost of a skip was a rounding error.

An agent on a schedule is none of those things. It calls a remote model that can be slow, rate limited, or down. It takes minutes, not milliseconds, so a run can straddle the next fire time. It often takes real actions, writing a report or filing a ticket, so a skipped run leaves a hole in a record something downstream assumes is complete. And it runs unattended, which means the one property that saved interactive systems, a human who notices and retries, is gone. The clock keeps ticking, but the thing behind it is now a promise someone relies on, and a promise needs a rule for what happens when it is broken.

The move is to stop treating the schedule as a direct line into the agent and put a small gate in front of it, the same shape as the trigger layer that sits in front of a background agent. The gate's whole job is to answer the question the cron cannot: given that this slot is firing now, possibly late, possibly after others were missed, should the agent run, and over what. Everything below is what that gate decides.

Three ways a missed slot goes wrong

A missed slot is not one failure. It is three, and they want different handling.

The first is the silent skip. The run never starts, so it emits nothing: no log line, no error, no trace. Every tool you have points at runs, and a run that did not happen is invisible to all of them. This is the one that bit the finance team, and it is the most dangerous because you cannot alert on a failure that was never emitted.

The second is the late run. The slot fires, but hours after its time, because the scheduler was backed up or the provider only just came back. For some jobs that is harmless. For a job about a moment, a 02:00 snapshot or a pre-market check, a run at 04:00 is worse than no run: it produces an output stamped with the wrong assumptions and looks authoritative while being wrong.

The third is the catch-up storm. The scheduler kept count of every slot it missed and, the instant the provider answers, releases all of them at once. A five-minute cron that was dark for two hours wants to fire twenty-four times immediately. They land together on a provider still finding its feet, compete for the same recovering rate limit, and a good share fail again, which extends the very outage they were meant to recover from. This is a thundering herd, and it is self-inflicted.

Job schedulers named and solved this long ago, and the vocabulary is worth borrowing. Quartz calls the rule a misfire instruction, attached to every trigger, that selects among running the missed firing now, firing it once and discarding the rest, or ignoring the misfires and resuming at the next scheduled time. The important part is not the specific options. It is that the rule is explicit and chosen per job, rather than left to whatever the runtime does when nobody decided.

Decide the misfire policy before the outage

The policy is a choice between three behaviors for a slot that could not fire on time, and the right one depends entirely on what the job is about.

Skip means forget the missed slot and wait for the next one. Correct for anything that measures the present: health checks, status summaries, anything where a stale run is a lie. Run once means collapse all the missed slots into a single catch-up run covering the whole gap. Correct for anything that processes a backlog: reconciliation, evidence collection, a sweep over everything that changed since the last success. Run all means replay each missed slot, which is almost never what you want for an agent, because it is the storm, and because identical runs over overlapping windows mostly redo each other's work.

The decision needs two facts the bare cron does not keep: when the job last succeeded, and how stale a start is still useful. Encode both and the policy falls out.

from datetime import datetime, timedelta

def decide(policy, now, scheduled_for, last_success, max_lateness):
    # How late is this firing, versus how late is still acceptable?
    if now - scheduled_for > max_lateness and policy != "run_once":
        return "skip"                       # too stale to be meaningful now
    if policy == "skip":
        return "skip"
    if policy == "run_once":
        # Collapse the whole missed window into one catch-up run.
        if last_success is None or last_success < scheduled_for:
            return "run_once"               # gap exists, cover it once
        return "skip"                       # nothing missed since last success
    if policy == "run_all":
        return "run_all"                    # replay every slot (rarely wise)
    raise ValueError(policy)

# A 02:00 reconciliation that the provider outage pushed to 04:10:
decide("run_once", now=datetime(2026,11,13,4,10),
       scheduled_for=datetime(2026,11,13,2,0),
       last_success=datetime(2026,11,12,2,0),
       max_lateness=timedelta(hours=12))        # -> "run_once"

If you run on Kubernetes, the primitive is already there. A CronJob exposes startingDeadlineSeconds and concurrencyPolicy for exactly this: the deadline bounds how late a missed job may still start before it is counted as failed and skipped, and the concurrency policy decides whether a new run may overlap a slow previous one or must wait or replace it. The docs are blunt about the failure mode if you leave the deadline unset and the controller falls behind: it tries to make up every missed slot at once. The knob exists because someone got the storm in production.

apiVersion: batch/v1
kind: CronJob
metadata:
  name: nightly-reconciliation-agent
spec:
  schedule: "0 2 * * *"
  startingDeadlineSeconds: 3600   # if we cannot start within an hour, skip this slot
  concurrencyPolicy: Forbid       # never let two reconciliation runs overlap
  successfulJobsHistoryLimit: 7   # keep a week of run records to reconcile against
  jobTemplate:
    spec:
      backoffLimit: 2
      activeDeadlineSeconds: 1800 # a single run may take at most 30 minutes
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: agent
              image: registry.internal/recon-agent:pinned

The deadline and the concurrency policy together turn the vague hope of "it runs every night" into two explicit statements: a run more than an hour late is not worth starting, and two runs never touch the same ledger at once. Both are decisions you want to make at your desk, not discover from a scheduler that made them for you during the outage.

Bound the catch-up so recovery is not a second outage

Picking run-once over run-all removes most of the storm. But even the runs you keep need bounding, because the moment a provider recovers is the moment every system pointed at it tries at once, yours among them. The recovery window is the most contended minute of the whole incident.

Two bounds handle it. Cap how many catch-up runs may be in flight at once, so a fleet of jobs that all missed the same outage do not all wake together, and spread their starts with jitter so they arrive as a trickle rather than a spike. This is the same discipline as backpressure and concurrency control on agent calls, applied to recovery rather than steady state. And where the provider is what failed, the catch-up should sit behind the same circuit breaker you put around a failing provider: do not attempt a catch-up until the breaker has closed and a probe says the provider is actually answering, or you spend your retries confirming it is still down.

import asyncio, random

async def run_catch_up(missed_jobs, provider_healthy, run_one, max_concurrency=2):
    # Do nothing until the provider is genuinely back, not just less broken.
    while not await provider_healthy():
        await asyncio.sleep(30)

    sem = asyncio.Semaphore(max_concurrency)   # trickle, not flood

    async def guarded(job):
        async with sem:
            await asyncio.sleep(random.uniform(0, 20))  # jitter the starts
            return await run_one(job)

    # Catch up at most a bounded number at a time, newest window first
    # so the most useful reconciliation lands before the stale ones.
    ordered = sorted(missed_jobs, key=lambda j: j.scheduled_for, reverse=True)
    return await asyncio.gather(*(guarded(j) for j in ordered))

The health check in front matters more than the concurrency cap. A catch-up that fires the instant the status page goes green, while the provider is serving one request in three, just adds your load to a fragile system and collects a fresh batch of failures. Wait for a real probe, close the breaker deliberately, and let the catch-up follow a recovery that has actually happened.

Reconcile the gap, do not just resume

Here is the part the cron never does and the part that actually protects you. The runs you skipped did not stop being owed. A skipped reconciliation still has a day of transactions behind it; a skipped evidence collection still has a window of logs it was meant to capture. Resuming at the next slot quietly abandons that work, which is how the finance team ended up with a week-old hole nobody saw.

So the gate has to record the expectation, not just the runs. Keep a ledger of planned fire times and mark each one as it resolves: started, succeeded, skipped by policy, caught up. The ledger is what makes an absence visible. A runtime monitor that watches for silent failures can then alert on a slot past due with no matching record, which is the only signal you will ever get for a run that never emitted anything. And because a catch-up reprocesses a window a later normal run might also touch, every write it makes needs idempotency keys on the side-effecting tools, keyed by the window rather than the run, so covering the gap twice does not double-file a ticket.

def pending_reconciliation(ledger, now):
    # A slot is a gap if it is past due and has no terminal record.
    gaps = []
    for slot in ledger.slots_due_before(now):
        record = ledger.record_for(slot)
        if record is None or record.state not in ("succeeded", "skipped_by_policy"):
            gaps.append(slot)               # owed work, surface it
    return gaps

For jobs whose work must survive a crash midway and resume rather than restart, the ledger is the first checkpoint, and the rest of the run hangs off it exactly as in durable execution with checkpoint and replay. The distinction the CSA note draws is the one to hold onto: a missed run is not an availability footnote that clears when the service comes back. It is a reconciliation item that stays open until something explicitly closes it, by covering the window or by deciding on the record that it did not need covering.

The parts that bite

A few pitfalls, roughly in the order you will meet them.

The default misfire policy is whatever the runtime picked. Almost no scheduler makes you choose the behavior for a missed slot. If you never set the policy, you have one anyway, and it is as likely to be run-all as skip. Find out what yours does before an outage tells you, by stopping the scheduler for longer than one interval in staging and watching what fires when it comes back.

Skip and catch-up look identical until the one outage. A schedule with no misses runs the same whatever policy you set, so the wrong choice is invisible for months. The test that matters is the one you force: kill the provider past a fire time and confirm the job does what you decided, not what you assumed.

The ledger of planned slots is itself a scheduled thing. If the process that records expectations runs on the same host, in the same outage, it has the same gap, and now you cannot even tell what you missed. Keep the record of what should have run somewhere more durable than the thing that runs it.

Jitter and deadlines fight each other. A twenty-second jitter in front of a job with a thirty-second starting deadline will sometimes push the start past the deadline and skip a run you meant to keep. Size the jitter against the deadline, not in isolation, so the spreading you added for the provider's sake does not quietly cancel the runs you were protecting.

The takeaway

A cron is a clock, and a clock has no opinion about the firing that did not happen. For the cheap, idempotent jobs crons grew up on, that was fine. For an agent that calls a remote model, takes minutes, writes real records, and runs with nobody watching, the missed firing is the whole game, and leaving it to the runtime's default is a decision you did not know you made. Put a gate in front of the schedule and give it three things. A misfire policy chosen per job, skip for the jobs about now and run-once for the jobs about a backlog. A bounded catch-up, behind a real health probe, capped and jittered, so recovery is a trickle and not a second outage. And a ledger of planned slots that makes a skipped run a visible, open item rather than a silent hole.

If your agents run on a schedule and you have never tested what happens when the provider is down at the exact minute a job fires, that is the gap worth finding before a skipped run costs you something you cannot get back. Book a consultation call and we can walk through where your schedules can miss, what they do when they come back, and whether anyone would notice if one quietly went dark.

ShareXLinkedInviralruparel.com/blog/scheduled-agent-misfire-catch-up-storm

Questions this essay answers

01What is a misfire in a scheduled agent?

A misfire is a scheduled run that does not start at its planned time. The slot comes around while the scheduler is down, the worker is saturated, or the model provider is unreachable, and the fire time passes with no run. The term comes from job schedulers like Quartz, where every trigger has an explicit misfire instruction that says what to do once the scheduler is healthy again: run the missed one now, run all of them, or forget it and wait for the next slot. An agent on a cron has exactly the same event, and usually no policy for it, so the behavior is whatever the runtime happens to do by default.

02Why do all my scheduled agent runs fire at once after an outage?

Because the scheduler counted every slot it missed and now wants to make good on all of them. If your cron fires every five minutes and the provider was down for two hours, that is twenty-four missed slots, and a naive catch-up releases all twenty-four the instant the provider answers. They hit the recovering provider together, compete for the same rate limit, and often fail again, which turns a two-hour gap into a longer one. Cap the catch-up to one run, or to a small number, and spread whatever you do run with jitter so the recovery is gentle rather than a second spike.

03Should a missed scheduled run be skipped or caught up?

It depends on whether the run is about a moment or about a backlog. A health check or a status summary is about now, so a missed slot should be skipped: running the 02:00 check at 04:00 tells you nothing true. A reconciliation job or an evidence collector is about a window of work, so a missed slot must be caught up, but once, over the whole gap, not once per missed slot. Decide this per job and write it down, because the default in most runtimes is neither of these and will surprise you during the one outage where it matters.

04How do I know a scheduled agent run was skipped?

You will not, unless you record the expectation separately from the run. A run that never starts emits no logs, no error, and no trace, so it is invisible to anything that watches runs. Keep a ledger of planned fire times and mark each one started, succeeded, skipped, or caught up. A monitor then alerts on the absence, a slot that is past due with no matching record, rather than on a failure that was never emitted. Treating the missing run as a first-class event is the only way a skipped slot becomes visible before a downstream process trips over the gap it left.

Working on this in production?I help teams make agents like this reliable. Thirty minutes, no pitch.
Viral Ruparel

Generative AI consultant and full-stack architect. Ex-IBM, former Director of Engineering at a YC W20 startup. Writes about what breaks when agents meet reality.