Skip to main content

Launch plans, schedules, and fixed inputs

In flytekit, a LaunchPlan binds a workflow to reusable parameters—defaults, fixed values, schedules, and triggers. You create one with LaunchPlan.get_or_create, then call it like the workflow itself.

Parameterizing with fixed and default inputs

Pass default_inputs and fixed_inputs to LaunchPlan.create. Fixed inputs are translated into a LiteralMap and removed from the parameters so they cannot change at launch time.

lp = LaunchPlan.create(
name="my_plan",
workflow=my_wf,
default_inputs={"a": 10},
fixed_inputs={"c": "fixed"},
)

Inside create, fixed literals are built via translate_inputs_to_literals; the constructor then excludes those keys from parameters.

Connecting schedules and triggers

Attach a CronSchedule or FixedRate through the schedule argument; use OnSchedule to implement LaunchPlanTriggerBase.

from flytekit.core.schedule import CronSchedule, FixedRate, OnSchedule

lp = LaunchPlan.get_or_create(
workflow=my_wf,
name="scheduled",
schedule=CronSchedule(schedule="*/5 * * * *"),
)

LaunchPlanTriggerBase (schedule.py) requires to_flyte_idl; OnSchedule wraps CronSchedule or FixedRate and delegates.

Internal caching and references

LaunchPlan.CACHE stores plans by name. get_or_create raises ValueError if you request a default plan with extra properties, and validates uniqueness. ReferenceLaunchPlan extends LaunchPlan for external pointers without network calls.