If you want to cancel the deployment in progress for some reason (need to deploy a higher priority update, realize it will fail, or see some failures during validation) there are a number of ways to do so.
What happens when you cancel a deployment
The deployment process is a complex, multi-step process that is designed to preserve data integrity. When a cancellation is received, the deploy completes its current step and then proceeds with the request to cancel the deploy and execute the rollback.
How long does a cancellation take
Because canceling a deployment is a complex, multi-step process, it can take some time to complete. The length of time depends on the deployment payload size, the number of components to roll back, the relationships and dependencies between components, etc. For example, if the deployment is currently processing a single metadata type with many files, the cancel operation may not be triggered for a long time due to the process outlined above.
Why is a canceled deployment still in progress
A canceled deployment may still show as in progress for some time. This behavior happens sometimes because the cancel operation doesn’t directly stop the deployment process. The process goes through several steps and how long it takes also depends on how complex the rollback is.
Check the status of a cancellation
To check the status of the cancellation, call checkDeployStatus(). Also review 'Change Set' validation or deployment stuck in 'In Progress'
Cancel a deployment or validation
1. From the UI:
2. Using REST API:
3. Using Salesforce CLI:
4. Using ANT migration tool:
000392895

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.