Cron Jobs Queue


I have a content type that contains Articles and datetime when an article should be posted to another website.
I get articles from an API by using cron.

Any ideas on how to manage a cron jobs queue by using strapi? Like how do I manage these articles to post them automatically based on some time intervals.


Usually my suggestion would be to have a datetime field on the article to specify when it should be published but since you are fetching the data from an external source you would have to inject a date automatically :thinking:

You could fetch the previous date using something like strapi.query('article').find({ limit: 1, sort: "created_at:desc" }) then use something like moment.js to add additional time for the new article.

Then your cron could check for articles to post. Interesting flow for sure, we do have a guide on this here but it doesn’t have anything along the lines of fetching the articles automatically: Scheduled Publication - Strapi Developer Documentation