<#3169 [BUG] LaunchPlan created as part of a workf...
# flytekit
c
#3169 [BUG] LaunchPlan created as part of a workflow that is called from a reference workflow uses incorrect project and domain Issue created by ggydush ### Describe the bug When calling a workflow that contains a LaunchPlan with a reference workflow in another project, the project/domain of the LaunchPlan matches the reference workflow rather than the project/domain of the originally registered workflow. ### Expected behavior The LaunchPlan being called by the reference workflow would have its project and domain be consistent with the originally registered ### Additional context to reproduce Let's say I have 2 projects (Project A and Project B). In Project A I have a workflow that uses a LaunchPlan, which executes fine if being called from Project A. However, if I try to call this workflow via a ReferenceLaunchPlan in Project B, Flyte attempts to find the LaunchPlan in Project B instead of Project A. Project A:
Copy code
└── projecta
    └── workflows
        └── test_workflow.py (shown below)
Where
test__workflow.py
from flytekit import LaunchPlan, dynamic, task, workflow @task def dummy_task(a: int) -> int: return a @workflow def wrapper_workflow(a: int) -> int: return dummy_task(a=a) @dynamic def dynamic_lp(a: int) -> int: # In our real-world example, we are using LaunchPlan here rather than subworkflow to handle large fan out lp = LaunchPlan.get_or_create(wrapper_workflow) return lp(a=a) @workflow def workflow_test(a: int) -> int: return dynamic_lp(a=a) Project B from flytekit import workflow from flytekit.core.launch_plan import reference_launch_plan def interface(a: int) -> int: ... rlp = reference_launch_plan( project="projecta", domain="development", name="projecta.workflows.test_workflow.workflow_test", version="1", )(interface) @workflow def workflow_calling_reference(a: int) -> int: return rlp(a=a) ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte