Hi, I'd like to build a job, which has 3 schedules...
# ask-community
k
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
You can write a sensor, which will yield runs however you like
c
You can attach the same job to multiple schedules
👍 1
k
How would I do that? When I run this code, it says that only one schedule can be attached to a job
c
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