I'm excited to share a lightweight, open-source cron job scheduler I built using Node.js and TypeScript. Itโs designed for developers who need a fast, modular way to schedule HTTP tasks without reinventing the wheel. Best of all โ it's completely free and easy to self-host.
๐ Check it out on GitHub โ if you find it useful, a โญ is always appreciated!
๐ Deploy on Railway โ deploy my template in 3 clicks ๐
Loading Video...
In nearly every project Iโve worked on, I needed a way to schedule recurring tasks โ whether it was generating reports every Monday, sending emails monthly, or cleaning up stale data. I kept writing the same cron job configurations over and over again.
Instead of duplicating boilerplate across projects, I decided to build a reusable, configurable, and easy-to-integrate cron job scheduler that works out of the box.
This scheduler uses the
node-cron
library and reads job definitions from environment variables. Each job can be configured to send an HTTP request like GET, POST, etc. to a specified endpoint, with optional parameters.- Configure jobs with simple environment variables
- Supports all the HTTP methods (GET, POST, etc)
- Optional parameters for secure task execution
- Docker-ready for easy deployment
- Open-source and free to use
If your application exposes public or internal API routes, you can use this cron job scheduler to automate tasks like:
- Database backups
- API health checks
- Cache invalidation
- Report generation
- Email or newsletter dispatch
- Background cleanups
- Triggering task queues
Jobs are configured using environment variables in the following format:
JOB{n}="schedule::method::url::prop1=value1::prop2=value2"
Where:
{n}
: Job number (1, 2, 3, etc.)schedule
: Cron schedule expressionmethod
: HTTP method (GET, POST, PUT, DELETE, PATCH)url
: Target URLprop{n}=value{n}
: Optional properties for request body
Fields are separated by
::
(double colon).Also, there are two additional optional variables that you can set: TIMEZONE and RUN_ON_START.
.env
TIMEZONE="UTC"
RUN_ON_START="false"
JOB1="* * * * *::GET::https://example.com/api/"
JOB2="*/2 * * * *::POST::https://example.com/api/::prop1=value1::prop2=value2"
This configuration schedules two cron jobs:
- One that runs every minute and sends a GET request
- Another that runs every 2 minutes and sends a POST request with payload
Letโs say you want to automate database backups. You can:
- Write the backup logic in your existing codebase.
- Expose it via a secure API endpoint (e.g.
/api/backup
). - Deploy the scheduler and configure a cron job to hit that endpoint.
To prevent unauthorized access, use POST requests with secret tokens or auth headers. For example, include an
AUTH_SECRET
parameter that your server validates..env
JOB3="0 0 * * *::POST::https://yourdomain.com/api/backup::auth=YOUR_SECRET"
This ensures only your cron job scheduler can trigger sensitive operations.
I'm already using this scheduler across multiple of my projects. It's a flexible and simple tool that gets the job done โ especially when you just need a simple cron job solution thatโs developer-friendly.
You can deploy it in seconds using my Railway template:
๐ Deploy on Railway
If you find this tool helpful, Iโd love your feedback. Contributions, issues, or even a quick star on GitHub help the project grow. Thanks for checking it out!