Skip to main content
Ajit Rajendran (ESRI) a publié du contenu dans Admin Tricks

 Over time, as your organization evolves, you may accumulate multiple versions of flows and flow interviews. Cleaning up these versions and interviews can be essential for maintaining your Salesforce environment's efficiency and clarity.

 

You can follow the below steps to cleanup your org:

 

Query 1:

Before you can delete multiple versions of a flow, you need to identify which versions you want to remove. You can use the following SOQL query to fetch the relevant information:

SELECT DurableId, FlowDefinitionView.ApiName, VersionNumber, Status

FROM FlowVersionView

WHERE FlowDefinitionView.ApiName = 'Flow_API_name'

Replace 'Flow_API_name' with the actual name of the flow you want to clean up. This query retrieves the DurableId, API name, version number, and status of each flow version associated with the specified flow.

 

Query 2:

 

Flow interviews can accumulate over time, especially if some of them are paused or failed. To identify and clean up these interviews, you can use the following SOQL

select Id, InterviewLabel, PauseLabel, WasPausedFromScreen, FlowVersionViewId, InterviewStatus

from FlowInterview where InterviewLabel like '%Flow_Label%'

Replace 'Flow_Label' with the label associated with the interviews you want to delete. This query retrieves the Id, interview label, pause label, pause status, associated flow version, and interview status for each relevant interview.

 

Prepare your import file with the IDs and delete it.

 

#SOQL #crm #productivityboost #productivityboost#productivityboost #salesforcetips #salesforcetips #Salesforce @* Release Readiness Trailblazers *@* Salesforce Administrators *@* Salesforce Administrators *@The Blog Group@Admin Tricks #RRTreasureHunts #New Releases #Automation @Salesforce Automation Hour @* Salesforce Developers *

5 commentaires
  1. 3 sept. 2023, 14:47

    Flow Version Limits

    • Thanks for sharing this awesome resource. Bear in mind that each flow can have a maximum version of 50. While deploying (2) formula changes in a recent flow at work, I hit the flow version limit of 50 – General Flow Limits. I had no choice but to delete a prior version in order to save the modifications in a new flow version. Still, deleting old flow versions can make one nervous, especially seeing that our database admins treat the word "delete" as taboo.

    Best Practice for Flow Versioning

    • A best practice our development team employs is to save the ticket number (i.e., for us – JIRA ticket #) with a brief description of the changes that were made in the description field of the new flow version; this way we don't have to spend time writing a long description for each saved flow version (see screenshot below).Flow Version LimitsThanks for sharing this awesome resource. Bear in mind that each flow can have a maximum version of 50.

    (VCS) - Version Control Systems for Flows

    • Last but certainly not least, when you're approaching or if you've already hit the max. number of flow versions, you can use an IDE such as VS Code/IntelliJ, etc., to backup prior flow versions you plan to delete (see screenshot below).  Just connect your IDE to your Salesforce org and download the Flow metadata as well as the Flow Definition metadata files for the relevant flow versions that will be deleted, then backup the files to a VCS such as GitHub or BitBucket, or simply attach the file to your ticketing system. This way, if you ever need to revert or refer to those prior flow version(s), you can fetch the files from your VCS or ticket. 2023-09-03_09-59-49.png2023-09-03_10-53-56.png2023-09-03_10-53-08.png

    Helpful resources:

0/9000