Launch plans templatize workflow executions with predefined inputs, schedules, and runtime overrides.
A launch plan links a partial or complete list of inputs required to trigger a workflow, along with optional runtime overrides such as notifications and schedules. Launch plans are the only mechanism for invoking workflow executions in Flyte.
Every workflow automatically gets a default launch plan when it is registered. The default launch plan has the same name as the workflow and can bind default workflow inputs and runtime options defined in the project’s flytekit configuration.
Users rarely need to interact with the default launch plan directly. It is generated automatically and is always available.
If your workflow takes a datetime input (e.g., to control which time window of data to process), you can forward the cron kick-off time automatically:
from datetime import datetimefrom flytekit import workflow, LaunchPlan, CronSchedule@workflowdef process_data_wf(kickoff_time: datetime): # read data based on kickoff_time ...process_data_lp = LaunchPlan.get_or_create( process_data_wf, name="process_data_lp", schedule=CronSchedule( schedule="0 * * * *", # every hour kickoff_time_input_arg="kickoff_time", # pass the cron time to the workflow ),)
Launch plans can be used inside a workflow definition, similar to subworkflows:
@taskdef generate_data(num_samples: int, seed: int) -> List[float]: import random random.seed(seed) return [random.random() for _ in range(num_samples)]@workflowdef workflow_with_launchplan(num_samples: int, seed: int) -> List[float]: data = generate_data(num_samples=num_samples, seed=seed) return standard_scale_lp(values=data)
The key difference from subworkflows: when a launch plan is used inside a workflow, it kicks off a new, independent workflow execution on the cluster with its own execution name. A subworkflow executes within the parent workflow’s context.