# Can I have a cron job while using setup config?

**URL:** <https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556>\
**Category:** Bug Reports\
**Tags:** circle-yml\
**Created:** [July 6, 2021, 1:26pm UTC](https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556 "2021-07-06T13:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JAremko](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaremko/32/16914_2.png) [@JAremko](https://discuss.circleci.com/u/JAremko)\
**Post date:** [July 6, 2021, 1:26pm UTC](https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556/1 "2021-07-06T13:26:46Z")

</div>

I had a cron job but after switching to setup config it won’t run, not even config generation step. I think there is a chicken and an egg problem. To schedule cron run CircleCI has to generate config that contains the schedule. Is it so or I messed up something? Can I work around it by adding cron job to the setup config?

[Here’s config](https://github.com/syl20bnr/spacemacs/blob/d78d8282f553965d1c6f799179dac13828ca3bc5/.circleci/config_tmpl.yml)

I had to use setup init because top level parameters don’t accept env\_var\_name type

---

<div class="post-metadata">

**Author:** ![JAremko](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaremko/32/16914_2.png) [@JAremko](https://discuss.circleci.com/u/JAremko)\
**Post date:** [July 6, 2021, 2:53pm UTC](https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556/2 "2021-07-06T14:53:50Z")

</div>

Adding cron into setup config makes CircleCI not run at all. It probably crushes before it can report anything. Given that the project page become unavailable after I pushed the update… Could be a coincidence or a very bad sign 🤔

---

<div class="post-metadata">

**Author:** ![mqchau](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mqchau/32/12804_2.png) [@mqchau](https://discuss.circleci.com/u/mqchau)\
**Post date:** [July 7, 2021, 10:50pm UTC](https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556/3 "2021-07-07T22:50:41Z")

</div>

It’s a known problem for a few months. [Setup workflow and scheduled workflow in the same configuration](https://discuss.circleci.com/t/setup-workflow-and-scheduled-workflow-in-the-same-configuration/39932)

---

<div class="post-metadata">

**Author:** ![stig](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/stig/32/25107_2.png) [@stig](https://discuss.circleci.com/u/stig)\
**Post date:** [October 28, 2021, 2:04pm UTC](https://discuss.circleci.com/t/can-i-have-a-cron-job-while-using-setup-config/40556/4 "2021-10-28T14:04:56Z")

</div>

We have just announced the eventual replacement for Scheduled Workflows, see [Scheduled Pipelines Are Here](https://discuss.circleci.com/t/scheduled-pipelines-are-here/41684). This new (preview) feature supports scheduling pipelines that uses setup workflows.

Thank you for your patience, and happy building!
