Track executions and artifacts

Vertex AI Experiments supports tracking both executions andartifacts.Executions are steps in an ML workflow that include but aren't limited todata preprocessing, training, and model evaluation. Executions can consumeartifacts such as datasets and produce artifacts such as models.

Create artifact

The following sample uses thecreatemethod of the Artifact Class.

Python

fromtypingimportDict,Optionalfromgoogle.cloudimportaiplatformdefcreate_artifact_sample(schema_title:str,project:str,location:str,uri:Optional[str]=None,resource_id:Optional[str]=None,display_name:Optional[str]=None,schema_version:Optional[str]=None,description:Optional[str]=None,metadata:Optional[Dict]=None,):artifact=aiplatform.Artifact.create(schema_title=schema_title,uri=uri,resource_id=resource_id,display_name=display_name,schema_version=schema_version,description=description,metadata=metadata,project=project,location=location,)returnartifact
  • schema_title: Required. Identifies the schema title used by the resource.
  • project: . You can find these IDs in the Google Cloud consolewelcome page.
  • location: SeeList of available locations.
  • uri: Optional. URI of artifact's location.
  • resource_id: Optional. Theresource_id portion of the Artifact name with the format. This is globally unique in a metadataStore:
    projects/123/locations/us-central1/metadataStores/<metadata_store_id>/artifacts/<resource_id>.
  • display_name: Optional. The user-defined name of the resource.
  • schema_version: Optional. Specifies the version used by the resource. If not set, defaults to use the latest version.
  • description: Optional. Describes the purpose of the resource to be created.
  • metadata: Optional. Contains the metadata information that will be stored in the resource.

Start execution

The following sample uses thestart_execution method.

Python

fromtypingimportAny,Dict,List,Optionalfromgoogle.cloudimportaiplatformdefstart_execution_sample(schema_title:str,display_name:str,input_artifacts:List[aiplatform.Artifact],output_artifacts:List[aiplatform.Artifact],project:str,location:str,resource_id:Optional[str]=None,metadata:Optional[Dict[str,Any]]=None,schema_version:Optional[str]=None,resume:bool=False,):aiplatform.init(project=project,location=location)withaiplatform.start_execution(schema_title=schema_title,display_name=display_name,resource_id=resource_id,metadata=metadata,schema_version=schema_version,resume=resume,)asexecution:execution.assign_input_artifacts(input_artifacts)execution.assign_output_artifacts(output_artifacts)returnexecution
  • schema_title: Identifies the schema title used by the resource.
  • display_name: The user-defined name of the resource.
  • input_artifacts: Artifacts to assign as input.
  • output_artifacts: Artifacts as outputs to this Execution.
  • project: Your project ID. You can find these in the Google Cloud consolewelcome page.
  • location: SeeList of available locations.
  • resource_id: Optional. Theresource_id portion of the Artifact name with the format. This is globally unique in a metadataStore:projects/123/locations/us-central1/metadataStores/<metadata_store_id>/artifacts/<resource_id>.
  • schema_version: Optional. Specifies the version used by the resource. If not set, defaults to use the latest version.
  • metadata: Optional. Contains the metadata information that will be stored in the resource.
  • resume: bool.

    Note: When the optionalresume parameter is specified asTRUE, the previously started run resumes. When not specified,resume defaults toFALSE and a new run is created.

Notebook samples

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.