A scheduled AI agent that never fires looks, from the outside, exactly like one that ran and did nothing wrong. Nobody gets an error email. Nothing shows up in your exception tracker. The only signal is an absence, and absences are easy to miss until a customer, an auditor, or a lost week of leads points it out first. The fix is not better error handling inside the agent; it's a monitor that lives outside the agent and expects to hear from it.
Why silent failure is the default failure mode for scheduled agents
Most engineering effort goes into making an agent handle bad input gracefully: retries, fallbacks, structured error logs. That's useful, but it assumes the agent's process actually started. In practice, the runs that never happen usually fail for reasons that never touch your application code at all:
- A cron entry or scheduler config gets edited (or removed) during a deploy and nobody notices.
- The host, container, or serverless function it runs on is down, throttled, or out of quota.
- An API key or OAuth token expires and the process exits before your own logging even initializes.
- A queue or orchestrator (Airflow, Temporal, a cron-triggered Lambda) silently drops the trigger during a restart.
None of these produce an exception inside your agent's code, because your agent's code never runs. Any alerting you've wired up inside the agent is blind to exactly the failure mode that matters most here. This is the same class of problem covered in our AI agent security checklist: the risk isn't in the logic you tested, it's in the boundary conditions nobody wrote a test for.
The pattern: a dead man's switch, not an error alert
The standard fix is a heartbeat monitor, sometimes called a dead man's switch: a separate, dumb, extremely reliable service that expects to receive a signal ("I ran, I'm alive") on a schedule, and pages you when that signal doesn't show up within a grace window. The agent doesn't need to report success or failure in detail; it just needs to check in.
A minimal implementation looks like this:
# at the start of the scheduled job
curl -fsS https://your-monitor.example/ping/start-token
# ... agent does its work ...
# after the job completes (success or handled failure)
curl -fsS https://your-monitor.example/ping/finish-token
If finish-token doesn't arrive within, say, 15 minutes of the expected schedule, the monitor pages someone. It doesn't matter whether the job crashed, the container never started, or the whole account got suspended: the absence of the ping is the signal. This is the same principle behind Healthchecks.io's cron monitoring docs, one of the more widely used implementations of the pattern, and it works whether your "agent" is a single cron job or a fleet of LLM-driven workers.
What to actually monitor
Don't just monitor "did the process exit 0." For an AI agent specifically, check-in on the steps that matter to the business outcome, not just the runtime:
- Did it start on schedule (catches scheduler and infra failures)
- Did it produce output of the expected shape (catches a model silently returning empty or malformed responses)
- Did the downstream action actually happen (email sent, record written, ticket created), not just "the LLM call returned"
That third one matters more than it sounds. An agent can complete its loop, log success, and still have failed the person waiting on it, if the final write to your CRM or database silently no-ops. Heartbeat on the outcome, not the process.
A real example: monitoring a nightly outreach agent
We run a self-hosted outreach agent that scrapes each prospect's site and drafts one tailored email per company, on a nightly schedule. Early on, we only had application-level logging: if the scraper or the LLM call threw an error, we'd see it. What we didn't catch, for one uncomfortable week, was a scheduler misconfiguration after a server migration that meant the job simply never started at all. No errors, no alerts, just a week of leads that quietly never got emails. Adding a heartbeat check that expected a daily ping, and paged us when one didn't arrive, would have caught that in a day instead of a week. It's a small addition on top of the agent itself, but it's the difference between "the system is degraded" and "the system stopped existing and nobody noticed."
What this means for buy vs. build decisions
If you're evaluating an agency or vendor to build or operate a scheduled AI agent for you, ask directly: how do you detect a run that never happened? A vendor who can answer with a specific monitor, grace period, and escalation path has actually thought about operational reliability. A vendor who says "we'd see it in the logs" is describing a system that requires a human to go looking, which is precisely the failure mode a dead man's switch exists to remove. This ties directly into ongoing AI agent maintenance costs: monitoring infrastructure is cheap to add up front and expensive to retrofit after the first missed run costs you something real. It's also worth clarifying who gets paged and when, which overlaps with how you've defined escalation paths for the agent more broadly.
Practical checklist
- Add a start and finish ping to every business-critical scheduled agent, not just error alerting
- Set the grace period based on how bad a missed run actually is: minutes for revenue-critical agents, hours for reporting jobs
- Monitor the downstream outcome (record written, email sent), not just the process exit code
- Make sure the alert reaches a person, not just a dashboard nobody checks
- Test the alert path itself occasionally: an alert that nobody notices is the same as no alert
Scheduled agents fail quietly far more often than they fail loudly. The fix isn't more error handling inside the code, it's a separate, boring, reliable check that something outside the agent is watching for its absence.
If you're building or operating agentic systems and want a second set of eyes on how they're monitored, let's talk.
Originally published on the Pykero blog.
Top comments (0)