[BUG] Workflow Failure Policy Not Working For Sub-Workflows
- Dominant language
- Go
- Stars
- 7.5k
- Forks
- 886
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 120
Description
### Describe the bug
The following code does not appear to let all of the `maybe_fail_task` calls complete when one of them fails.
```python
@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?
- [x] Yes
### Have you read the Code of Conduct?
- [x] Yes
Contributor guide
Assessment
This issue has not been assessed yet.