In this article Getting Started with Process Builder – Part 2 (Time-dependent actions), I had discussed how to add a Time-based action into a Process. I also discussed a way to check the Paused and Waiting Interviews in the Flow and Process Builder. Click on Setup | Build | create | Workflows & Approvals | Flows and navigate to a section Paused and Waiting Interviews as shown in the following screenshot
Use Del link to remove an Interview (An interview is a running instance of a Flow) from Paused and Waiting Interviews queue, but it doesn’t allow you to mass delete/remove Paused and Waiting Interview. In this article we are going to discuss a way to mass delete/remove Waiting and Paused Interviews. Let’s start with a business use case
Business Use case :- Martin Jones is working as System administrator in Universal Container. He developed a Process to update the Account Description after 5 days of its creation. For testing purpose he has created 10 records, it means there are 10 Jobs/Interviews waiting in Paused and Waiting Interviews queue. He wants to delete all the Interviews from a Single click instead of deleting each one-by-one. Below is the Process Properties screenshot of the most active version of a Process.
Solution of above business requirement
There are multiple solutions possible for the above business scenario. We will use Flow to solve the above business requirement. Before proceeding you have to understand below mentioned objects in Salesforce
A) FlowInterview :-This object represents a flow interview. An interview is a running instance of a Flow.
This article will help you to understand how you can mass delete Paused and Waiting Interviews. Follow the below instructions to create a Flow for the above business requirement
1. Click on Setup | Build | create | Workflows & Approvals | Flows
2. Click on New Flow, it will open the Flow canvas for you. Drag-and-drop Record Delete Element on the Flow Canvas and fill the details as shown in the following screenshot
Once you are done, click on OK. The question arises here why we have chosen InterviewLabel in the Preceding screenshot, why not any other fields.
- This is because of there are a limited number of fields that you can select in Record Delete element for FlowInterview.
- InterviwLabel field is made up with ProcessAPIName-VersionNo_ObjectName and API Name is always same for all versions of a Process
- It also gives you the flexibility to mass delete Interviews of a specific version of a Process
3. Finally your Flow will look like the following screenshot
4. Click on the Save button and save the Flow with the name Mass delete Paused and Waiting Interviews as shown in the following screenshot
5. Don’t forget to Activate the Flow.
It’s time to test this Process
1) Currently there are 10 Interviews waiting in Paused and Waiting Interviews queue for Process “Update Description after 5 days“, as shown in the following screenshot
2) It’s time to Run the Flow to mass delete Interview those belongs to Process “Update Description after 5 days“. To do this navigate to Setup | Build | create | Workflows & Approvals | Flows and click on the Flow Mass delete Paused and Waiting Interviews, it will redirect you to the Flow detail page. Now click on the Run button, a shown in the following screenshot
3) Go back to Paused and Waiting Interviews section available on Flow Management page and check it out
Note:- I will suggest you to implement this first on your developer org test it and then move it to Production.