Sub topic 11
Asynchronous and Scheduled Paths
This chapter assumes you can build a basic after-save record-triggered flow. You should also know what entry conditions are and what a database transaction is. Everything here applies to after-save flows only. Before-save flows cannot use these paths.
Why add paths after the save
A normal record-triggered flow runs in the same transaction as the save. That has two costs. The user waits for the flow to finish, and the flow shares governor limits with everything else in that transaction. Some work does not belong there. Examples are callouts to external systems and actions that should happen days later.
Flow Builder lets you add extra paths to the trigger element. Each path runs after the main flow, so the main logic does not wait for it.
| Path | When it runs | Transaction |
|---|---|---|
| Run Immediately | In the save transaction | Same as the save |
| Run Asynchronously | Shortly after the save commits | Separate transaction |
| Scheduled Path | At a set time offset | Separate transaction |
Run Asynchronously
The Run Asynchronously path starts after the original transaction commits successfully. It runs in its own transaction with its own governor limits. Use it when the work is slow or must not block the user.
Common uses:
- Calling an external service through an action that makes a callout.
- Processing that could approach the limits of the original transaction.
- Work that should not roll back the original save if it fails.
The last point matters. If an asynchronous path fails, the record save has already committed and stays saved. A failure in the Run Immediately path rolls back the whole transaction instead.
Scheduled Paths
A scheduled path waits for a time you define, then runs. You set the time relative to a date on the record. You can choose the record's trigger time, such as when it was created or updated, or any Date or Date/Time field on the object. You then add an offset in minutes, hours, days, or months, before or after.
For example, on an Opportunity you could create a follow-up Task 3 days after the Close Date.
Flow: Opportunity - Closed Won Follow-up (after-save)
Object: Opportunity
Trigger: A record is created or updated
Entry condition: {!$Record.StageName} = "Closed Won"
Scheduled Path: Three Days After Close
Time source: Opportunity.CloseDate
Offset: 3 Days After
Create Records element (object: Task)
Subject: Check in with customer
WhatId: {!$Record.Id}
OwnerId: {!$Record.OwnerId}The path starts from the record's values at run time. Flow runs the scheduled path as the Automated Process user, so check what that user can access.
How scheduled paths re-check the record
Flow does not blindly run a scheduled path. Before it runs, it checks whether the record still meets the entry conditions. If the record no longer matches, the pending path is cancelled. If the time source field changes, Flow reschedules the path to the new time.
Take the Opportunity example above. If someone moves the stage away from Closed Won before the third day, the Task is not created.
Limits and common errors
- Using them in before-save flows. Asynchronous and scheduled paths are not available there. Switch the flow to Actions and Related Records.
- Expecting exact timing. Scheduled paths run on a best-effort basis. Do not rely on them for to-the-minute accuracy.
- Forgetting the user context. The Automated Process user may lack access that the original user had.
- Assuming rollback. An error in an asynchronous or scheduled path does not undo the original save. Add fault paths so failures are visible.
- Using a time source that is empty. If the date field is blank, the path has nothing to schedule from.
Exercise
A flow must send data to an external system when an Opportunity becomes Closed Won, without slowing the user's save. If the external call fails, the Opportunity must stay saved. Which path do you use, and why?
Show answer
Use the Run Asynchronously path on an after-save flow. It runs in a separate transaction after the save commits. The user does not wait, and a failure there does not roll back the Opportunity.
Exercise
A Task is scheduled 3 days after the Close Date. On day 2 a user changes the stage from Closed Won to Negotiation, and the entry condition requires Closed Won. What happens to the Task?
Show answer
It is not created. Flow re-checks the entry conditions before running a scheduled path, and the record no longer meets them, so the pending path is cancelled.