Skip to content

SF CLI Seems to not support wildcard character in destructive changes for flow metadata type #3485

@Mrgagne

Description

@Mrgagne

Summary

When attempting to run --pre-destructive-changes on a flow, the sf cli seems to require me to enter each flow version, the issue with this is that each environment may have a uncertain number of flow versions and i would have to modify the destructive changes file for each environment. The Salesforce Documentation referring to the Flow Metadata type says it supports wildcard (*) in the package xml so i assumed this would work in destructive changes.

Steps To Reproduce

  • Create a new salesforce project
  • generate a scratch org
  • Create a Flow with multiple flow versions in a Salesforce org and activate one of the versions
  • in your manifest directory create an packagexml file with no types and call empty.xml(not deploying anything)
  • in your manifest directory create a destructivechange file called issuePost.xml and add your flow name as so SampleFlow-*
  • run this command sf project deploy start --dry-run --verbose -o scratch --manifest manifest/empty.xml --pre-destructive-changes=manifest/issuePost.xml --ignore-warnings --ignore-conflicts
  • You should see that it says it succeeds but nothing happens
 ────────── Deploying Metadata (dry-run) ──────────

 Deploying (dry-run) v65.0 metadata to test-zs6gy7ad4esb@example.com using the v65.0 SOAP API.

 ✔ Preparing 142ms
 ◯ Waiting for the org to respond - Skipped
 ◯ Deploying Metadata - Skipped
 ◯ Running Tests - Skipped
 ◯ Updating Source Tracking - Skipped
 ✔ Done 0ms

 Status: Succeeded
 Deploy ID: 0Afcf000005uGyVCAU
 Target Org: test-zs6gy7ad4esb@example.com
 Deploy URL: https://connect-connect-3149-dev-ed.scratch.my.salesforce.com/lightning/setup/DeployStatus/page?address=%2Fchangemgmt%2FmonitorDeploymentsDetails.apexp%3FasyncId%3D0Afcf000005uGyVCAU%26retURL%3D%252Fchangemgmt%252FmonitorDeployment.apexp
 Size: 524 B of ~39 MB limit
 Files: 2 of 10,000 limit
 Elapsed Time: 143ms


Dry-run complete.

Expected result

I expected to see all of the flow versions get removed

Actual result

Nothing?

Additional information

System Information

zsh terminal

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.118.20",
  "nodeVersion": "node-v22.21.1",
  "osVersion": "Darwin 24.6.0",
  "rootPath": "/Users/mgagne/.local/share/sf/client/2.118.20-aa275e9",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.39 (core)",
    "@oclif/plugin-commands 4.1.38 (core)",
    "@oclif/plugin-help 6.2.36 (core)",
    "@oclif/plugin-not-found 3.2.73 (core)",
    "@oclif/plugin-plugins 5.4.54 (core)",
    "@oclif/plugin-search 1.2.36 (core)",
    "@oclif/plugin-update 4.7.16 (core)",
    "@oclif/plugin-version 2.2.36 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.53 (core)",
    "@oclif/plugin-which 3.2.42 (core)",
    "@salesforce/cli 2.118.20 (core)",
    "agent 1.26.1 (core)",
    "apex 3.9.5 (core)",
    "api 1.3.6 (core)",
    "auth 3.9.26 (core)",
    "code-analyzer 5.8.0 (user) published 17 days ago (Mon Dec 29 2025)",
    "data 4.0.67 (core)",
    "deploy-retrieve 3.24.5 (core)",
    "dev 2.5.1 (user) published 422 days ago (Tue Nov 19 2024)",
    "info 3.4.100 (core)",
    "limits 3.3.74 (core)",
    "marketplace 1.3.8 (core)",
    "omnistudio-migration-tool 1.7.0 (user) published 69 days ago (Fri Nov 07 2025)",
    "org 5.9.53 (core)",
    "packaging 2.24.5 (core)",
    "schema 3.3.90 (core)",
    "settings 2.4.54 (core)",
    "sobject 1.4.81 (core)",
    "telemetry 3.6.71 (core)",
    "templates 56.4.0 (core)",
    "trust 3.7.113 (core)",
    "user 3.6.44 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.2.1 (user) published 467 days ago (Fri Oct 04 2024)",
    "@salesforce/sfdx-scanner 4.12.0 (user) published 260 days ago (Tue Apr 29 2025)"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingWe're actively investigating this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions