 more information.

Get the last run of a pipelineTo access the most recent run of a pipeline, you can either use the last_run property or access it through the runs list:

last_run = pipeline_model.last_run  # OR: pipeline_model.runs[0]

If your most recent runs have failed, and you want to find the last run that has succeeded, you can use the last_successful_run property instead.

Get the latest run from a pipeline

Calling a pipeline executes it and then returns the response of the freshly executed run.

run = training_pipeline()

The run that you get back is the model stored in the ZenML database at the point of the method call. This means the pipeline run is still initializing and no steps have been run. To get the latest state can get a refreshed version from the client:

from zenml.client import Client

Client().get_pipeline_run(run.id) to get a refreshed version

Get a run via the client

If you already know the exact run that you want to fetch (e.g., from looking at the dashboard), you can use the Client.get_pipeline_run() method to fetch the run directly without having to query the pipeline first:

from zenml.client import Client

pipeline_run = Client().get_pipeline_run("first_pipeline-2023_06_20-16_20_13_274466")

Similar to pipelines, you can query runs by either ID, name, or name prefix, and you can also discover runs through the Client or CLI via the Client.list_pipeline_runs() or zenml pipeline runs list commands.

Run information

Each run has a collection of useful information which can help you reproduce your runs. In the following, you can find a list of some of the most useful pipeline run information, but there is much more available. See the PipelineRunResponse definition for a comprehensive list.

Status

The status of a pipeline run. There are five possible states: initialized, failed, completed, running, and cached.

status = run.status

Configuration