In this article, we focus on configuring a Flow to automatically close Opportunities after a specific date to maintain a clean and accurate sales pipeline. As an example, we will demonstrate how to set up automation that updates Opportunities based on their creation date or another relevant date field to prevent outdated records from impacting pipeline visibility.
a. Either a scheduled Flow running every day, querying the Opportunities to close into a collection, and closing this list of Opportunities
b. Or a Scheduled Path in a record triggered Flow, setting up a specific closing path, into a Flow that is fired when the Opportunity is created
Option 1: Build a Schedule-Triggered Flow running every day
a. Go to Setup, click on the Object Manager tab, look for Opportunity object in the object list, and click on the Opportunity link
b. Click on Fields & Relationships from within the left pane
c. Click on New button
d. Select Formula data type, and click Next
e. Select Checkbox return type, choose Field Label and API Name and click Next
a. For example, this first Formula will return True for all Opportunity records whose CreatedDate is older than 60 days
NOW() > CreatedDate + 60
b. For example, this second Formula returns True for all Opportunities whose CloseDate is in the past
TODAY() > CloseDate
a. Check Syntax to validate that there is no syntax error, and Click Next
b. Grant access to the proper Profile or Permission set according to your configuration. Make it at least visible for the System Admin profile
c. Click Next add the fields to the relevant layouts if required. This step is optional, and you may skip adding the fields to the layouts if not needed
d. Click Save
a. Go to Setup, type Flows in the Quick find box
b. Click New Flow
c. Click on View All Automations below Scheduled Automations
d. Select Schedule-Triggered Flow
e. Either fill in the detail page, on the right of the screen, or click Set Schedule. Set the Flow to run Daily
f. Then Click On + Choose Object and choose Opportunity object. Add the filter on the new Boolean field we have just created. It will restrain the Scheduled Flow to execute only on the subset of to be expired Opportunities
g. In our case, the Start element will only filter open Opportunities, not closed, with the proper Boolean flag where the Expiration Status is True
h. Click on the + between the Start and End blocks, and select the Update Records element
i. Configure the Assignment / Update action you want to achieve for the concerned records here the Status is switched to Closed Lost
j. Activate the Flow
k. Wait for the Scheduled Flow to run to see if your concerned Opportunities have been updated
Option 2: Add a Scheduled Path on a Record-Triggered Flow running on Opportunity record save
a. Go to Setup, type Flows in the Quick find box
b. Click New Flow or use an existing Flow on the same object, if one is adapted for such usage
c. Click on View All Automations Below Triggered Automations
d. Select Record-Triggered Flow
e. Select Opportunity as a triggering object, when a record is created or updated. Optimize the Flow for Actions and Related Records to be able to configure a Scheduled Path on it
f. Click on the + Add Scheduled Path which is optional to configure a Scheduled Path within your Record-Triggered Flow. A Run Immediately label is added to the current path, and a second branch is created below the Start element
g. Rename the new Scheduled Path branch to make it clear that it concerns a Scheduled Path, for example, 10 days after CloseDate
h. Then, choose the reference date, among all these that are present on the triggering record, and the Flow interview date
i. Then select the negative or positive offset to apply to this reference date, which in this case is10 days after the triggering record CloseDate
j. In this example, I need to add actions on each one of my branches, to be able to save this Flow. It could be any relevant actions or Flow element to leverage on Opportunity creation / update use cases
k. For example, on the Run Immediately branch, I have added a Post to Chatter action
l. The message of this action is set with a simple text-typed Formula resource, that should be created from the resource pane. click on the Toggle Toolbox icon > New Resource > Select Formula as a Resource Type
m. The triggering Opportunity id can be used as the record target id for the Post to Chatter action
n. In the second branch, running asynchronously, I have added an Update Record element to update the Stage of the triggering Opportunity
o. As this asynchronous branch content can run a few minutes, hours, or days, after the record has been saved or updated, do not forget to test your record before running the actions configured to run asynchronously. Here, only an Update Records element in the case below, 10 days after the theoretical ClosedDate is over, the branch considers only open Opportunities by setting Filter Conditions to ensure the triggering Opportunity is not closed, then updates their stage to Closed Lost
p. Save and Activate the Flow
q. To validate that the Scheduled Path is well considered, create a sample Opportunity
r. See first if the record has got a new Chatter message in its Chatter tab
s. Then check that the Scheduled Path is well planned 10 days after the Opportunity’s CloseDate. Navigate to Setup > Environments > Monitoring > Time-Based Automations in the Setup Quick Find Box
t. When you click the Search button, you will see a table displaying all Time-Based Automations currently in progress and waiting to run. Filters may or may not be applied depending on your instance and the number of Time-Based Automations running
u. Here, you can check that the Scheduled Date, for the Scheduled Path execution, is planned 10 days after the Opportunity Close Date
___________________________________________________________________________________________
Written by: Eric BURTÉ | Forum Ambassador
Based in France, Eric Burté is Head of Salesforce and AI, within DEVOTEAM Group. As a Salesforce Expert Director, Salesforce Application and System Architect, 19 x Salesforce certified, and 2025 Agentblazer Legend, Eric works with Salesforce project teams, to support them on the design, architecture, build and delivery of their Salesforce projects, and works with his clients in assessment project context, Salesforce ‘Center of Excellence’ teams management, or Design Authority approach implementation.
Answers Leader in Trailblazer Community, Eric has been designated as a Trailblazer Community Forum Ambassador in 2024 & 2025.
Submissions reflect only the opinions of the user who made available the Submission and not the opinions of Salesforce, regardless of whether the user is affiliated with Salesforce, and may contain or constitute products, services, information, data, content and other materials made available by or on behalf of third parties ("Third Party Materials). Salesforce neither controls nor endorses, nor is Salesforce responsible for, any Third Party Materials, including their accuracy, validity, timeliness, completeness, reliability, integrity, quality, legality, usefulness or safety, or any applicable intellectual property rights. Any Submissions made available through any message board or forum in response to posted questions, or that otherwise purports to answer any questions, including any questions about Salesforce or Programs, are made available for your general knowledge only and should never be relied upon as answers to your specific questions (even if an answer is marked as a “best” answer or with any similar qualifications). You should always contact Salesforce support for answers to your specific questions. Salesforce has no control over Submissions, and is not responsible for any use or misuse (including any distribution) by any third party of Submissions.
If you have questions, tap into the wisdom of our entire Trailblazer Community here: https://trailhead.salesforce.com/trailblazer-community/feed
005315440

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.