ancient-wolf-19325
07/29/2024, 12:12 PMLaunchPlan 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:
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.