CronNudge

Published October 21, 2026

How to Monitor Vercel Cron Jobs (and Know When One Doesn't Run)

Vercel Cron Jobs are the easiest way to run scheduled work in a Next.js app: add a path and a schedule to vercel.json, deploy, and Vercel calls your route on time. What they don't do is tell you when a run fails or never happens. This guide covers how Vercel cron behaves, where it fails quietly, and how to add a heartbeat so you get an alert.

Details below are from Vercel's cron documentation as of October 2026. Check the official docs for changes.

How Vercel Cron Jobs work

You declare crons in vercel.json:

{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "crons": [
    { "path": "/api/cron/daily-digest", "schedule": "0 13 * * *" },
    { "path": "/api/cron/sync-stripe", "schedule": "*/15 * * * *" }
  ]
}

On schedule, Vercel sends an HTTP GET to that path on your production deployment. The route is just a normal function, so it gets the same duration and pricing limits as any other Vercel Function.

A few behaviors worth knowing:

  • Schedules are in UTC. 0 13 * * * is 13:00 UTC, not your local time.
  • Plan limits. On Hobby, crons can only run once per day, and Vercel may invoke them anytime within the scheduled hour. An expression like */15 * * * * fails deployment on Hobby. Pro and Enterprise support per-minute schedules and per-minute precision.
  • No retries. Vercel's docs say it will not retry an invocation if a cron job fails.
  • Best-effort delivery. The docs also note that a transient network error can occasionally prevent a scheduled request from reaching your function. When that happens, the function doesn't run and no runtime log is created for that run. The same run can also occasionally be delivered more than once.
  • No redirect following. If the route returns a 3xx, the invocation ends there. A trailing-slash or auth redirect can turn your cron into a no-op.
  • A missing path still "runs." If the path doesn't exist, the invocation just gets a 404.

Put together: a Vercel cron can fail, return a redirect, hit a 404, or never be delivered at all, and none of these send you a notification by default. You'd only notice by opening the cron logs.

Secure the route first

Anyone who knows the URL can call a cron route. Vercel supports a CRON_SECRET environment variable. When it's set, Vercel sends it as Authorization: Bearer <CRON_SECRET> on each cron invocation, and your route should reject anything else.

// app/api/cron/daily-digest/route.ts
import type { NextRequest } from "next/server";

export async function GET(request: NextRequest) {
  const secret = process.env.CRON_SECRET;
  if (!secret || request.headers.get("authorization") !== `Bearer ${secret}`) {
    return new Response("Unauthorized", { status: 401 });
  }

  // ...do the work
  return Response.json({ ok: true });
}

Use a random string of at least 16 characters, as Vercel recommends.

Add a heartbeat

The fix for silent failures is a heartbeat: at the end of a successful run, your route pings a monitoring URL. The monitor knows the schedule and alerts you when a ping doesn't arrive. It catches failed runs, undelivered runs, redirects, 404s, and timeouts, because none of them reach the ping.

A reusable helper

// lib/heartbeat.ts
export async function heartbeat(url: string | undefined) {
  if (!url) return;
  try {
    await fetch(url, { method: "GET", signal: AbortSignal.timeout(5_000), cache: "no-store" });
  } catch (err) {
    // Never fail the job because the ping failed. A missing ping alerts you anyway.
    console.error("heartbeat failed", err);
  }
}

The cron route with a heartbeat

// app/api/cron/daily-digest/route.ts
import type { NextRequest } from "next/server";
import { heartbeat } from "@/lib/heartbeat";

export const maxDuration = 60; // seconds; keep within your plan's limit

export async function GET(request: NextRequest) {
  const secret = process.env.CRON_SECRET;
  if (!secret || request.headers.get("authorization") !== `Bearer ${secret}`) {
    return new Response("Unauthorized", { status: 401 });
  }

  try {
    const sent = await sendDailyDigests();
    if (sent === 0) {
      // Treat "did nothing" as a failure if that's abnormal for this job
      return Response.json({ ok: false, reason: "no digests sent" }, { status: 500 });
    }

    await heartbeat(process.env.HEARTBEAT_DAILY_DIGEST);
    return Response.json({ ok: true, sent });
  } catch (err) {
    console.error(err);
    return Response.json({ ok: false }, { status: 500 });
  }
}

Store each check's ping URL in an environment variable (HEARTBEAT_DAILY_DIGEST, HEARTBEAT_SYNC_STRIPE) so each cron has its own check. Keeping it out of the code also means preview deployments don't ping your production monitors.

Set the monitor's schedule and grace period

Configure each check with the same cron expression as vercel.json, in UTC.

CronNudge's default grace is 5 minutes. The form offers none, 1 minute, 5 minutes, 15 minutes, and 1 hour. The API accepts any whole number of seconds from 0 through 7 days (graceSeconds). For a */15 cron, 15 minutes of grace is the matching form option. For a daily cron, 1 hour covers a slow function. On Hobby, an hourly cron can run any time during that hour, so 1 hour may be tight. Set a longer grace through the API if you need it. Grace cannot exceed 7 days.

Free rejects schedules more often than every 5 minutes, so */15 fits Free. An every-minute cron needs Pro, whose minimum is 1 minute.

Make the job safe to miss and safe to repeat

Vercel's own guidance is to design crons that tolerate both missed and duplicate runs. In practice:

  • Reconcile, don't increment. "Process everything since the last successful run" survives a missed run. "Add 10 credits" double-counts on a duplicate.
  • Record the last successful run in your database, and have each run pick up from there.
  • Use a lock for long jobs so two invocations don't overlap, for example a row-level lock or an advisory lock in Postgres.
  • Use idempotency keys for anything external, like emails or Stripe calls, so a duplicate invocation doesn't send twice.

A heartbeat and idempotent jobs work well together: idempotency makes a missed run cheap to recover from, and the heartbeat makes sure you know it happened.

Common reasons a Vercel cron "doesn't run"

  1. You're on Hobby with a sub-daily schedule. The deploy fails, or you assumed it ran hourly.
  2. The time is UTC. It ran, just not when you expected.
  3. Middleware redirected the request. Auth middleware that redirects unauthenticated requests to /login turns the cron into a 3xx and nothing runs. Exclude your cron paths from that middleware.
  4. Trailing slash mismatch. If trailingSlash is enabled, /api/cron/job may redirect to /api/cron/job/. Use the exact final path.
  5. The function timed out. Long jobs hit maxDuration. Split the work or process in batches.
  6. The cron isn't on production. Crons are invoked against production deployments, not previews.
  7. The cron was disabled in the project's Cron Jobs settings.
  8. The request never arrived. Rare, but documented. Without a heartbeat, this one is invisible.

Test it locally

Cron jobs are API routes, so you can trigger one yourself:

curl -H "Authorization: Bearer $CRON_SECRET" http://localhost:3000/api/cron/daily-digest

You can also run a cron from the Vercel dashboard's Cron Jobs page, or with the Vercel CLI, to confirm the heartbeat shows up in your monitor before you rely on it.

What CronNudge does with that ping

The URL in HEARTBEAT_DAILY_DIGEST is https://cronnudge.com/ping/<check-id>. GET, POST, and HEAD all count. The response is text/plain ok, with Cache-Control: no-store. Keep CRON_SECRET and the ping URL as separate secrets. The ping id is not the badge id. The badge stays off until you opt in.

You can call /start before the work and /fail in the catch if you want a failure to alert immediately instead of waiting out the grace period. A function that times out may never reach /fail. The late alert is the backstop. CronNudge sends one alert when the check is down and one when it recovers.

Free includes email and one Slack or Discord channel, up to 10 checks. Signed webhooks and the API are on Pro, which is $12 a month for 100 checks.

FAQ

Does Vercel alert me when a cron job fails? Not by default. You can see invocations and errors in the cron logs. For an alert, add a heartbeat ping at the end of the route or wire up log-based alerting.

Does Vercel retry failed cron jobs? No. According to Vercel's docs, failed invocations are not retried.

What time zone do Vercel crons use? UTC.

Can I run a Vercel cron every minute? On Pro and Enterprise, yes. Hobby is limited to once per day.

Can a Vercel cron run twice? Occasionally, yes. Vercel documents that the same scheduled run can be delivered more than once, so make jobs idempotent.

Why does my cron work when I curl it but not on schedule? Usually middleware, redirects, or the CRON_SECRET check. Your manual request may carry a cookie or header the scheduled one doesn't.


CronNudge gives each Vercel cron its own ping URL and alerts you when a run is late or missing. Free is 10 checks, with email and one Slack or Discord channel. Pro is $12 a month for 100 checks, and adds signed webhooks and the API. Add a check for your first cron.