Reference Launch Plan#

Tags: Intermediate

A flytekit.reference_launch_plan() references previously defined, serialized, and registered Flyte launch plans. You can reference launch plans from other projects and create workflows that use launch plans declared by others.

The following example illustrates how to use reference launch plans.


Reference launch plans cannot be run locally. You must mock them out.

from typing import List

from flytekit import reference_launch_plan, workflow
from flytekit.types.file import FlyteFile

    version="{{ registration.version }}",
def normalize_csv_file(
    csv_url: FlyteFile,
    column_names: List[str],
    columns_to_normalize: List[str],
    output_location: str,
) -> FlyteFile:

def reference_lp_wf() -> FlyteFile:
    return normalize_csv_file(
        column_names=["Name", "Sex", "Age", "Heights (in)", "Weight (lbs)"],

It’s important to verify that the workflow interface corresponds to that of the referenced workflow.


The macro {{ registration.version }} is populated by flytectl register during registration. Generally, it is unnecessary for reference launch plans, as it is preferable to bind to a specific version of the task or launch plan. However, in this example, we are registering both the launch plan core.flyte_basics.files.normalize_csv_file and the workflow that references it. Therefore, we need the macro to be updated to the version of a specific Flytesnacks release. This is why {{ registration.version }} is used.

A typical reference launch plan would resemble the following:

     version="d06cebcfbeabc02b545eefa13a01c6ca992940c8", # If using GIT for versioning OR 0.16.0, if semver
 def normalize_csv_file(...):

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery