Stop Agentforce Dev Orgs From Expiring

Have you ever discovered—often too late—that the Salesforce Dev Org you worked so hard to set up has suddenly expired? You spend hours or even weeks configuring a demo, exploring new features, or practicing your development skills, only to log in one day and be greeted by an expiration notice. It happens more frequently than we realize, especially given that new specialty and trial orgs sometimes have shorter lifespans. A one-month trial here, a week-long environment there—before you know it, all that effort can vanish without warning.
Dev Orgs Don’t Last As Long As They Did In The Past
In the past, standard Salesforce developer orgs might have lasted six months or even a year. Then came specialized developer orgs for different industries, along with new trial orgs that offered limited time frames. Eventually, Data Cloud and now Agentforce Dev Orgs arrived. While these are fantastic for exploring cutting-edge features—like real-time data capabilities and new AI solutions—they usually come with a much shorter shelf life. Salesforce has recently announced new Agentforce Data Cloud developer orgs that expire after 45 days. It is indeed better than just a week, but the clock is still ticking.
Salesforce does send notification emails to remind users that their developer orgs are nearing expiration. However, these alerts can sometimes blend in with other automated messages, or they may land in spam folders. Whether you are a seasoned developer juggling multiple environments or a newcomer trying to learn the platform, it can be easy to lose track of which org is about to expire and which is still active.
The Challenge: Tracking Expiration Before It’s Too Late
Consider how critical these development and testing environments can be. They allow you to:
- Build proof-of-concept solutions without risking a live production org.
- Experiment with new Salesforce features or packages in a controlled setting.
- Demo functionality to colleagues, stakeholders, or potential clients.
If one of these invaluable environments suddenly expires, you may lose crucial configurations, data setups, and more. The result is wasted time and frustration as you scramble to recreate everything in a fresh org.
While the standard practice is to keep track of all login details in a password manager or a spreadsheet, not everyone is consistent with that. Even if you meticulously store your credentials, you might not remember to log in regularly to reset the expiration countdown. That is exactly why an automated reminder can save you from this common pitfall.
Introducing a Schedule-Triggered Flow to Send Automatic Warnings
The solution is surprisingly straightforward: create a scheduled trigger flow in Salesforce that checks for inactivity in your Agentforce or Data Cloud developer org. If the system sees that you have not logged in for a certain number of days (in this case, 40 days), it sends you an email alert. This way, you will have time to log in and reset the expiration clock before day 45 sneaks up on you.
You can build this flow yourself fairly easily, or you can install an unmanaged package I have created. This package contains a flow that runs each night to review login history. If the flow sees that your last login is older than the set threshold, it pings your email to remind you to hop back in. This single step could spare you hours of rebuilding or, worse, losing all the work you have done.
Below is a walkthrough of how to set up this scheduled flow. You will also find tips for customizing it to your specific username if you have changed it from the default (which normally ends with @agentforce.com).
Step 1: Confirm Your New Developer Org’s Basics
First, head to the Setup menu. Check your username and confirm that it ends with @agentforce.com. Confirm that your email address is accurate. You can also check that the Org URL includes “org farm,” indicative of the new Agentforce and Data Cloud Dev Orgs.
Agentforce and Data Cloud developer orgs often come with constraints—particularly around how many AI requests you can make. That said, for most learning or exploration scenarios, these limits will not be prohibitive.
Step 2: Build or Install the Flow
If you opt to build the flow from scratch, you will create a Scheduled Trigger Flow that runs once daily. Set it to run near midnight to ensure it checks your org’s login activity for that day.
In this flow, you will do the following:
- Define a constant (e.g.,
usernameSearchString) that points to any user whose username ends with@agentforce.com. - Query the User object to find any records whose Username matches that constant. In most new developer orgs, there should only be one match.
- Retrieve the LoginHistory for that user, sorting records in descending order by login time. This step ensures you get the most recent login date.
- Compare that login date to the current date minus 40 days. If the last login is older than 40 days, proceed to send an email alert. If it is not, the flow does nothing.
If you have changed your default username, you will need to adjust your constant to match the portion that identifies your user. Otherwise, the out-of-the-box approach (i.e., checking for @agentforce.com) will work fine.
Step 3: Configure the Email Alert
Within the flow, you will set an Action to send an email. This email typically goes to the address tied to the user record (the one you provided when creating the developer org). The email is straightforward but crucial. You might specify a subject line like “Warning: Your Developer Org Will Expire Soon” or something equally attention-grabbing.
For the email body, you can create a Text Template. Include pertinent details such as the last login date, the username, and a short explanation that logging in again will reset the expiration countdown. Include enough information that you can quickly locate the correct credentials in your password manager. A typical text template might read:
Warning – Action Needed! Developer Org Nearing Expiration
Body:
Hello, This is an automated reminder that your Agentforce developer org, associated with username {!User.Username}, is nearing its 45-day expiration window. Your last login was {!LoginHistory.LoginTime}. To prevent expiration, please log in as soon as possible.
Thank you!
You can, of course, modify the text to your preference. The main goal is to ensure you see this email and know exactly which org requires attention.
Step 4: Activate and Confirm the Flow
When you install the flow template from the unmanaged package, it might come pre-activated. If you build one from scratch, remember to Activate it. Then, check under Scheduled Jobs in Setup to confirm the flow is listed to run nightly.
If everything is configured correctly, you will receive an email once your last login date surpasses 40 days. At that point, you know you have a five-day grace period before the 45-day expiration hits—plenty of time to jump back into the org and keep it alive.
Step 5: Enjoy Peace of Mind
That is it! No more frantic searches through your password vault only to discover your demo is gone. The next time you spin up a new developer org for Data Cloud exploration, build this simple safety net. You will save yourself the frustration of expired orgs and lost work.
Install the Unmanaged Package to Leverage the Scheduled Flow
The link for the unmanaged package is as follows:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tgK0000000TOb
Bonus: How To Add the Org URL to the Email
One of our YouTube subscribers asked whether the Org URL can be added to the email. This is a very good suggestion, and I am planning on adding it to the unmanaged package in the future.
If you want to add the URL, please follow these instructions:
- Create a URLFormula resource. Your formula will read as follows:
LEFT($Api.Partner_Server_URL_630, FIND( '/services', $Api.Partner_Server_URL_630)) - Go to your email body Text Template and view source (view as Plain Text), and replace the username resource {!Get_User.Username} with the following:
<a href="{!URLFormula}">{!Get_User.Username}</a>
This will make the username value on the email clickable. Once the user clicks on the username, they will be taken to the login page for the Org.
Final Thoughts on Agentforce Data Cloud Developer Orgs
These new developer environments are wonderful for trying out the latest Salesforce innovations. You can test specialized features that may not be available in a more traditional developer edition. The big trade-off is their comparatively short expiration period. Forty-five days is enough for many use cases, yet it is still short enough that forgetting just one login can lead to losing your entire environment.
With the scheduled trigger flow approach, you can have the best of both worlds: a flexible, feature-rich developer org with a relatively short lifespan, backed by a reliable reminder system preventing accidental expirations.
Watch the video on YouTube for additional details 👇
Explore related content:
Salesforce Summer ’25 Preview: Major Flow Changes to Watch For
How to Get Your AI-Powered Enhanced Developer Org with Agentforce and Data Cloud

Great idea.