Zivile
09/15/2025, 10:22 AMMarvin
09/15/2025, 10:22 AMMarvin
09/15/2025, 10:27 AMfrom prefect import flow
from prefect.schedules import Cron
@flow
def my_flow():
print("Hello from a weekday!")
schedule = Cron("0 9 * * 1-5", timezone="America/New_York")
my_flow.from_source(
source="<https://github.com/owner/repo>",
entrypoint="flows/my_flow.py:my_flow",
).deploy(
name="weekday-9am",
work_pool_name="my-pool",
schedule=schedule,
)
- RRule schedule for weekdays at 9am ET
from prefect import flow
from prefect.schedules import RRule
@flow
def my_flow():
print("Hello from a weekday!")
schedule = RRule(
rrule="FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=9;BYMINUTE=0;BYSECOND=0",
timezone="America/New_York",
)
my_flow.from_source(
source="<https://github.com/owner/repo>",
entrypoint="flows/my_flow.py:my_flow",
).deploy(
name="weekday-9am",
work_pool_name="my-pool",
schedule=schedule,
)
Doing this at the deployment level ensures the flow (and thus most downstream events an Automation might listen to) only occur on weekdays.
Cloud UI tips:
- To schedule a deployment for weekdays, open the deployment in the UI → Edit schedule → choose Cron or RRule.
- Cron example: minute=0, hour=9, day-of-week=1-5.
- RRule example: BYDAY=MO,TU,WE,TH,FR; BYHOUR=9; BYMINUTE=0; BYSECOND=0.
- Automations are event-driven and don’t currently have a native “weekday-only” condition. If you must filter Automations by time, the most robust approach is to ensure the triggering event only happens during your desired window (via the deployment schedule) or to send the Automation to a webhook that enforces business hours.
Docs:
- Schedules (concepts)
- Schedules (API)
If you share your specific goal (e.g., “send Slack alerts only Mon–Fri” vs “only run this flow Mon–Fri”), I can suggest the cleanest setup.Zivile
09/15/2025, 10:30 AMMarvin
09/15/2025, 10:30 AMMarvin
09/15/2025, 10:32 AM