https://dagster.io/ logo
#ask-community
Title
# ask-community
k

Krishna Somasundaram Rm ee19b147

07/01/2022, 7:21 AM
Hi, I'd like to build a job, which has 3 schedules, all of which need to be active at the same time. It is supposed to work on the second last day of the month. Here is what I've built so far:
Copy code
### Second last day of the month. Run all 3 to ensure the required behaviour
pay_day_schedule1 = ScheduleDefinition(
    job=time_job, cron_schedule="55 23 29 4,6,9,11        *", default_status=DefaultScheduleStatus.RUNNING
)
pay_day_schedule2 = ScheduleDefinition(
    job=time_job, cron_schedule="55 23 30 1,3,5,7,8,10,12 *", default_status=DefaultScheduleStatus.RUNNING
)
pay_day_schedule3 = ScheduleDefinition(
    job=time_job, cron_schedule="55 23 31 2               *", default_status=DefaultScheduleStatus.RUNNING
)
I understand that I can only attach one schedule with a job. How do I go about working around this?
i

Ilnur Garifullin

07/01/2022, 7:28 AM
You can write a sensor, which will yield runs however you like
c

chris

07/01/2022, 6:32 PM
You can attach the same job to multiple schedules
👍 1
k

Krishna Somasundaram Rm ee19b147

07/02/2022, 10:24 AM
How would I do that? When I run this code, it says that only one schedule can be attached to a job
c

chris

07/05/2022, 8:07 PM
Could you send the exact error message you're hitting?
Regardless, it seems like we have some inconsistency in erroring around this case, so I've made an issue to track this. https://github.com/dagster-io/dagster/issues/8747
2 Views