https://flyte.org logo
#ask-the-community
Title
# ask-the-community
h

Hampus Rosvall

09/28/2022, 2:09 PM
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

Shivay Lamba

09/28/2022, 2:14 PM
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

Ketan (kumare3)

09/28/2022, 2:23 PM
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

Hampus Rosvall

09/29/2022, 6:35 AM
I tried to rename the workflow and package/register once again, then the launchplan appears in the drop down. Not sure why that happened