Cancel pipeline runs

If you no longer need a scheduled or running pipeline run, you can cancel it.If there are multiple pipeline runs to cancel, you can batch cancel thosepipeline runs.

When you initiate a pipeline run cancellation, the status of the pipeline runchanges toCanceling. During this status, Vertex AI Pipelines cancelsall the remaining tasks in the pipeline and all the Google Cloud services andresources invoked by the pipeline run. After all of these tasks, services, andresources are canceled, the pipeline status changes toCanceled.

Note that a canceled pipeline run isn't deleted. You have theoption todelete the pipeline runafter you cancel it.

Cancel a pipeline run

To cancel a pipeline run, use the Google Cloud console, the REST API, or theVertex AI SDK for Python.

Console

Use the following instructions to cancel an ongoing pipeline run from the Google Cloud console:

  1. In the Vertex AI section, go to theRuns tab on thePipelines page.

    Go to Runs

  2. In theRun column, click the name of the pipeline run that you wantto cancel.
  3. On the page displaying the pipeline run details, clickStop. This option is available only if the pipeline run is in theRunningstatus.

After you clickStop, the status of the pipeline changes toCanceling. After all the pipeline tasks, Google Cloud services, andGoogle Cloud resources invoked by the run are canceled, the status changes toCanceled.

REST

To cancel an ongoing or scheduled pipeline run, send aPOST requestby using thepipelineJobs.cancelmethod.

Before using any of the request data, make the following replacements:

  • LOCATION: The region where the pipeline run is located. For more information about the regions where Vertex AI Pipelines is available, see theVertex AI locations guide.
  • PROJECT_ID: The Google Cloud project containing the pipeline run.
  • PIPELINE_RUN_ID: The unique ID of the pipeline run that you want to cancel. The pipeline run ID is displayed in theRuns tab on thePipelines page in the Google Cloud console.

HTTP method and URL:

POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID:cancel

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID:cancel"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID:cancel" | Select-Object -Expand Content

You should receive a successful status code (2xx) and an empty response.

Python

Use the following sample to cancel an ongoing or scheduled pipeline run byusing thePipelineJob.cancel method:

fromgoogle.cloudimportaiplatformaiplatform.init(project=PROJECT_ID,location=LOCATION)pipeline_job=aiplatform.PipelineJob.get(resource_name="PIPELINE_RUN_ID")pipeline_job.cancel()

Replace the following:

  • 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 theVertex AI locations guide.
  • PIPELINE_RUN_ID with the unique ID of the pipeline run that you want to cancel. The ID is displayed in theRuns tab on thePipelines page in theGoogle Cloud console.

Cancel multiple pipeline runs

To cancel multiple pipeline runs simultaneously, use the REST API, or theVertex AI SDK for Python. You can batch cancel pipeline runs that are in the sameproject and region.

REST

To batch cancel multiple ongoing or scheduled pipeline runs, send aPOST requestby using thepipelineJobs.batchCancelmethod.

Before using any of the request data, make the following replacements:

  • LOCATION: The region where the pipeline runs are located. For more information about the regions where Vertex AI Pipelines is available, see theVertex AI locations guide.
  • PROJECT_ID: The Google Cloud project containing the pipeline runs.
  • PIPELINE_RUN_ID_1,PIPELINE_RUN_ID_2: The IDs of the pipeline jobs that you want to cancel. You can find the job ID in theRuns tab on thePipelines page in the Google Cloud console.

HTTP method and URL:

POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchCancel

Request JSON body:

{  "names": [    "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_1",    "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_2"  ]}

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchCancel"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchCancel" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{  "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.BatchCancelPipelineJobsOperationMetadata",    "genericMetadata": {      "createTime": "2025-05-25T16:11:21.011113Z",      "updateTime": "2025-05-25T16:11:21.011113Z"    }  }}

Python

Use the following sample to cancel multiple ongoing or scheduled pipeline runsby using thePipelineJob.batch_cancel method:

fromgoogle.cloudimportaiplatform_v1fromgoogle.api_core.client_optionsimportClientOptionspipeline_run_ids_to_cancel=["PIPELINE_RUN_ID_1","PIPELINE_RUN_ID_2",]client_options=ClientOptions(api_endpoint=f"LOCATION-aiplatform.googleapis.com")pipeline_job_client=aiplatform_v1.PipelineServiceClient(client_options=client_options)pipeline_resource_names_to_cancel=[]forrun_idinpipeline_run_ids_to_cancel:full_resource_name=f"projects/PROJECT_NUMBER/locations/LOCATION/pipelineJobs/{run_id.strip()}"pipeline_resource_names_to_cancel.append(full_resource_name)parent=f"projects/PROJECT_ID/locations/LOCATION"pipeline_job_client.batch_cancel_pipeline_jobs(parent=parent,names=pipeline_resource_names_to_cancel)

Replace the following:

  • PROJECT_ID: Your project ID.
  • LOCATION: The region where the pipeline runs were created.
  • PROJECT_NUMBER: The project number for your project. You can locate this project number in the Google Cloud console.For more information, seeFind the project name, number, and ID.
  • PIPELINE_RUN_ID_1 andPIPELINE_JOB_ID_2: The unique IDs of the pipeline runs that you want to cancel. The pipeline run IDs are displayed in theRuns tab on thePipelines page in the Google Cloud console.

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.