/replit-tutorials

How to run scheduled jobs in Replit

Learn how to run scheduled jobs in Replit with simple steps and tools to automate tasks, boost workflow efficiency, and keep projects running smoothly.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to run scheduled jobs in Replit

You can’t run true server‑side scheduled jobs inside Replit the way you would with a VPS or cron, because Replit projects don’t stay awake on their own. To run scheduled tasks reliably, you either need to:
use Replit Deployments (Reserved VM) which stay always-on and allow real cron-like scheduling, or
use an external scheduler (like cron on another server, or a free uptime monitor) to periodically hit an endpoint in your Repl.
Those are the only stable, real options.

 

What Actually Works in Replit for Scheduling

 

Replit itself doesn’t provide a built-in “cron” button for regular Repls. Normal Repls sleep when there’s no traffic, so any internal timer code will stop running. Because of that, your choices are limited to the approaches below, which are real and proven ways Replit developers run scheduled tasks.

  • Reserved VM Deployments — Your code runs on its own always-on machine, so timers and cron-like packages work exactly like they do on a normal server.
  • External schedulers hitting a webhook — A simple HTTP endpoint in your Repl that you trigger using tools like cron, GitHub Actions, or an uptime monitor.
  • Manual triggering — For small tasks, you can run scripts manually in the Shell, but that’s obviously not automated.

 

Option A: Scheduled Jobs with Replit Reserved VM (Best, Most Reliable)

 

A Reserved VM is Replit’s always-on server. When you deploy a project as a Reserved VM, the code stays running 24/7, which means you can use normal timing libraries such as node-cron in Node.js or schedule/APScheduler in Python.

Here’s a real example using Node.js with node-cron:

// install first:
// npm install node-cron

const cron = require("node-cron");

// Every minute
cron.schedule("* * * * *", () => {
  console.log("Running scheduled task at", new Date());
});

// keep your server running if you also expose routes
const express = require("express");
const app = express();
app.get("/", (req, res) => res.send("Hello from Replit!"));
app.listen(3000);

Once this is deployed as a Reserved VM, it will run exactly like a real server and the cron job will never pause.

  • Pros: Most reliable, works like real production hosting, no external service needed.
  • Cons: Requires a paid Replit plan for Reserved VM.

 

Option B: External Scheduler + Webhook Endpoint (Works Even for Free Repls)

 

If you can’t use a Reserved VM, the reliable workaround is to expose an HTTP endpoint (a URL your code listens to) and use an outside service to call it at scheduled times. This wakes your Repl and triggers your job.

Here’s a simple Node.js Express handler:

// index.js

const express = require("express");
const app = express();

app.get("/run-job", (req, res) => {
  console.log("Job triggered by external scheduler");
  // run your task here
  res.send("Job executed");
});

app.listen(3000, () => console.log("Server running"));

You then use one of these external options:

  • Cron on another machine: curl https://your-repl-url/run-job
  • GitHub Actions with a schedule workflow
  • Free uptime pinger services (many exist, they can ping a URL at intervals)

This works well, but remember: the Repl will spin up each time it’s pinged, so don’t expect millisecond precision.

  • Pros: Free, simple, reliable enough for low-frequency jobs.
  • Cons: Repl wakes only when pinged; jobs can be delayed during cold start.

 

Option C: Built-in Timers Only If Repl Stays Awake (Not for Free Repls)

 

In a normal free Repl, your code stops when inactive. So setInterval or Python while True loops won’t run continuously. This option is only valid if you’ve already deployed the app as a Reserved VM.

setInterval(() => {
  console.log("This only runs continuously if the Repl never sleeps");
}, 60000);

Do not rely on this in a normal free Repl — it will stop running as soon as the Repl sleeps.

 

Practical Tips

 

  • Store API keys in Replit Secrets if your scheduled job calls external APIs.
  • Always log output to the Console or to a file so you can debug missed jobs.
  • If using a webhook-based approach, return a short plain response to avoid keeping the scheduler waiting.
  • Test your job manually by hitting the URL before automating the schedule.

 

In short: for real scheduled jobs, you either deploy on a Replit Reserved VM and run cron-like code internally, or you use an external scheduler that triggers a webhook. Those are the only stable, correct ways to do it in Replit today.

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022