Scheduled actions are gladly used in process automation, and often there is more than one method to do it.
Attendees will learn how many diverse ways can be taken to approach the same business need, each having different consequences, so that the optimal scheme is never the same.
Being aware of the variety of options, they will be prepared to make better design decisions, and select the right solution depending on the use case.
2. #CD2023 @CzechDreamin
2006 - Salesforce fan
2015 - PwC Salesforce Team
2016 - #packleader #dogslife
2019 - Application Architect, 11 certificates
2022 - FlowFest Contest - Top 10
Salesforce Architect
Paweł Dobrzyński
3. Lightning Resources want to notify the Case Owner when a Case is
inactive for 5 days. Every update on the Case restarts the counter. After
5 days of inactivity an Email Alert should be sent to the Case owner.
● Closed Cases do not trigger notifications
● The counter starts after a Case is accepted from the Queue (do not
send notifications to Queue members)
● The delay period (5 days) should be parametrised
The Problem
Notify Case Owner After 5 Days
Notify Case Owner After 5 Days
6. Basic Concept of Time-based Workflow
Entry Criteria Time Offset Deferred Action
Time-based Workflow
Basic Concept
Case updated
→ Reset counter
Case accepted
→ Start counter
After 5 days
→ Send Email
Case created and
assigned to Queue
7. Entry Criteria
Custom Formula Field: Owner Type
= IF ( ISBLANK (Owner:User.Id ), "Queue", "User")
Other options:
● BEGINS( OwnerId , "005") → User
● BEGINS( OwnerId , "00G") → Queue
First Dillema
Recognise the moment
when the Case is assigned to User
8. Last Modified Date
5 Days
IsClosed = FALSE
AND
Owner Type = User
Email Alert
to
Case Owner
Run Immediately After 5 days
Variant A: Time offset defined explicitly
Entry Criteria
Time Offset
Deferred Action
9. It Works! (With Any Object)
Easy to Implement
Hard Coded 5 Days Period
Custom X-Object Formula Field
Advantages and Drawbacks
Drawback Advantage
Record Triggered Flow with Scheduled Path
Record Triggered Flow with Scheduled Path
10. Case Reminder Date
0 Hours
IsClosed = FALSE
AND
Owner Type = User
Email Alert
to
Case Owner
Run Immediately After Threshold
Variant B: Time offset defined in Custom Field
LastModifiedDate +
$CustomMetadata.SupportProcessParameters__mdt.
InactivityThreshold.NumericValue__c
Reminder Date (Date/Time) =
(custom formula field)
Entry Criteria
Time Offset
Deferred Action
11. It Works! (With Any Object)
Easy to Implement
Parametrised 5 Days Period
+2 Formula Fields
Advantages and Drawbacks
Drawback Advantage
Record Triggered Flow with Scheduled Path - variant
Record Triggered Flow with Scheduled Path - variant
12. What would be the highest number
of cases per day
that can be smoothly processed
with the mentioned solution?
Assume Unlimited Edition with 1000 users
Max Daily Cases Limit
Think about it
Think about it
13. 1K Email Alerts per day per user
=> 1 M alerts possible per day
1K time trigger workflow resumes per hour
=> max 24K overdue cases per day
50K waiting flow interviews - divide by 5 days
=> max 10K cases a day
Potential Limits
Think about it
Think about
14. The maximum scheduled-path interviews per 24 hours
is 250,000, or the number of user licenses in your org
multiplied by 200, whichever is greater.
Spring'21 Release Notes
If the flow can be triggered by record updates with
Time Source set to be based on a field value such
as dueDate, and condition requirements are met, the
scheduled path executes at that new time regardless
of whether the scheduled path already executed.
Salesforce Says…
Think about it
16. Schedule Triggered Flow vs Time-based Actions
Entry Criteria Entry Criteria
Logic
Entry Criteria
21 Sep 1:00 am
20 Sep 1:00 am 22 Sep 1:00 am
Logic
Logic
Record
Record
Record
Record
Record
Record
Record
Schedule Triggered Flow
Record
Record
17. Schedule Triggered Flow vs Time-based Actions
Entry Criteria
“ Time Offset “ Entry Criteria
Logic
Entry Criteria
21 Sep 1:00 am
20 Sep 1:00 am 22 Sep 1:00 am
Logic
Logic
Record
Record
Record
Record
Record
Record
Record
Schedule Triggered Flow
the Concept of Time-based Action
Record
Record
Record
Record
5 Days since last update
16 Sep 1:00 am
18. Entry Criteria
Time Offset
Logic
Last Modified Date
earlier than
TODAY - 5 Days
Open Cases
AND
Reminder not sent
Email Alert
to Case Owner
+
Set Reminder Flag
Every day
Retrieve number of days from
Custom metadata Type
Variant A: Time offset inside the logic
Reminder Sent ←TRUE
Set flag to send only once
19. Entry Criteria
Logic
Open Cases
AND
Owned by User
AND
Reminder not sent
AND
Reminder Date
is Now (or earlier)
Email Alert
to Case Owner
+
Set Reminder Flag
Every day
Variant B: Time offset in Entry Criteria
NOW() >= DF22_ReminderDate__c
Case Overdue (Checkbox) =
20. It Works! (With Any Object)
Up to 250K records daily
Variant A: More records processed - NO custom fields
Variant B: Only required records - BUT +2 custom fields
Advantages and Drawbacks
Drawback Advantage
Schedule Triggered Flow
Record Triggered Flow with Scheduled Path - variant
23. It Works!
Out of the Box
Works ONLY for Cases
No Limits (not aware of any)
Yay! or Nay?
Drawback Advantage
Case Escalation Rules
Case Escalation Rules
24. Often there is more than one approach
Each one has advantages and trade-offs
Be mindful about limits
Use Scheduled Path for low record volume and short period
Use Scheduled Flow for larger volume and longer period
Always look for Out of the Box solutions
Key Takeaways
Think about it