Navigation
Scheduled Jobs
A scheduled job runs your code on a recurring schedule. Think data syncs, report generation, cleanup scripts — anything that runs periodically and exits.
Deploy a scheduled job
The deploy flow is the same as a web service, with two differences:
- Choose Scheduled Job as the app type
- Set a cron schedule (e.g.,
0 */6 * * *for every 6 hours)
Your code is built the same way, but instead of running continuously, it runs on your schedule and exits when done.
Cron schedule format
Standard cron syntax with five fields:
┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-6, Sun=0)
│ │ │ │ │
* * * * *
Common examples:
| Schedule | Cron expression |
|---|---|
| Every hour | 0 * * * * |
| Every 6 hours | 0 */6 * * * |
| Daily at midnight | 0 0 * * * |
| Weekdays at 9am | 0 9 * * 1-5 |
Differences from web services
| Web Service | Scheduled Job | |
|---|---|---|
| Runs | Continuously | On schedule |
| Gets a URL | Yes | No |
| Auto-scaling | Yes | No |
| Build process | Same | Same |
| Environment variables | Yes | Yes |
Configuration
Same as web services — environment variables, Procfile, and build settings all work the same way. The only addition is the cron schedule.