Getting Started with Process Builder – Part 11 (Mass Delete Paused and Waiting Interviews)

Getting Started with Process Builder – Part 11 (Mass Delete Paused and Waiting Interviews)

Last Updated on November 23, 2020 by Rakesh Gupta

Big Idea or Enduring Question:

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, by navigating to Setup | Paused Flow Interviews as shown in the following screenshot:

Use the Del link to remove an Interview (An interview is a running instance of a Flow) from the Paused and Waiting Interviews queue, but it doesn’t allow you to mass delete/remove the Paused and Waiting Interview. In this article, we are going to discuss a way to mass delete/remove Waiting and Paused Interviews.

Objectives:

This blog post will help us to understand the following

  • How to mass delete/remove Waiting and Paused Interviews.
  • Setup a simple Flow

Business Use case

Martin Jones is working as a System administrator at Universal Containers (UC). He developed a Process to update the Account Description after 5 days of its creation. For testing purposes, he created 10 records, which means 10 Jobs/Interviews are waiting in Paused and Waiting Interviews queue. He wants to delete all the Interviews from a Single click instead of deleting one-by-one.

Below is the screenshot of the most active version of a Process.

Automation Champion Approach (I-do):

While this can be solved using various automation tools like Apex or Flow. In this case, Lightning Flow is being used to solve this requirement.

Before proceeding you have to understand the below-mentioned objects in Salesforce:

  • FlowInterview: -This object represents a flow interview. An interview is a running instance of a Flow.

This article will help you understand how to mass delete Paused and Waiting Interviews. Let’s begin building this automation process.

Guided Practice (We-do):

There are 2 steps to solve Martin’s business requirement using Lightning Flow. We must: 

  1. Define flow properties
  2. Add a delete records element

Step 1: Define Flow Properties

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows, then click New Flows.
  4. Select the Screen Flow option and click on Next and it will open the flow designer for you.

Step 2: Add a Delete Records Element

  1. Drag-and-drop Delete Records element onto the Flow designer. 
  2. Enter a name in the Label field; the API Name will auto-populate.
  3. For How to Find Records to Delete select Specify conditions.
  4. Select the Flow Interview object from the dropdown list.
  5. Set Filter Conditions
    1. Row 1:
      1. Field: Interview Label
      2. Operator: Equals
      3. Value: Sample_Process-1_InterviewLabel
  6. Click Done.

The question arises here why we have chosen InterviewLabel in the Preceding screenshot, why not any other fields.

  • This is because there are a limited number of fields that you can select in the Record Delete element for FlowInterview.
  • InterviewLabel field is made up of ProcessAPIName-VersionNo_ObjectName and API Name is always the same for all versions of a Process
  • It also gives you the flexibility to mass delete Interviews of a specific version of a Process

In the end, Martin’s Flow will look like the following screenshot: 

Click on the Save button and save the Flow with the name Mass delete Paused and Waiting Interviews as shown in the following screenshot: 

Almost there! Once everything looks good, click the Activate button.

Proof of Concept

Currently, there are 4 Interviews waiting in Paused and Waiting Interviews queue for Process Sample_Process-1, as shown in the following screenshot:

It’s time to Run the Flow to mass delete Interview those belongs to Process Sample_Process-1. To do this navigate to Setup | 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, shown in the following screenshot: 

 Go back to Paused and Waiting Interviews section available on the Flow Management page and check it out:

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

4 thoughts on “Getting Started with Process Builder – Part 11 (Mass Delete Paused and Waiting Interviews)

  1. This is great, however, I have flow interviews that lack an interview label, so using Interviewlabel as the criteria in step two won’t work. I tried using Name = [api name of the process], but still received an error message that there wasn’t a flow that matched the criteria. Any ideas?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.