DEV Community

Mike Tickstem
Mike Tickstem

Posted on • Originally published at tickstem.dev

Your Python cron jobs are failing silently. Here's how to fix it.

If you're running a Python app on Vercel, Railway, Render, or Fly.io, you've run into this - there's no persistent process, so you can't use cron, APScheduler, or Celery workers the traditional way.
Most developers end up using the platform's built-in scheduled tasks — which work fine until they silently stop running and nobody notices for three days.

I built Tickstem to solve this, and just shipped a Python SDK.

The silent failure problem

Here's the thing about cron jobs: they fail in two ways.

Loud failures — the job runs, your endpoint returns 500, you get an alert. Fine.

Silent failures — the job never runs at all. Maybe a deployment broke something, maybe a config changed. The endpoint is healthy, no errors anywhere, but the job just... stopped. You find out when a user asks why their weekly report didn't arrive.

The second type is what kills you. Uptime monitoring doesn't catch it because your server is up. Error tracking doesn't catch it because there's no error. You need a dead man's switch.

Install

pip install tickstem

Requires Python 3.11+. One package, one API key, four tools.

Scheduling cron jobs

Instead of running a scheduler inside your app, Tickstem calls your HTTP endpoint on a schedule from outside:

from tickstem import CronClient, CronRegisterParams                                                                                                                                                                                                         

client = CronClient(os.environ["TICKSTEM_API_KEY"])

job = client.register(CronRegisterParams(
      name="send-weekly-report",
      schedule="0 9 * * 1",  # every Monday at 9am UTC
      endpoint="https://yourapp.com/jobs/weekly-report",
))  
Enter fullscreen mode Exit fullscreen mode

Your endpoint just needs to return 2xx. No SDK needed on the receiving side — it's just an HTTP call. This means it works on any serverless platform without touching your app's runtime.

The dead man's switch (heartbeat monitoring)

This is the part that actually solves the silent failure problem. Your job sends a ping after every successful run:

from tickstem import HeartbeatClient, HeartbeatCreateParams                                                                                                                                                                                                 

client = HeartbeatClient(os.environ["TICKSTEM_API_KEY"])

# Create once, save the token                                                                                                                                                                                                                               
hb = client.create(HeartbeatCreateParams(
      name="weekly-report",
      interval_secs=604800,  # expect a ping every 7 days
      grace_secs=3600,       # 1 hour buffer before alerting
))

# At the end of your job handler:                                                                                                                                                                                                                           
try:                                                      
      client.ping(hb.token)  # no API key needed — token is the credential
except Exception as e:
      logging.warning(f"heartbeat ping failed: {e}")  # non-fatal
Enter fullscreen mode Exit fullscreen mode

If pings stop arriving within the window, you get an email. That's it. The ping endpoint doesn't require your API key — just the token — so you can call it safely from any context.

Uptime monitoring

While you're at it, monitor your actual endpoints too:

from tickstem import UptimeClient, UptimeCreateParams, Assertion

client = UptimeClient(os.environ["TICKSTEM_API_KEY"])

monitor = client.create(UptimeCreateParams(
      name="Production API",
      url="https://api.yourapp.com/health",
      interval_secs=60,
      assertions=[
          Assertion(source="status_code", comparison="eq", target="200"),                                                                                                                                                                                     
          Assertion(source="response_time", comparison="lt", target="2000"),
      ],
))
Enter fullscreen mode Exit fullscreen mode

Assertions let you define what "healthy" actually means — not just that the server responded, but that it responded correctly and fast enough.

Email verification

One more thing in the bundle — validate email addresses before storing them:

from tickstem import VerifyClient                                                                                                                                                                                                                           

client = VerifyClient(os.environ["TICKSTEM_API_KEY"])

result = client.verify("user@example.com")
if not result.valid:
    raise ValueError(f"Email rejected: {result.reason}")
if result.disposable:
    raise ValueError("Disposable email addresses are not allowed.")
Enter fullscreen mode Exit fullscreen mode

Checks syntax, MX records, 200+ disposable domains, and role-based prefixes (admin@, noreply@, etc). No SMTP probing.

One API key for everything

All four tools share one API key and one plan. Free tier includes 1,000 cron executions, 5 uptime monitors, 5 heartbeats, and 500 email verifications per month.

pip install tickstem

GitHub: https://github.com/tickstem/python
Docs: https://tickstem.dev/docs

Top comments (0)