Stay organized with collections
Save and categorize content based on your preferences.
You can rerun specific tasks from a completed, cancelled, or failed machine
learning (ML) pipeline runs. When you initiate a rerun, you can modify task-level
configurations, or choose to skip tasks, and then create a run based on the
updated configuration. The new pipeline run maintains a reference to the
original pipeline run for traceability. If a task succeeded in a prior run,
Vertex AI Pipelines reuses the cached outcomes for that task. Otherwise,
if the step had failed, Vertex AI Pipelines runs the step during
the pipeline rerun.
This lets you efficiently address ML pipeline failures by making adjustments to
your ML pipeline without restarting the entire ML pipeline. You can adjust a
failed task, compare outcomes with different sets of parameters, or skip a
non-essential task that's failing.
Rerunning a pipeline is useful for MLOps practitioners managing complex
ML pipelines in production. Examples of scenarios where it's useful include the
following:
Handling partial failures in parallel processes: When one part of a
large parallel process fails, you can skip the failed task and let the remainder
of the pipeline run continue. For example, if a data pipeline for one out of 100
tasks fails, you can skip it.
Rerunning a task with updated input data: If a single task needs to be
rerun with updated data, you can rerun that specific task.
Debugging production issues without requiring code changes: Rerun a
specific task and all the tasks that depend on it without involving the author
of the pipeline code.
Rerun a pipeline
To rerun a pipeline, use the Vertex AI SDK for Python.
Python
Use the following sample to rerun a pipeline by skipping a failed task and
rerunning another task with updated parameters by using the
PipelineJob.rerun() method:
PROJECT_ID: The Google Cloud project containing the pipeline run.
LOCATION: The region where the pipeline run is located. For more information
about the regions where Vertex AI Pipelines is available, see the
Vertex AI locations guide.
PIPELINE_RUN_RESOURCE_NAME: The fully qualified resource name of
the completed, failed, or cancelled pipeline run that you want to rerun.
Enter the resource name in the format
projects/PROJECT_NUMBER/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID, where:
PROJECT_NUMBER: The project number for your project. You can
locate this project number in the Google Cloud console. For more information, see
Find the project name, number, and ID.
PIPELINE_RUN_ID with the unique ID of the pipeline run
that you want to rerun. The ID is displayed in the Runs tab on the
Pipelines page in the Google Cloud console.
RERUN_TASK_NAME: The name of the task to rerun with updated parameters.
SKIP_FAILED_TASK_NAME: The name of the failed task to skip during the rerun.
TASK_PARAMETER_1 and TASK_PARAMETER_2: The names of
the parameters for the task that you want to override in the pipeline rerun.
TASK_PARAMETER_1_VALUE and TASK_PARAMETER_2_VALUE:
The new values of TASK_PARAMETER_1 and TASK_PARAMETER_2
respectively in the pipeline rerun.
PIPELINE_PARAMETER_VALUES: Optional. The updated pipeline run-level
parameter values to use for the pipeline rerun.
RERUN_PIPELINE_JOB_ID: Optional. A unique ID to assign to the
new pipeline rerun job.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Rerun a pipeline\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nYou can rerun specific tasks from a completed, cancelled, or failed machine\nlearning (ML) pipeline runs. When you initiate a rerun, you can modify task-level\nconfigurations, or choose to skip tasks, and then create a run based on the\nupdated configuration. The new pipeline run maintains a reference to the\noriginal pipeline run for traceability. If a task succeeded in a prior run,\nVertex AI Pipelines reuses the cached outcomes for that task. Otherwise,\nif the step had failed, Vertex AI Pipelines runs the step during\nthe pipeline rerun.\n\nThis lets you efficiently address ML pipeline failures by making adjustments to\nyour ML pipeline without restarting the entire ML pipeline. You can adjust a\nfailed task, compare outcomes with different sets of parameters, or skip a\nnon-essential task that's failing.\n\nRerunning a pipeline is useful for MLOps practitioners managing complex\nML pipelines in production. Examples of scenarios where it's useful include the\nfollowing:\n\n- **Handling partial failures in parallel processes**: When one part of a\n large parallel process fails, you can skip the failed task and let the remainder\n of the pipeline run continue. For example, if a data pipeline for one out of 100\n tasks fails, you can skip it.\n\n- **Rerunning a task with updated input data**: If a single task needs to be\n rerun with updated data, you can rerun that specific task.\n\n- **Debugging production issues without requiring code changes**: Rerun a\n specific task and all the tasks that depend on it without involving the author\n of the pipeline code.\n\nRerun a pipeline\n----------------\n\nTo rerun a pipeline, use the Vertex AI SDK for Python. \n\n### Python\n\nUse the following sample to rerun a pipeline by skipping a failed task and\nrerunning another task with updated parameters by using the\n`PipelineJob.rerun()` method:\n\n\u003cbr /\u003e\n\n```python\nfrom google.cloud import aiplatform\nfrom google.cloud.aiplatform.preview.pipelinejob.pipeline_jobs import (\n _PipelineJob as PipelineJob\n)\nfrom google.cloud.aiplatform_v1beta1.types.ui_pipeline_spec import RuntimeArtifact\nfrom google.protobuf.struct_pb2 import Value\nfrom google.cloud.aiplatform_v1beta1.types import PipelineTaskRerunConfig\naiplatform.init(project=\"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\", location=\"\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\")\njob = aiplatform.PipelineJob.get(resource_name=\"\u003cvar translate=\"no\"\u003ePIPELINE_RUN_RESOURCE_NAME\u003c/var\u003e\")\noriginal_job_name = job.resource_name\nrerun_task_id = None\nskip_failed_task_id = None\ntask_inputs_override = PipelineTaskRerunConfig.Inputs(\n parameter_values={\n \"\u003cvar translate=\"no\"\u003eTASK_PARAMETER_1\u003c/var\u003e\": Value(TASK_PARAMETER_1_VALUE),\n \"\u003cvar translate=\"no\"\u003eTASK_PARAMETER_2\u003c/var\u003e\": Value(TASK_PARAMETER_2_VALUE)\n }\n)\nfor task in job.task_details:\n if task.task_name == RERUN_TASK_NAME:\n rerun_task_id = task.task_id\n if task.task_name == SKIP_FAILED_TASK_NAME:\n skip_failed_task_id = task.task_id\npipeline_job.rerun(original_pipelinejob_name=original_job_name,\n pipeline_task_rerun_configs=[\n PipelineTaskRerunConfig(task_id = rerun_task_id,\n skip_task = False,\n inputs = PipelineTaskRerunConfig.Inputs(task_inputs_override)\n ),\n PipelineTaskRerunConfig(task_id = skip_failed_task_id,\n skip_task = True\n )\n ],\n parameter_values=PIPELINE_PARAMETER_VALUES,\n job_id=RERUN_PIPELINE_JOB_ID)\n```\n\n\u003cbr /\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The Google Cloud project containing the pipeline run.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region where the pipeline run is located. For more information about the regions where Vertex AI Pipelines is available, see the [Vertex AI locations guide](/vertex-ai/docs/general/locations#feature-availability).\n- \u003cvar translate=\"no\"\u003ePIPELINE_RUN_RESOURCE_NAME\u003c/var\u003e: The fully qualified resource name of\n the completed, failed, or cancelled pipeline run that you want to rerun.\n Enter the resource name in the format\n `projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/pipelineJobs/`\u003cvar translate=\"no\"\u003ePIPELINE_RUN_ID\u003c/var\u003e, where:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e: The project number for your project. You can locate this project number in the Google Cloud console. For more information, see [Find the project name, number, and ID](/resource-manager/docs/creating-managing-projects#identifying_projects).\n - \u003cvar translate=\"no\"\u003ePIPELINE_RUN_ID\u003c/var\u003e with the unique ID of the pipeline run that you want to rerun. The ID is displayed in the **Runs** tab on the **Pipelines** page in the Google Cloud console.\n- \u003cvar translate=\"no\"\u003eRERUN_TASK_NAME\u003c/var\u003e: The name of the task to rerun with updated parameters.\n- \u003cvar translate=\"no\"\u003eSKIP_FAILED_TASK_NAME\u003c/var\u003e: The name of the failed task to skip during the rerun.\n- \u003cvar translate=\"no\"\u003eTASK_PARAMETER_1\u003c/var\u003e and \u003cvar translate=\"no\"\u003eTASK_PARAMETER_2\u003c/var\u003e: The names of the parameters for the task that you want to override in the pipeline rerun.\n- \u003cvar translate=\"no\"\u003eTASK_PARAMETER_1_VALUE\u003c/var\u003e and \u003cvar translate=\"no\"\u003eTASK_PARAMETER_2_VALUE\u003c/var\u003e: The new values of \u003cvar translate=\"no\"\u003eTASK_PARAMETER_1\u003c/var\u003e and \u003cvar translate=\"no\"\u003eTASK_PARAMETER_2\u003c/var\u003e respectively in the pipeline rerun.\n- \u003cvar translate=\"no\"\u003ePIPELINE_PARAMETER_VALUES\u003c/var\u003e: Optional. The updated pipeline run-level parameter values to use for the pipeline rerun.\n- \u003cvar translate=\"no\"\u003eRERUN_PIPELINE_JOB_ID\u003c/var\u003e: Optional. A unique ID to assign to the new pipeline rerun job.\n\n\u003cbr /\u003e"]]