Objective
To configure a Record-Triggered Flow that activates when a SalesWings Tag is created and uses the Alerter Subflow to send the appropriate alert.
Before You Begin
Make sure you have:
Created the Alerter Subflow (see The Alerter Subflow article).
Permission to create and modify Flows.
Knowledge of the tag naming conventions and logic within your SalesWings setup.
Step 1: Create a Record-Triggered Flow
In Setup, go to
Process Automation → Flows → New Flow.Choose Record-Triggered Flow and click Create.
Step 2: Configure the Entry Point
Monitored Object:
Select SW Tag (saleswings__SW_Tag_Segment_Trigger__c) as the triggering object.Trigger Condition:
Configure the flow to run only when a record is created (this corresponds to when a tag is first assigned).Optional Filter by Tag Name:
If you want the flow to run only for certain tags, you’ll need a formula-based filter.The tag name isn’t stored directly on the triggered record, so use a formula to reference the Profile Name.
You can also add additional filters to narrow down when the flow should run.
Optimization:
Select Optimize the Flow for Actions and Related Records.
This ensures that actions (like sending notifications) occur after the record is saved.Tag with formula entry condition:
Step 3: Add a Decision Element
Because a tag can be associated with either a Lead or a Contact, a Decision element is required to branch the logic accordingly.
Add a Decision element named Determine Record Type.
Configure the outcomes:
Contact Outcome:
When the Contact Name field ({!$Record.saleswings__Contact__c}) is populated.Lead Outcome:
Default outcome (no condition required).
This ensures the correct branch executes based on the record type linked to the tag.
Step 4: Add Get Records Elements
Each branch (Contact or Lead) needs a Get Records element to retrieve details about the related record.
Outcome | Object | API Name | Filter Condition | Fields to Retrieve |
Contact | Contact |
|
|
|
Lead | Lead |
|
|
|
Tip: Retrieve only the first record to improve performance.
You may also include a Decision step to evaluate whether the flow should continue (for example, only send notifications for Contacts or Leads with a Grade of A–C).
Step 5: Create Assignment Elements
To keep the flow modular and reduce duplication, use Assignment elements in each branch to populate shared variables that will later be passed to the Alerter Subflow.
Create the following internal variables:
Variable Name | Data Type | Description |
| Text | The ID of the related Lead or Contact |
| Text (Collection) | IDs of the notification recipients |
| Text | Subject line for the notification |
Assignment Block created for Contact branch, targetId is set to the contact id and to alertRecipientIds is added the owner id for the contact. In addtion alertSubject is composed based on fixed text and variables: Tag {!$Record.saleswings__SW_Tag__r.Name} assigned to {!contact.Name}
Optional: Create a alertBody variable for the message content.
For emails, use a Text Template to format content.
You can also include a clickable record link using a formula, such as:
LEFT({!$Api.Partner_Server_URL_600}, FIND('/services', {!$Api.Partner_Server_URL_600})) & "/" & IF({!If_Contact}, {!contact.Id}, {!lead.Id})
This creates a direct link to the related record.
The formula retrieves the url for the record associated with the tag
The tag name and the relatedRecordLink variable are used in composing the alert body
Step 6: Send the Alert
Add a Subflow element.
Choose the Alerter Subflow created earlier.
Pass in the variables you configured:
recipientIds→alertRecipientIdsbody→alertBodysubject→alertSubjecttargetId→targetIdtype→ (emailornotification)
This will trigger the appropriate alert using the logic defined in your reusable subflow.
Step 7: Rejoin the Branches
Once both branches (Lead and Contact) are configured, merge them into a single path:
Click the + button under Set From Lead, choose Connect to Element, and select the Send Alert block.
Both branches will now join into the single Send Alert action.
Your final flow should display both paths converging into the alert subflow.
Result
Your Salesforce Record-Triggered Flow is now configured to automatically send an email or notification whenever a SalesWings Tag is applied to a Lead or Contact.
By using the shared Alerter Subflow, your org gains a unified and reusable system for managing alerts triggered by tagging events.
Related Resources
Have any questions or concerns? Feel free to reach out to your Customer Success Manager!









