How to run scheduled cron jobs on Vercel, Cloudflare Workers and Netlify
Serverless apps lack a persistent machine with a crontab, so each major platform offers its own way to trigger functions on a schedule. Vercel calls a route you declare in vercel.json, and you should protect it with a CRON_SECRET bearer token, since cron times are in UTC and runs target only production deployments. Cloudflare Workers instead invoke a scheduled handler configured in wrangler.toml, which is not exposed over HTTP and can serve multiple schedules via controller.cron, with ctx.waitUntil() keeping async work alive. Netlify attaches a schedule directly in function config, also using UTC and running only on published deploys, with a shorter execution limit that may require handing longer work to a background function or queue. The platforms differ in configuration, security, and failure handling, and failed runs are not automatically retried on Vercel.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in