:wave: does anyone know of any examples from docs ...
# flyte-support
f
đź‘‹ does anyone know of any examples from docs or tutorials of launching a workflow from another workflow in an async way where i just want to launch the other workflow but not have it block or hold up my main workflow?
i have a feature importance workflow thats a little flakey and can oom and fail sometimes but i want it to be launched from my training workflow but thats all - just launch it and whatever happens happens - dont want it to impact my training workflow outcome at all.
chatgpt had some suggestions but i think is one or two hallucinations in there : https://chatgpt.com/share/e/67813421-b258-800e-90d2-c146b389b092
runllm suggested this actually:
Copy code
from flytekit import task, workflow
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config

@task
def launch_subworkflow_async():
    remote = FlyteRemote(config=Config.auto())
    launch_plan = remote.fetch_launch_plan(name="subworkflow_launch_plan")
    execution = remote.execute(launch_plan, inputs={"num_samples": 10})
    # Do not wait for the execution to complete

@workflow
def parent_workflow() -> str:
    launch_subworkflow_async()
    return "Subworkflow launched asynchronously"
a
@eager
would let you run an async task without blocking the main workflow https://docs.flyte.org/en/latest/user_guide/advanced_composition/eager_workflows.html This is beta but making strides to GA soon
f
oh interesting - will read up and see if we on a version that has it - thanks!
a
sure. I think it has been available at least since
1.10
c
We have used flyte remote successfully but eager looks interesting.
t
eager is getting a rewrite in 1.15, still in beta but will be backwards incompatible with the experimental syntax in <=1.14
but actually the original question… i don’t think you need it.
why not just run the other workflow and not consume any outputs? you can set failure policy on the parent workflow if you need
f
yeah am trying this approach where i just launch the other workflow. https://flyte-org.slack.com/archives/CP2HDHKE1/p1736520927900819?thread_ts=1736520647.385129&amp;cid=CP2HDHKE1 hopefully thats all i need for what im doing here.
t
sounds good. you may need
@workflow(failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE)