#3644 [BUG] Subworkflow chaining does not work when run locally
Issue created by
d-tw
### Describe the bug
When the order of two subworkflows is controlled via the chaining operator, the order of execution is not applied when the code is run locally (locally as in "via direct invocation of python", not locally as in "via a local cluster").
When the workflow is published to Flyte, the DAG and subsequent execution are correct.
### Expected behavior
The order of execution of subworkflows should be identical between local runs and remote execution, especially in the case of unit testing.
### Additional context to reproduce
The version of flytekit is
1.5.0.
Sample code:
from flytekit import workflow, task
import logging
logging.basicConfig(level="DEBUG")
logger = logging.getLogger("wf")
logger.setLevel("DEBUG")
@task
def task_1():
logger.info("task_1")
@task
def task_2():
logger.info("task_2")
@workflow
def sub_workflow_1():
task_1()
@workflow
def sub_workflow_2():
task_2()
@workflow
def parent_workflow():
s1 = sub_workflow_1()
s2 = sub_workflow_2()
s2 >> s1
if
name == "__main__":
parent_workflow()
Output is:
INFO:wf:task_1
INFO:wf:task_2
Expected output is:
INFO:wf:task_2
INFO:wf:task_1
### Screenshots
When registered with a Flyte cluster, the DAG is correct.
[image](https://user-images.githubusercontent.com/3317531/236635153-094a1f1c-a18f-4fa8-906f-3e60c6378755.png)▾
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte