cuddly-jelly-27016
03/13/2025, 6:20 PMmaybe_fail_task calls complete when one of them fails.
@workflow()
def parent_workflow() -> str:
return randomly_fail_workflow()
@workflow(failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE)
def randomly_fail_workflow() -> str:
maybe_fail_task(idx=0)
maybe_fail_task(idx=1)
maybe_fail_task(idx=2)
maybe_fail_task(idx=3)
return "test"
@task(
requests=ResourceFactory.gig_resources(1, 1, 1),
) # type:ignore [misc]
def maybe_fail_task(idx: int) -> str:
"""Foo."""
time.sleep(20 * float(idx))
if idx % 2 == 0:
raise ValueError("failed")
print(idx)
return str(idx)
### Expected behavior
I would expect that any nodes inside of a workflow that has a WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE configured would be allowed to fail without aborting the rest of the workflow's nodes.
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte