Is there a way to trigger cron jobs on Heroku?

I have a background job I need to run every day. I don’t think this works well on Heroku because their instances can fall asleep (so cron can’t really work), and if you’re trying to scale horizontally, then you’ll probably have the same job running multiple times.

I have an ideal solution, but don’t see how I’d make it work with Strapi.

I want to be able to call npm run run_strapi_job once a day. When I call that, I basically need it to run a function that can tie into Strapi and leverage the DB/entities/etc.

Is this possible? Am I overthinking it? Can I just import Strapi and use it?

New to Strapi, but with Nest.js for instance, I need Nest to boot up their CommandRunner for this all to work.


See Strapi Development Best Practices 006 - Cronjobs within Strapi - YouTube