How to set cron in shopify remix app with node - cron

In a Shopify Remix app, you can use node-cron to schedule recurring background tasks

Hi @gauravbairwa ,
Yes ,you can absolutely node-cron inside a Shopify Remix app to schedule recurring background tasks.
Thanks
Manoj

You technically can use node-cron in a Shopify Remix app, although, depending on how your app is deployed, it may not be the best way to scheduled background tasks. If deployed on a serverless environment (e.g. Vercel, Netlify, Oxygen), where our Remix app isn’t a long-lived Node process, node-cron jobs may never run, or run inconsistently. On persistent hosts (fly.io, heroku), it will work better, but then there will still be issues with duplicate runs on multiple instances unless you add some sort of coordination (not a problem when running only a single instance).

A more reliable pattern would be to run an external scheduler that triggers a Remix route: Vercel Cron Jobs, Netlify Scheduled Functions, Cloudflare Workers + Cron Triggers, GitHub Actions etc.

Hey
Basically i wanted to set up a standalone cron job script using render cron service

the script is inside the remix but at the root of the app the only issue is dude to being standalone /independant i cannot seem to make the script get the appcontext like the authenticatation and other feature that are provided by shopify.server.js file

why i want stand alone script its cause that even if my webapp server is down the script should be self sufficient to perform the assigned task

instead of calling a api route the script have the code it need to perform the functionality
Can u guide me?