Scheduled jobs
Run jobs on a schedule even while your app is asleep.
What it does
An app is paused when nobody is using it, and a paused app runs nothing, so a timer inside the app would be skipped. The platform keeps the clock instead and wakes your app when a job is due.
How you use it
- In code: platform.cron.schedule("every weekday at 9:00", handler, { name: "daily-report" }) from @cohostly/sdk.
- Turn it on in the manifest: "bindings": { "cron": { "code": true } }.
- A web app serves the platform's call at /__platform/jobs/<name>; the SDK provides the handler.
When it is worth it
When your app uses setInterval, node-cron, APScheduler or a similar timer inside itself.