Sub topic 10
Replacing time-dependent actions with scheduled paths
This chapter assumes you have read the earlier chapters on Workflow Rule and Process Builder anatomy and on record-triggered flows. You should know how a flow's Start element, entry conditions, and after-save optimization work. You should also be comfortable with date fields and basic formulas.
Workflow time-dependent actions and Process Builder scheduled actions both mean "do this later, relative to a date." In a record-triggered flow, the equivalent is a scheduled path. A scheduled path is a branch from the Start element that waits for a time offset and then runs its elements. The path is not a one-to-one copy of the old tools, so this chapter focuses on where the behavior differs.
How the old tools schedule work
A Workflow Rule can attach a time trigger to its actions, such as "7 days before Close Date" or "30 days after Rule Trigger Date." Salesforce places the action in the time-based workflow queue. If the record is edited so that it no longer meets the rule criteria, the queued action is removed.
Time-dependent actions are only available when the rule is evaluated "only when a record is created" or "created, and any time it's edited to subsequently meet criteria." They are not available for "every time a record is created or edited."
A Process Builder process schedules actions from a criteria node. Each action group runs immediately or at a time relative to a date field on the record or to the time the process ran. Behavior when the record later changes depends on how the criteria node is configured, so do not assume it matches Workflow Rule behavior.
What a scheduled path is
You add scheduled paths in the Start element of a record-triggered flow. Every such flow has a Run Immediately path. Each scheduled path you add is a separate branch with its own elements.
For each scheduled path you set:
- Time source: a date or date/time field on the record, or the time the flow was triggered.
- Offset: a number and a unit (minutes, hours, days, or months).
- Direction: before or after the time source.
- Batch size (optional): how many records run together when many are due at once.
Scheduled paths are only available in flows that can run after the save. A flow set to "Fast Field Updates" (before-save) cannot have them. If the old automation updated a field later, you need an after-save flow with a scheduled path.
Mapping old settings to path settings
| Old automation setting | Scheduled path setting |
|---|---|
| Workflow: "7 days before Close Date" | Time source: CloseDate field. Offset: 7 days. Direction: before. |
| Workflow: "30 days after Rule Trigger Date" | Time source: the time the flow triggered. Offset: 30 days. Direction: after. |
| Process Builder: "3 days after CreatedDate" | Time source: CreatedDate field. Offset: 3 days. Direction: after. |
| Several time triggers on one rule | One scheduled path per time trigger. |
| Immediate and scheduled actions in one rule | Immediate elements on the Run Immediately path, the rest on scheduled paths. |
| Workflow queue entry | A pending scheduled path run for that record. |
Worked example
Suppose a Workflow Rule on Opportunity has this configuration:
- Criteria: the opportunity is open.
- Time trigger: 7 days before Close Date.
- Action: send an email reminder to the owner.
Build the replacement like this:
- Create a record-triggered flow on Opportunity. Trigger it when a record is created or updated, with the entry condition
IsClosedequals false. Choose "Actions and Related Records" so scheduled paths are available. - For run frequency, choose "Only when a record is updated to meet the condition requirements." This matches the old "created, and any time it's edited to subsequently meet criteria" setting.
- In the Start element, select Add Scheduled Paths. Name the path
Reminder_7_Days_Before_Close. Set the time source toCloseDate, the offset to 7 days, and the direction to before. - On that path, add a Decision element that re-checks the situation (see the next section), then an email action.
Differences that cause bugs
Do not assume the path cancels itself
The old Workflow queue removed pending actions when a record stopped meeting the criteria. Do not assume a scheduled path behaves the same way in every case. Check the current Salesforce documentation for your release, and test it in a sandbox by changing the record after the path is queued.
The safe design is to re-check the conditions when the path runs. Put a Decision element first on every scheduled path, with a formula resource like this:
AND(
NOT({!$Record.IsClosed}),
{!$Record.CloseDate} >= TODAY()
)The path then does nothing if the opportunity closed or its date moved while the run was waiting.
Records that already qualify are not scheduled
A flow schedules paths only when a record triggers it. When you activate the flow, existing open opportunities do not get a pending reminder. They are scheduled only the next time they are saved and meet the entry conditions. Workflow actions already in the queue belong to the old rule, not to the flow.
Past dates and timing
If the computed time is already in the past, such as a reminder 7 days before a Close Date that is only 3 days away, the path runs as soon as the system processes it. It does not skip. Decide whether that is acceptable, and add a date check in the Decision element if it is not.
Scheduled paths are processed asynchronously. Do not rely on them running at an exact minute.
Running user and limits
A scheduled path does not run as the user who saved the record. It runs as the Automated Process user, or as the Default Workflow User if your org has set one. Fields like $User or "last modified by" in your formulas will therefore not point to the person who edited the record. Use the record owner or a field on the record instead.
Scheduled path runs also count toward a daily limit on asynchronous flow executions. If you replace a high-volume time trigger, such as one that fires for every Case, check the current limit in Salesforce's flow limits documentation before you cut over.
Cutover for pending actions
Pending time-dependent actions are in-flight work. Before you deactivate the old automation:
- Open Setup and look at the Time-Based Workflow monitor to see which Workflow actions are still queued. For Process Builder, review the pending scheduled actions for each process.
- Decide for each one whether to let it finish, recreate it, or drop it.
- If you must recreate it, plan a controlled save of the affected records, such as a data load that touches a field in the entry conditions. This schedules the flow's paths for them. Test the load in a sandbox first, because it also fires other automations on those records.
- Activate the flow, then deactivate the old rule or process. Avoid a period when both are active, because both would send the reminder.
Exercise
A Workflow Rule on Case has the action "Escalate priority 2 days after Rule Trigger Date," with the criteria "Status is New." A teammate builds a record-triggered flow with a scheduled path of 2 days after the trigger time, but it uses Fast Field Updates and updates the Priority field on the path. List two problems with this design and how to fix each.
Show answer
First, scheduled paths are not available in a before-save flow, so it must be an after-save flow ("Actions and Related Records"). Second, nothing stops the path from escalating a Case whose Status changed to something else during the 2 days. Add a Decision element at the start of the path that checks Status is still New before the Update Records element. Also set the run frequency to "Only when a record is updated to meet the condition requirements" so that the old "edited to subsequently meet criteria" behavior is preserved.