brief-family-9488
09/10/2025, 9:38 PMancient-wolf-19325
09/10/2025, 9:38 PM@reference_workflow decorator in Python, which creates a local proxy for a remote workflow entity, but execution is only possible on the Flyte platform, not locally (flytekit/core/workflow.py, flytekit/core/reference_entity.py).
An external workflow, on the other hand, refers to the execution of a workflow via a launch plan from within another workflow. This triggers a new, independent execution with its own execution ID and context, separate from the parent workflow. External workflows are useful for distributing workloads across clusters or for cases where you want the sub-workflow to have its own scheduling, resource, or parallelism constraints. In contrast, subworkflows (not external) execute within the same context as the parent workflow (subworkflows.md, tasks_workflows_and_launch_plans.md).
Would you like a step-by-step breakdown or code examples?
Sources:
- subworkflows.md
- flytekit/core/workflow.py
- flytekit/core/reference_entity.py
- tasks_workflows_and_launch_plans.md π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.brief-family-9488
09/10/2025, 9:46 PMancient-wolf-19325
09/10/2025, 9:46 PMfrom flytekit import reference_workflow, workflow
@reference_workflow(
project="flytesnacks",
domain="development",
name="myproject.mymodule.my_workflow",
version="v1"
)
def my_ref_wf(a: int) -> int:
...
@workflow
def parent_wf(x: int) -> int:
return my_ref_wf(a=x)
Would you like more details or explanation of each part?
Sources:
- flytekit/core/workflow.py π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.brief-family-9488
09/10/2025, 10:04 PMReference sub-workflows are currently unsupported. Use reference
launch plans instead.ancient-wolf-19325
09/10/2025, 10:04 PMbrief-family-9488
09/10/2025, 10:05 PMancient-wolf-19325
09/10/2025, 10:05 PMfrom flytekit import reference_launch_plan, workflow
@reference_launch_plan(
project="flytesnacks",
domain="development",
name="data_types_and_io.file.normalize_csv_file",
version="v1"
)
def normalize_csv_file(
csv_url: str,
column_names: list,
columns_to_normalize: list,
output_location: str,
) -> str:
...
2. Use the reference launch plan in a parent workflow:
@workflow
def parent_wf() -> str:
return normalize_csv_file(
csv_url="https://people.sc.fsu.edu/~jburkardt/data/csv/biostats.csv",
column_names=["Name", "Sex", "Age", "Heights (in)", "Weight (lbs)"],
columns_to_normalize=["Age"],
output_location="",
)
This setup will invoke the referenced launch plan as an external workflow execution within your parent workflow.
Sources:
- reference_launch_plans.md
- reference_launch_plan.py π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.brief-family-9488
09/10/2025, 10:08 PMancient-wolf-19325
09/10/2025, 10:08 PM