New RunLLM response generated: >>>*# Question* Do...
# runllm-flyte-trial
a
New RunLLM response generated: >>>*# Question* Does anyone know if Flyte scheduler supports setting up start and end dates for schedules? For example, “run every Tuesday for the next two months”? Meaning that the schedule itself will be automatically enabled only during certain period and disabled after that. I have seen that we can use flyte with AWS EventBridge scheduler that allows this, but not sure if this setting is exposed anyhow through the LaunchPlan API. CC @clever-exabyte-82294 # Answer Flyte's native scheduler does support setting up start and end dates for schedules using the
LaunchPlan
API. You can specify a
schedule_end_date
when creating a
LaunchPlan
with a
CronSchedule
. This allows you to define a schedule that will automatically disable after a certain period. Here's an example of how to set up a schedule to run every Tuesday for the next two months:
Copy code
from datetime import datetime, timedelta
from flytekit import LaunchPlan, CronSchedule
from workflows.example import wf

# Define the end date as two months from now
end_date = datetime.now() + timedelta(days=60)

launch_plan = LaunchPlan.get_or_create(
    name="wf_launchplan",
    workflow=wf,
    schedule=CronSchedule(
        schedule="0 0 * * 2",  # Every Tuesday
        kickoff_time_input_arg="kickoff_time",
        schedule_end_date=end_date
    ),
    default_inputs={"name": "Example"},
)
Would you like more details on this? Sources: - Flyte GitHub Issue #245 Slack Link https://flyte-org.slack.com/archives/CP2HDHKE1/p1722255121.954559 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.