from zenml import pipeline, Schedule@pipelinedef daily_pipeline(): # Pipeline steps pass# Run every day at 2:00 AMschedule = Schedule( name="daily_run", cron_expression="0 2 * * *")daily_pipeline.run(schedule=schedule)
from zenml import pipeline, Schedule@pipelinedef business_hours_pipeline(): pass# Run every weekday at 9 AM, 12 PM, and 5 PMschedule = Schedule( name="business_hours", cron_expression="0 9,12,17 * * 1-5" # Mon-Fri at 9,12,17)business_hours_pipeline.run(schedule=schedule)
from zenml import Schedule# Every minuteSchedule(cron_expression="* * * * *")# Every 15 minutesSchedule(cron_expression="*/15 * * * *")# Every hour at minute 30Schedule(cron_expression="30 * * * *")# Every day at midnightSchedule(cron_expression="0 0 * * *")# Every day at 3:30 AMSchedule(cron_expression="30 3 * * *")# Every Monday at 9 AMSchedule(cron_expression="0 9 * * 1")# First day of every month at midnightSchedule(cron_expression="0 0 1 * *")# Every weekday at 6 PMSchedule(cron_expression="0 18 * * 1-5")
from zenml import pipeline, Schedulefrom datetime import datetime, timedelta, timezone@pipelinedef data_pipeline(): pass# With catchup=True: backfills all missed runsschedule_with_catchup = Schedule( name="with_catchup", start_time=datetime.now(timezone.utc) - timedelta(days=7), interval_second=timedelta(hours=6), catchup=True # Will run 28 times to catch up (7 days * 4 runs/day))# With catchup=False: only runs the latestschedule_no_catchup = Schedule( name="no_catchup", start_time=datetime.now(timezone.utc) - timedelta(days=7), interval_second=timedelta(hours=6), catchup=False # Will only run once (latest interval))
from zenml import pipeline, Schedule@pipelinedef monthly_report(): pass# Run on the 1st and 15th of each month at midnightschedule = Schedule( name="bi_monthly_report", cron_expression="0 0 1,15 * *")monthly_report.run(schedule=schedule)