<@U06RKAMK0UC> How do I get the result of a workfl...
# ask-ai
b
@ancient-wolf-19325 How do I get the result of a workflow execution once it has succeeded via Flyte Admin service?
a
To get the result of a workflow execution once it has succeeded via the Flyte Admin service, you can use the
FlyteRemote
class from the
flytekit
library. Here's a concise example: 1. Initialize FlyteRemote: Create a
FlyteRemote
object with the appropriate configuration. 2. Fetch Execution: Use the
fetch_execution
method to retrieve the execution details. 3. Access Outputs: Access the outputs of the execution.
Copy code
from flytekit.remote import FlyteRemote, Config

# Initialize FlyteRemote
remote = FlyteRemote(
    config=Config.for_endpoint(endpoint="flyte.example.net"),
    default_project="flytesnacks",
    default_domain="development",
)

# Fetch the execution
execution = remote.fetch_execution(
    name="fb22e306a0d91e1c6000", project="flytesnacks", domain="development"
)

# Access the outputs
output_keys = execution.outputs.keys()
model_file = execution.outputs["model_file"]
with open(model_file) as f:
    result = f.read()
    print(result)
For more details, refer to the Flyte documentation on inspecting executions. Would you like more detail on any specific part? Sources: - Inspecting Executions - FlyteRemote API 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.