project deploy cancel

Cancel a deploy operation.

Use this command to cancel a deploy operation that hasn’t yet completed in the org. Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations.

Run this command by either passing it a job ID or specifying the –use-most-recent flag to use the job ID of the most recent deploy operation.

deploy:metadata:cancel

Flag Name (Long)Flag Name (Short)Description
‑‑asyncN/AType: Boolean

Run the command asynchronously.

The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To resume watching the cancellation, run “sf project deploy resume”. To check the status of the cancellation, run “sf project deploy report”.
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑job‑id‑iType: Value

Job ID of the deploy operation you want to cancel.

These commands return a job ID if they time out or you specified the –async flag:

  • sf project deploy start
  • sf project deploy validate
  • sf project deploy quick
  • sf project deploy cancel


The job ID is valid for 10 days from when you started the deploy operation.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑target‑org‑oType: Value

Username or alias of the target org.
‑‑use‑most‑recent‑rType: Boolean

Use the job ID of the most recent deploy operation.

For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less. If your most recent deploy operations was more than 3 days ago, this flag won’t find a job ID.
‑‑wait‑wType: Value

Number of minutes to wait for the command to complete and display results.

If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To resume watching the cancellation, run “sf project deploy resume”. To check the status of the cancellation, run “sf project deploy report”.

Cancel a deploy operation using a job ID:

Cancel the most recent deploy operation: