Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Workflows in conditionals require returned output. #6241

Open
2 tasks done
dansola opened this issue Feb 12, 2025 · 0 comments
Open
2 tasks done

[BUG] Workflows in conditionals require returned output. #6241

dansola opened this issue Feb 12, 2025 · 0 comments
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working conditionals Used to group issues related to the use of Conditionals in workflows

Comments

@dansola
Copy link
Contributor

dansola commented Feb 12, 2025

Describe the bug

When a workflow is used in the then part of a conditional, there are failures if the workflow in the conditional doesn't return anything.

The child execution of the workflow actually succeeds, but it's the parent conditional that fails.

You need to return some dummy value in order to get the conditional to work.

Expected behavior

Ideally, like a task, the workflow shouldn't need to return anything to be used in a conditional.

Additional context to reproduce

Broken Example:

import flytekit as fl
from flytekit.core.task import Echo

echo = Echo(name="echo")

@fl.task
def t1():
    print('t1')

@fl.workflow
def wf1():
    t1()

@fl.workflow
def wf_conditional(val: str):
    conditional_wf = (
        fl.conditional("conditional")
        .if_(val != "")
        .then(
            wf1()
        )
        .else_()
        .then(echo())
    )

The conditional fails with

Failed to copy child node outputs from [s3://union-oc-production-demo/metadata/propeller/flytesnacks-development-a28459qp8kb8hvvqvgdw/n1/data/0/n1-n0/0/outputs.pb] to [s3://union-oc-production-demo/metadata/propeller/flytesnacks-development-a28459qp8kb8hvvqvgdw/n1/data/0/outputs.pb]

Mitigated Example:

import flytekit as fl
from flytekit.core.task import Echo

echo = Echo(name="echo", inputs={"dummy_input": bool})

@fl.task
def t1():
    print('t1')

@fl.workflow
def wf1() -> bool:
    t1()
    return True

@fl.workflow
def wf_conditional(val: str):
    conditional_wf = (
        fl.conditional("conditional")
        .if_(val != "")
        .then(
            wf1()
        )
        .else_()
        .then(echo())
    )

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@dansola dansola added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Feb 12, 2025
@dansola dansola added the conditionals Used to group issues related to the use of Conditionals in workflows label Feb 12, 2025
@eapolinario eapolinario added backlogged For internal use. Reserved for contributor team workflow. and removed untriaged This issues has not yet been looked at by the Maintainers labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working conditionals Used to group issues related to the use of Conditionals in workflows
Projects
Status: Backlog
Development

No branches or pull requests

2 participants