cuddly-jelly-27016
06/11/2025, 12:09 AMfrom flytekit.experimental import eager
from flytekit.types.directory import FlyteDirectory
from flytekit.remote.remote import Config, FlyteRemote
remote = FlyteRemote(
config=Config.auto(config_file="config.yaml"),
default_project="project_name",
default_domain="development",
)
remote_workflow = remote.fetch_launch_plan(
project="project_name", name="workflow_name", version="version_number"
)
@eager(remote=remote)
async def toy_example(directories: FlyteDirectory) -> bool:
result = await remote_workflow(directories=[directories])
return 0
More concisely, a new class e.g. import_launchplan could be used inside of the eager workflow and inherit it's remote definition to fetch things:
result = await import_launchplan('lp_name')(directories=[directories])
And be executable with:
pyflyte --config config.yaml run --project project_name toy_example.py toy_example --directories ./
which currently return: Remotely fetched entities cannot be run locally. Please mock the workflows.remote_workflow.execute.
### Describe alternatives you've considered
It's possible to use pyflyte run --remote followed by pyflyte fetch to get the assets back locally, but that's a more manual process.
It would also be possible to define everything in a remote context within a python script, including the fetch, but that's developing further away from production.
### Propose: Link/Inline OR Additional context
Could be related to: #4570
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
06/11/2025, 12:09 AM