Hi, is there a way to stop the wf with *success* a...
# flyte-support
i
Hi, is there a way to stop the wf with success after some task and skip remaining tasks without doing a conditional on every following task ?
g
how do you determine when to not skip the tasks?
how does your workflow look like, could you a simple example?
i
I have a task that checks input files.. if no files were found, i want the wf to stop .
No subworkflows were used
g
how about
Copy code
@workflow
def subwf(file_exist: bool) -> typing.Optional[float]:
    return (
        conditional("test")
        .if_(file_exist is True)
        .then(other_wf(....))
        .else_()
        .then(echo())
    )

@workflow
def wf():
   file_exist = check_input_files(...)
   subwf(file_exist=file_exist)
echo is a noop task, it does nothing
I have a pr to add this echo task to flytekit. https://github.com/flyteorg/flytekit/pull/2654
you could create a dummy task for now before we merge that.
i
Yeah i remember we spoke about this few weeks ago 😅 .. So subwf it is ..
g
oh cool, I forgot, sorry.