brief-family-9488
09/04/2025, 10:02 PMancient-wolf-19325
09/04/2025, 10:02 PMancient-wolf-19325
09/04/2025, 10:03 PMfetch_launch_plan
method, specifying the project, domain, name, and optionally the version of the launch plan. For example:
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config
remote = FlyteRemote(
config=Config.for_endpoint(endpoint="<http://flyte.example.net|flyte.example.net>"),
default_project="flytesnacks",
default_domain="development",
)
flyte_lp = remote.fetch_launch_plan(
name="<http://workflows.example.wf|workflows.example.wf>", version="v1", project="flytesnacks", domain="development"
)
This retrieves the specified launch plan from the Flyte backend. If you omit the version, it fetches the latest version by default.
Sources:
- Running launch plans
- flytekit.remote.remote.FlyteRemote.fetch_launch_plan 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.brief-family-9488
09/04/2025, 10:35 PMancient-wolf-19325
09/04/2025, 10:35 PMancient-wolf-19325
09/04/2025, 10:36 PMfetch_active_launchplan
method, providing the project, domain, and name. This returns the currently active version for that launch plan:
flyte_lp = remote.fetch_active_launchplan(
project="flytesnacks",
domain="development",
name="<http://workflows.example.wf|workflows.example.wf>"
)
This method returns the active launch plan or None
if none is active. You do not need to specify the version.
Sources:
- flytekit.remote.remote.FlyteRemote.fetch_active_launchplan 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.brief-family-9488
09/05/2025, 6:25 PMancient-wolf-19325
09/05/2025, 6:25 PMancient-wolf-19325
09/05/2025, 6:26 PMflytekit.current_context().execution_id.domain
and use this value when calling fetch_active_launchplan
. This approach allows you to dynamically set the domain based on the running context:
from flytekit import current_context
domain = current_context().execution_id.domain
flyte_lp = remote.fetch_active_launchplan(
project="flytesnacks",
domain=domain,
name="<http://workflows.example.wf|workflows.example.wf>"
)
However, this method works in Python tasks running on Kubernetes, but may not work in all plugin environments (e.g., Databricks), as noted in the discussions.
Sources:
- https://github.com/flyteorg/flytekit/blob/master/flytekit/remote/remote.py
- https://github.com/flyteorg/flytesnacks/blob/master/examples/basics/basics/launch_plan.py 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.brief-family-9488
09/05/2025, 6:30 PMancient-wolf-19325
09/05/2025, 6:30 PMancient-wolf-19325
09/05/2025, 6:31 PMflytekit.current_context()
is only meaningful inside a running Flyte task or workflow execution. It provides access to execution parameters and context, but is not intended for use outside of task/workflow execution. Fetching a launch plan (e.g., with remote.fetch_launch_plan
) is typically done outside of tasks, such as in orchestration or client code, not within a task body.
Sources:
- https://github.com/flyteorg/flytesnacks/blob/master/examples/basics/basics/launch_plan.py 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.brief-family-9488
09/05/2025, 6:36 PMancient-wolf-19325
09/05/2025, 6:36 PMancient-wolf-19325
09/05/2025, 6:37 PM