Last Updated on May 30, 2024 by Rakesh Gupta
Big Idea or Enduring Question:
- How do you automatically remove leads from a Sales Engagement Cadence when reps change their status to Unqualified?
Objectives:
After reading this blog, you’ll be able to:
- Work with the ActionCadenceTracker object to find out about a Cadence.
- Remove a target from a Sales Engagement Cadence.
- Decision to check if ‘get record’ returns the records or not.
- And much more.
👉 Previously, I’ve penned several posts on the Sales Engagement Cadence. Why not check them out while you are at it?!
- Have You Traversed the Yellow Brick Road of Sales Cadence, Yet?
- Never Miss a Beat: Notifications for Prospect Removal in Sales Engagement Cadence
- Automatically Assign New Leads to a Sales Engagement Cadence
Business Use case
Benjamin Moore is a Salesforce Administrator at Gurukul On Cloud (GoC). The Sales Director has assigned him the task of automatically remove the leads when reps change their status to ‘Closed – Not Converted’.
Automation Champion Approach (I-do):
Save your sales reps from taking an extra step. To automatically remove lead, contact, or person account records from a cadence when the records reps change their status to Closed – Not Converted. While this can be solved using various automation tools like Apex Trigger and others, we will use Salesforce Flow to solve it.
Before proceeding, you should become familiar with the ActionCadenceTracker object in Salesforce. It represents an active cadence target.
An ActionCadenceTracker record is created when you add a target to a cadence. Use ActionCadenceTracker to learn about a running cadence target, including its state, current step, assigned prospect, and reason for completion.
| Field Name | Details |
| CompletionReason | The reason that the target completed the cadence. This field contains a value if the target’s State is Complete. Possible values are:
|
| State | The state of the current action cadence tracker. Possible values are:
|
| TargetId | The ID of the target (Contact, Lead) that is assigned to this action cadence. |
Before discussing the solution, let me show you a diagram of the process at a high level. Please spend a few minutes going through the following Flow diagram to understand it.
Let’s begin building this automation process.
Guided Practice (We-do):
- Define flow properties for a record-triggered flow.
- Add a Decision element to check the Lead Status.
- Add a Get Records element to find the Active Cadence Target for the current lead.
- Add a Decision element to determine whether the Active Cadence Target has been found.
- Add the Remove Target from Cadence core action – to remove the cadence from the lead.
Things to Note
Assuming the reader has already given Sales Engagement permissions to the target assignee (i.e. lead owner in this scenario), this article will be short. If the lead owner (our target assignee) doesn’t have these permissions, the user creating the lead will encounter an error:
The target assignee doesn’t have any Sales Engagement permissions.
To avoid this:
- Ensure everyone managing cadences has Sales Engagement permissions.
- Before assigning a cadence, verify if the lead owner (our target assignee) has the necessary permissions. If not, grant them before proceeding.
Helpful Articles
- Profile? So Yesterday! – Auto Assign Permission Set Group to a User
- Automatically Assign Permission Sets to New User
Step 1: Define Flow Properties
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flow.
- Select the Record-Triggered Flow option, and click on Create and configure the flow as follows:
- Object: Lead
- Trigger the Flow When: A record is created or updated
- Set Entry Criteria: None
- Optimize the Flow For Action and Related Records
- Click the X at the top to save your changes.

Step 2: Using Decision Element to Check the Lead Status
Now we will use the Decision element to determine whether the Lead Status is ‘Closed – Not Converted’ or not.
- On Flow Designer, click on the +icon and select the Decision element.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label the API Name will auto-populate.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!$Record.Status}
- Operator: Equals
- Value: Closed – Not Converted
- Row 1:
- When to Execute Outcome: Only if the record that triggered the flow to run is updated to meet the condition requirements
- Click Done.

Step 3: Adding a Get Record Element to Find the Active Cadence Target for the Current Lead
The next step is to find the active cadence target for the current lead using the Get Record element.
- On Flow Designer, below the Unqualified node, click on the +icon and select the Get Records element.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the Record ActionCadenceTracker object from the dropdown list.
- Select All Conditions Are Met (AND).Â
- Set Filter Conditions
- Row 1:
- Field: TargetId
- Operator: Equals
- Value: {!$Record.Id}
- Click Add Condition
- Row 2:
- Field: State
- Operator: Dos Not Equal
- Value: Complete
- Row 1:
- How Many Records to Store:
- select Only the first record
- How to Store Record Data:
- Choose the option to Automatically store all fields.Â
- Click the X at the top to save your changes.

Step 4: Using Decision Element to Check Whether the Active Cadence Target Has Been Found or Not
Now, we will use the Decision element to check the Get element from step 3 to determine if it returns the cadence.
- On Flow Designer, click on the +icon and select the Decision element.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label the API Name will auto-populate.
- Condition Requirements to Execute Outcome:Â All Conditions Are Met (AND)
Step 5: Add Remove Target from Cadence Core Action  – to Remove the Lead from Cadence
- On Flow Designer, below the Found node, click on the +icon and select the Action element.
- Select the Remove Target from Cadence core action.
- Enter a name in the Label field- the API Name will auto-populate.
- Set Input Values:
- Completion Reason: ManuallyRemoved
- Completion Disposition: Disqualified
- Target Id: {!$Record.Id}
- Click Done.

In the end, Benjamin’s Flow will look like the following screenshot:
Once everything looks good, perform the steps below:Â
- Click Save.
- Enter Flow Label the API Name will auto-populate.
- Click Show Advanced.
- API Version for Running the Flow:Â 59
- Interview Label: Lead After – Save Flow {!$Flow.CurrentDateTime}
- Click Save.

Almost there! Once everything looks good, click the Activate button.Â
Proof of Concept
From now on, when reps change their lead status to ‘Closed – Not Converted’, a record-triggered flow will be automatically triggered and will remove the lead from the cadence. Let’s test 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? Feel free to share in the comments below.





