Resources / Serverless

Scheduled jobs and cron without a server

Run reports, syncs and cleanups on a schedule without keeping a server up. Cron syntax, time zones and failure handling explained.

Plenty of backend work isn't triggered by a user: a Monday report to Slack, a nightly price check, a cleanup of expired records. The classic answer was a cron job on a server that also needed patching, monitoring and backups. Serverless schedules remove the server.

Cron in one minute

A cron expression has five fields: minute, hour, day of month, month, day of week. 0 9 * * 1-5 means "09:00 on weekdays". Always pin the time zone — "9am" in UTC is the middle of the night somewhere.

Make jobs safe to run twice

Schedulers occasionally fire twice or retry after a failure. Write jobs to be idempotent: process "everything since the last successful run" and record progress.

Watch for silent failures

A job that fails at 3am fails silently unless something tells you. Log every run and alert on errors.

Tasks in Wisp

In Wisp, background work is a task: code that isn't exposed over HTTP and runs on a schedule or when you press Run. Describe the schedule in plain words — "every weekday at 9am Europe/London" — and Wisp turns it into cron. Every run is logged, and error alerts can email you or post to Slack.

Try it: Template: uptime monitor with Slack alerts · Template: nightly cleanup job · Cron every 5 minutes

Build it with Wisp — describe an API, get it live.

Related