Skip to content
GitHub Discord

Cloudflare Cron

This example creates a Cloudflare Worker that runs on a schedule.

sst.config.ts
const cron = new sst.cloudflare.Cron("Cron", {
job: "index.ts",
schedules: ["* * * * *"]
});
index.ts
export default {
async scheduled(event, env, ctx) {
console.log(`Running every ${event.cron}`);
},
};

View the full example.