Heroku logo

How to run periodic jobs on Heroku: Scheduler, cron add-ons, a clock dyno or an HTTPS call

Heroku has no crontab you can edit, so a periodic job needs something else to start it. Heroku's own answer is the free Heroku Scheduler add-on. The alternatives are a cron add-on from the Elements marketplace, a clock process you run yourself, or an outside service that calls a route in your web app. This guide sets up each one and shows where each one breaks.

Everything below was checked against the Heroku Dev Center, the add-on pages on Heroku Elements and Heroku's pricing in November 2026. Prices are as of November 2026.

Key takeaways

  • Heroku Scheduler is a free add-on with three frequencies: every 10 minutes, every hour, or every day at a time in UTC. Each run starts a one-off dyno, and you pay for the time that dyno runs.
  • Heroku says Scheduler runs are expected but not guaranteed. In rare cases a run is skipped or happens twice, so every job must be safe to repeat.
  • A dyno started by Scheduler doesn't outlive the job's interval. Long work belongs on a worker dyno, with the scheduled command only queuing it.
  • For cron expressions and per-job time zones, use a cron add-on. For jobs your app can't do without, Heroku recommends a clock process. A scheduled HTTPS call to a protected route also works, within the router's 30-second limit.

Four ways to run a periodic job on Heroku

Every option runs your app's code with its config vars. What differs is what starts the job, how precisely you can set the time, and what you pay for.

OptionWhat starts the jobShortest intervalTime zoneYou pay for
Heroku SchedulerA one-off dyno per run10 minutesUTCDyno time per run; the add-on is free
Cron add-onA one-off dyno per run1 minutePer jobThe add-on plan plus dyno time
Clock processYour code on one always-on dynoWhat your library allowsWhat your library allowsOne dyno running all month
HTTPS call (Cronit)A request to a route on your web dyno1 minutePer jobThe scheduler's plan; the web dyno you already run
Diagram: Heroku Scheduler and cron add-ons start a one-off dyno per run that runs your command and exits; a clock process runs on one always-on dyno; Cronit sends an HTTPS request through the Heroku router to a route on a web dyno. All of them can hand long work to a worker dyno through a queue.
Three triggers start something inside Heroku; the fourth comes in over HTTPS. Whatever starts the job, long work runs best on a worker.

Set up Heroku Scheduler

Heroku only lets verified accounts add add-ons, free ones included, and that means a credit or debit card on file. With that done, setup takes a few minutes.

1. Install the add-on

heroku addons:create scheduler:standard -a your-app

Or open the app's Resources tab in the dashboard, search the add-ons for Heroku Scheduler and add it. There is a single plan, Standard, which is free and has no limit on the number of jobs.

2. Write the task as code

A task is any command your app can run, exactly what you would type after heroku run. Keep the logic in your repository and the command short:

  • Rails: a rake task, by convention in lib/tasks/scheduler.rake, that depends on :environment so the app is loaded.
  • Any language: a script in bin/ (Heroku's example is bin/clean-sessions) or a command such as node scripts/sync.js that connects through DATABASE_URL, does the work and exits.
  • A process type: enter the name of a process type from your Procfile and Scheduler runs that type's command.
# lib/tasks/scheduler.rake
desc "Send the daily summary e-mail"
task send_daily_summary: :environment do
  DailySummary.deliver_all
end

Run it once by hand before you schedule it. Scheduler uses the same one-off dynos as heroku run, so a command that works here works from Scheduler:

heroku run -a your-app rake send_daily_summary

3. Add the job

  1. Open the Scheduler dashboard with heroku addons:open scheduler -a your-app, or click the add-on in your app's dashboard.
  2. Click Add Job and enter the command, for example rake send_daily_summary.
  3. Choose the dyno size. The choice depends on your app's dyno tier (see the next section).
  4. Choose the frequency: every 10 minutes, every hour, or every day. An hourly job also takes the minute past the hour; a daily job takes a time, in UTC.
  5. Save, and check that the job is listed with the next run time you expect.

Keep secrets out of the command

On the Common Runtime, Heroku expands config var values into the command it writes to your logs. A command like curl -H "Authorization: $API_TOKEN" … puts the token in your logs. Read the secret from the environment inside your code instead.

What Scheduler runs cost

The add-on costs nothing; the dynos it starts are billed like any other. Heroku counts wall-clock time, prorates to the second, and lists the time under a "scheduler" dyno type on your invoice.

Which sizes you can choose depends on the app's dyno tier. On an app that uses Eco or Basic dynos, one-off dynos are Eco or Basic too, and no other type is available. Apps on Standard or Performance dynos get Standard-1X by default and can pick larger sizes for heavy jobs.

Dyno typePer hour (approx.)Maximum per month
Eco$0.005$5 flat for a 1,000-hour pool shared by all Eco dynos on the account
Basic$0.01$7
Standard-1X$0.03$25
Standard-2X$0.06$50
Performance-M$0.34$250

Common Runtime prices from Heroku's usage and billing documentation, as of November 2026. A worked example: a job that runs for 3 minutes every 10 minutes uses 7.2 dyno hours a day, or 216 hours in a 30-day month. That is 30% of a month of dyno time, so about $2 on Basic, about $7.50 on Standard-1X, or more than a fifth of the Eco pool.

On Eco, that last point matters most. Scheduler runs draw from the same pool as your Eco web dynos, and when the pool runs out, every Eco dyno on the account sleeps until the next month.

The limits to plan around

Most problems with Scheduler come from one of these four limits.

Three frequencies, no cron expressions

Every 10 minutes, every hour and every day are the only choices. "Every 5 minutes", "weekdays at 07:00" and "the 1st of the month" can't be expressed. For weekly or monthly work, schedule the job daily and have the task exit early unless today is the right day. For anything finer, use one of the other three options.

Daily times are UTC, and daylight saving moves them

The time you enter for a daily job is UTC, with no time zone setting. 2:00 a.m. in New York is 07:00 UTC in winter but 06:00 UTC in summer, so a job fixed at 07:00 UTC runs at 3:00 a.m. New York time from March to November. If the local hour matters, as it does for reports and billing runs, you have to change the job twice a year. The cron time zone converter gives you the UTC value, and cron, time zones and daylight saving time explains the jumps.

Runs are expected, not guaranteed, and the interval is a time limit

Timeline of an every-10-minutes Scheduler job: the :00 run takes 3 minutes; the :10 run is stopped after about 10 minutes and briefly overlaps the :20 run; the :30 run is skipped, which is rare; the :40 run completes normally.
One job over 50 minutes. Skips and overlaps are rare, but a job that runs every 10 minutes runs more than 50,000 times a year.

Heroku's documentation is explicit that Scheduler job execution is expected but not guaranteed. A dyno started by Scheduler also does not run longer than the job's interval: a 10-minute job's dyno is stopped after about 10 minutes, an hourly job's after about an hour. So keep the scheduled command short, and have it put longer work on a queue for a worker dyno.

Container Registry apps run tasks from the web image

If you deploy with Container Registry, the task has to be runnable from your web image. Scheduler has no option to use another image.

Make every job safe to run twice

Because a run can be skipped, duplicated or cut off, the durable fix is code that gives the same result whether it runs once or three times.

  • Write idempotently. Use upserts (INSERT … ON CONFLICT in Postgres) against a unique key, so re-running yesterday's import updates rows instead of duplicating them.
  • Record what is done. Store a last-run timestamp or a "sent" flag per record, and skip work that is already finished.
  • Lock jobs that must not overlap. A Postgres advisory lock (pg_try_advisory_lock) lets a second copy exit cleanly instead of racing the first.
  • Derive the window from the data, not the clock. A daily job that covers "yesterday" should work out which day that is when it runs, so a late or repeated run still processes the right day.

Then ask one more question: if this job didn't run today, who would notice? If the answer is nobody, monitoring matters more than the schedule (see below).

Cron add-ons: Cron To Go and Advanced Scheduler

Cron add-ons also run your command on a one-off dyno, so the code and the dyno billing work as with Scheduler. What you gain is a real schedule: cron expressions down to one minute and a time zone per job. Both add-ons below were listed and installable on Heroku Elements in November 2026.

heroku addons:create crontogo -a your-app
heroku addons:create advanced-scheduler -a your-app
Cron To GoAdvanced Scheduler
SchedulesCron or rate expressions such as Every 7 minutes; at most once a minute5-field cron, at most once a minute; also one-off triggers at a set date and time
Time zonePer job, UTC by defaultPer trigger, as an IANA name such as America/New_York
Failure noticesE-mail, webhooks, Slack and Microsoft TeamsE-mail on a trigger's first failed run each day
Run history1 to 30 days, by plan3 to 30 days, by plan
PlansBronze $9/month (5 jobs) up to Iridium $1,099/month (1,350 jobs)Standard 0 $15/month (12 triggers) up to Standard 4 $240/month (240 triggers)
Trying it7-day trial with the Gold plan's features; jobs are disabled when it ends unless you upgradeFree trial plan: 3 triggers, up to 100 executions

Dyno time for each run comes on top of the plan price. Two details are worth knowing before you choose:

  • To keep a Cron To Go job to one running copy, set its timeout below its interval. The dyno is killed when the timeout expires.
  • Cron To Go's own documentation notes that it starts runs through Heroku's APIs, so a run can be skipped if those APIs are down, and it points to a clock process for critical jobs. An add-on gives you a better schedule and alerts, not a guarantee.

For services that call a URL instead of starting a dyno, see the online cron job services compared.

A custom clock process

A clock process is a long-running process of your own that decides when work is due. Heroku recommends it over Scheduler when scheduled jobs are a critical part of your app, because you get more reliability, control and visibility. Heroku's Python guide uses APScheduler, and the example below follows it, with a time zone added.

  1. Declare the process type in your Procfile, next to your web line:
clock: python clock.py
  1. Add APScheduler>=3.10,<4.0 to requirements.txt (the version range Heroku's guide pins) and write clock.py:
from apscheduler.schedulers.blocking import BlockingScheduler

sched = BlockingScheduler(timezone='Europe/Berlin')

@sched.scheduled_job('cron', day_of_week='mon-fri', hour=7)
def morning_report():
    print('Queue the morning report here.')

sched.start()
  1. Deploy, then start exactly one clock dyno:
heroku ps:scale clock=1 -a your-app

Without the timezone argument, cron times follow the scheduler's default zone. Setting it makes the 07:00 mean 07:00 in Berlin, summer and winter. Four rules keep a clock dependable:

  • Run one copy only. Heroku's guide calls the clock a singleton: two clock dynos schedule every job twice.
  • Queue work, don't do it. Heroku's advice is to use the scheduler only to queue background jobs and let a worker dyno execute them.
  • Plan for restarts. Dynos restart at least once a day (every 24 hours plus up to 216 random minutes) and on every deploy, config var change and add-on change. A job due during a restart is missed unless the clock checks on startup what should have run.
  • Avoid Eco for the clock. When an app's Eco web dyno sleeps after 30 minutes without web traffic, its Eco worker dynos sleep too, clock included. Basic dynos never sleep and cost at most $7 a month.

The same idea in other stacks

  • Node.js: node-cron (version 4) runs cron expressions inside a long-running process, with options such as timezone and noOverlap, which skips a run while the previous one is still going.
  • Ruby: sidekiq-cron runs a scheduling thread inside your Sidekiq processes and uses Redis so that only one of them enqueues each job. Your Sidekiq worker dyno doubles as the clock, so no extra dyno is needed. Jobs live in config/schedule.yml, and a cron string can end with a time zone, such as 0 22 * * 1-5 America/Chicago.
  • Laravel: schedule:run runs the tasks that are due at the moment it is called and expects to be called every minute, so a 10-minute Scheduler job runs only what is due in those minutes. Use a clock dyno running php artisan schedule:work, which calls the scheduler every minute in the foreground (Laravel's docs present it for local development), or run the scheduler over HTTP.

Call a protected route with Cronit

When you need a time Heroku Scheduler can't express, such as 02:00 New York time all year round, and you already run a web dyno, an external scheduler can call a protected route instead. Cronit works this way: it sends an HTTP request on a standard 5-field cron schedule, in the time zone you set for the job, and handles daylight saving time.

  1. Store a long random secret as a config var. Setting a config var restarts the app.
heroku config:set CRON_SECRET=$(openssl rand -hex 32) -a your-app
  1. Add a route that checks the secret, queues the work and answers at once. In Express:
app.post('/tasks/nightly-report', (req, res) => {
  const expected = `Bearer ${process.env.CRON_SECRET}`;
  if (req.get('authorization') !== expected) {
    return res.sendStatus(401);
  }
  queueNightlyReport(); // your code: hand the work to the worker dyno
  res.sendStatus(202);
});
  1. In Cronit, create a job with method POST, your app's URL (for example https://example-app-1234567890ab.herokuapp.com/tasks/nightly-report, or your custom domain), a header Authorization: Bearer … with the secret, the schedule 0 2 * * * and the time zone America/New_York. Send the test request before saving; you should get 202.

Every call then appears in the job's execution log with its status, and a job that fails again and again switches itself off. Two Heroku rules decide whether this works:

  • The router gives the route 30 seconds. If no response byte comes back in that time, the router ends the request and logs an H12 error, while the dyno keeps working. That is why the route answers 202 and leaves the work to a worker.
  • The web dyno has to be awake. An Eco web dyno sleeps after 30 minutes without traffic and wakes after a short delay when a request arrives, if the pool has hours left. A schedule that calls it more often than every 30 minutes keeps it awake around the clock and burns pool hours. Basic and larger dynos never sleep.

The job editor estimates runs per month while you type the schedule. Compare that with the plans on the pricing section.

Watch, stop and debug scheduled runs

Scheduler's output goes to your app's logs, and its documentation describes no alerts or run history beyond them. These commands cover day-to-day work:

heroku ps -a your-app
heroku logs --tail -a your-app
heroku logs --dyno-name scheduler.1234 -a your-app
heroku ps:stop scheduler.1234 -a your-app
  • heroku ps lists a running Scheduler job as scheduler. plus a number, with its state. Use that name in the other commands.
  • heroku logs --dyno-name shows the output of that one run; --tail streams everything as it happens.
  • heroku ps:stop (alias heroku ps:kill) stops a runaway run. The job itself stays scheduled. A stopped Cron To Go run is marked failed, with process status 143 (SIGTERM).

None of this catches a run that never started. For that, have the job ping a heartbeat URL when it finishes and get alerted when the ping doesn't arrive in time. The guide to monitoring cron jobs and getting failure alerts covers how to set that up.

FAQ

Can Heroku Scheduler run a job every 30 minutes?
Not with a single job, because the only frequencies are every 10 minutes, hourly and daily. Add two hourly jobs with the same command, one at :00 and one at :30, or run it every 10 minutes and let the task skip the runs it doesn't need.
How do I run a one-time job at a set time on Heroku?
Heroku Scheduler only repeats. To start a command right now in the background, use heroku run:detached, which sends its output to your logs. For a single run at a set date and time, Advanced Scheduler has one-off triggers that take a date, a time and a time zone.
Can I keep my Heroku schedules in code?
Not with Heroku Scheduler: you create its jobs in its dashboard, and its documentation describes no API or config file for them. A clock process or sidekiq-cron keeps the schedule in your repository, and Cron To Go has a Heroku CLI plugin (heroku plugins:install heroku-cron) that a deploy script can call.
Can I use the whenever gem or a crontab on Heroku?
No. whenever turns your schedule into entries in the system crontab, and its own README says that Heroku does not support cron. Move those jobs to Heroku Scheduler, a clock process or sidekiq-cron.

Run online cronjobs without server setup

Plan, schedule and run periodic tasks and scripts, from your browser with the first online cronjob platform.

Try for free