Hey, I am trying to understand how to work with la...
# ask-the-community
h
Hey, I am trying to understand how to work with launch plans. Let’s say I have this workflow and I package and deploy it. When I look in the UI the launch plan is there, but when I inspect the workflow I can’t select the launch plan. Should I package and deploy the launchplan individually or what is the preferred way? Code in comments
Copy code
import typing, logging
from flytekit import (
        task,
        workflow,
        LaunchPlan,
     )

logging.basicConfig(level=<http://logging.INFO|logging.INFO>, format='%(asctime)s %(levelname)s %(message)s')

@task
def hello():
    <http://logging.info|logging.info>("Hello!")

@task
def world():
    <http://logging.info|logging.info>("World!") 
    
@workflow
def wf() -> None:
    hello()
    world()
    return

LaunchPlan.get_or_create(
    workflow=wf,
    name="flytesnacks_lp",
    default_inputs={},
)
s
Hi Hampus, thanks for your question. There are two ways in which launchplans work with workflows to execute them. You have the default launchplans which come out of the box with a specific workflow version. But you can also configure the workflows to run on a schedule and emit notifications as well.
k
And you can create launchplans arbitrarily
But, they are always tied to a workflow version
What happens when you hit the launch button
On a side note this is a UX improvement we should do - cc @Hongxun
h
I tried to rename the workflow and package/register once again, then the launchplan appears in the drop down. Not sure why that happened
107 Views