Flow and Process Builder List View with Batch Delete

Flow and Process Builder List View with Batch Delete

See this post on unofficialsf.com for the latest version of this Application. It has been refactored to use the most recent versions of the prerequisite components. Eric Smith 11/5/2022

I’ve been following a couple of ideas on the Idea Exchange for a while now.  One has over 11,000 points and 13 merged ideas.  Process Builder – List View and the other Allow Mass Deletion of Inactive Process Builder Versions has over 4,000 points with 4 merged ideas.

I don’t know about you, but I get pretty frustrated trying to view and keep track of all of my Flows and Process Builders.  A better List View would certainly be appreciated.

When it comes to trying to clean things up and delete some old inactive versions, it becomes downright painful.  

  • Find the Process Builder, 
  • Expand the list, 
  • Find the old version, 
  • Click Delete, 
  • Click Confirm, 
  • Wait,
  • Wait some more, 
  • Go to select the next one — 
  • Oh ^#%$@ I have to start all over again!!!

I decided to put my Datatable component to work and updated it to support Apex-Defined object variables.  Using data pulled from three different Salesforce internal objects, I’m able to display details about Flows and Process Builders.  The full power of the Datatable component comes into play by offering a List View with sorting, highlighting, filtering and more.

Taking advantage of the Datatable’s ability to select multiple records and pass them along in a Flow to be acted upon, I created a Flow Action that interfaces with the Metadata API and handles the batch deletion of the selected inactive Flows and/or Process Builders. 

I’ve bundled all of this together in an App that includes a configurable List View, List View with batch selection for delete and a Flow Picker where you can select a single Flow or Process Builder and then work with a List View of all of its active and inactive versions.

Here’s a video of the component in action.

Installation Instructions

Instructions

Source Code

32 thoughts on “Flow and Process Builder List View with Batch Delete

  1. Very interesting. I am also looking for ideas on how to incorporate a master process builder controller that decides which process builder to call that all listens to the same object. Goal is to minimize multiple process builders that listen to same object but have unique filter/decision criteria. Any ideas or references?

    Like

  2. Hi Eric,

    This is brilliant. I am using user defined objects to setup a table in my flow and it displays the details accurately. But I am facing a problem in the selection output variable. If I select three from the table displayed, the output does show three selection but the content is always of the first option. I cannot use the selection further. Also the preselect string does not show the preselected records. Can you help please. Am I doing something wrong here?

    Like

  3. What is meant by “Deletion result is: Pending”?
    I’ve selected about 50 flow versions to delete, and see this after clicking next. I’ve waited over 10 mins but the flow versions aren’t being deleted. Can I check on the pending jobs anywhere?

    Like

      1. I can see all the flow versions after clicking ‘View Details and Version’ and the inactive versions are still there after running though the batch deletion, and getting the ‘Pending’ deletion result from the flow. I would expect them to have been deleted by now. Can I check on the deletion job progress?

        Like

    1. I tried selecting 5 out of the list to delete. The batch delete flow ended with ‘Deletion result is: Pending’ again, and after 10 mins, the flow versions have still not been deleted.

      I have had success deleting multiple other flows and PBs with this app, but these particular flow versions do not want to be deleted for some reason.

      Like

    2. Aha! If I try to delete the flow version in the regular Salesforce UI, I get a number of notices that say “This flow version is referenced elsewhere in salesforce.com. Remove the usage and try again.”, and beside that is a hyperlinked Flow Interview.

      Clicking on the flow interview takes me to a flow that appears to have failed, since it has a ‘Paused or Failed Date’.

      I wonder if the new addition of ‘Paused And Failed Flow Interviews’ in setup in the Summer ’21 release has complicated this process?

      Deleting the failed flow interviews allowed me to manually delete the flow interview. I then tried the batch delete app again, and got the ‘Deletion result is: InProgress’. After a moment, I checked the list of flow versions, and they were all successfully deleted.

      Thanks for your help Eric!

      Like

  4. Hi Eric,

    I have been installed the tool in my Sandbox and facing one issue. After selecting Select the Flow you would like to Run in Full Screen mode –> Select a Single Flow or PB with Option to Delete Inactive Versions (3 Options) –> Process Builder –> Select the inactive Process Builders and/or Flows you want to DELETE and select Next. It’s not displaying (fetching) any rows. Could you help me with this issue?

    Thanks
    Vishnu VS.

    Like

      1. Yes, I am running as System Administrator. I ran the flow “Flow and Process Builder List View” in Debug Mode, I got the Active versions of Process Builder’s in the results section (Debug Details) but not on the layout.

        Like

  5. Has anybody had an issues lately? Trying to run it and keep getting empty table. Tried redploying from github for latest version updates and resaving the flows to get recent API version but didn’t help.

    I tried to debug one of the flows and can see the data is being pulled but nothing in the table shows.

    Like

  6. Here’s a Test Class for FlowDatatableDescriptor.cls

    FlowDatatableDescriptorTest.cls

    @isTest
    public with sharing class FlowDatatableDescriptorTest {

    static testMethod void test() {

    FlowDatatableDescriptor fdd = new FlowDatatableDescriptor(‘DurableId’,’description’,’FlowDefinitionViewId’,false,’Label’,null,’ProcessType’,’status’,1,’ApiName’,’LastModifiedBy’,’TriggerType’,’WorkflowObject’,’FlowTypeIcon’,’FlowStatusIcon’,’RowShadeValue’,’Label_name’,’Label_lookup’);
    }

    }

    Like

  7. Eric, thanks so much for providing this. I have used it extensively and it has saved a lot of time.

    Recently, I am running into this Flow error:

    INVALID_SESSION_ID: This session is not valid for use with the API

    I’m not sure what has changed in our sandbox recently. We are not using MFA and my System Admin profile has access to the API. We do not require “High Assurance” on the sessions.

    The flow fails with this error when I run it from the handy App Homepage you created. But it runs successfully if I use Flow Builder’s Debug mode… I’m not sure what else to look at? Any ideas appreciated!

    Like

      1. Reinstalling did the trick!
        I do think MFA was the change; it was enabled for the org, although not for my user. Appreciate the reply.

        Like

  8. Hi Eric,

    When I try to delete a inactive version in my personal dev environment.

    I’m getting the Apex error:

    Error element Delete_Flows (FlowActionCall).
    An Apex error occurred: System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: UNSUPPORTED_API_VERSION: Invalid Api version specified on URL faultcode=sf:UNSUPPORTED_API_VERSION faultactor=

    Anyway I can fix this issue?

    Like

  9. I would take a look at the browser console view to see if it gives you any more information. Could something be set to an API version that is newer than the current release in your dev org?

    Like

Leave a reply to Eric Smith Cancel reply