Power Automate: How to change the run history from 28 days

By default, Power Automate will retain the history of the runs for 28 days. I don’t have direct confirmation of this, but since 28 days translate to 4 weeks, it’s a nice way of saying that we have (roughly) one month of runs to check the history before it’s deleted, but this could be a problem in 2 situations.

  1. For Flows that run constantly, it could be useful to have less retention so that we can better scan the history and find the things that we need.
  2. For Flows that run every quarter, for example, it can be useful to retain more than this so that we can keep track of older (but relevant) runs.

So it’s quite useful and advisable to control the value so that you can get the information that you need. Also, it’s possible to completely remove the run history in case you don’t need it. I would not recommend this, but for some companies/scenarios it could make sense.

Power Automate will allow you to change the default value of 28 days to a set of defined values (or even disable it altogether), but if you want a custom value, you would need to do a few more steps. It’s not a big deal, and I’ll have the steps below in case you need them.

Both options that I’ll describe are only available to administrators, so, if you’re not one, you would need to contact your Power Automate administrator to do the changes for you. I’ll do my best to explain why in the article, but it’s also good to give them some context for this change since, depending on what you need and the Flows that are running, it may result in more Dataverse storage and corresponding costs to the company.

Let’s start.

Default Options

If you want to change the run history from 28 days to 14 days or 7 days, you can go to:

  1. Admin Center
  1. Click “Manage”
  1. Pick the environment you want to edit.
  1. Click “Settings”
  1. Expand the “Product” section
  1. Search for “Cloud Flow run history,” and you’ll see the default value.
  1. Pick the option that makes sense to you.

If this is what you need, you can stop here. The changes could take a couple of minutes to propagate, and older historical values won’t be displayed, since the values were deleted once they crossed the 28 days.

Let’s take a look in case you need custom values.

Custom Values

If you need a custom value, we would need to go to Dataverse and edit the specific value that contains the “28 days” configuration.

Here’s where you can find it.

In Power Automate, you’ll see in the left menu an option called “Tables.” If you don’t, you can click “More,” and it will show in the list.

You’ll see a list of tables that manage a lot of the features that you use. The list of features are not exclusive to Power Automate, but also Power Apps and other tools. There are a lot of tables, but we need to search for one called “Organization.” To do that, expand by clicking “All” and search for it.

Here’s what you’ll see.

Pick the organization in question.

There are a lot of columns, but we don’t need to show them all. We can click and search for the one that we need.

Search for “Flow Run” (there’s more, but this is enough to find it).

You’ll see the new column with our value.

Quick math will tell us that 2,419,200 seconds are 28 days. So if you want to increase it to, let’s say, 50 days, then you need to replace it with “4320000”.

As the column name indicates, this is a “time to live,” meaning that it’s the time that the value is considered useful before it is deleted.

Quick important notes for custom values

  • The time is in seconds, so be sure to do the right calculations.
  • The value is an integer, so remember to insert it as a number without anything else; otherwise, you’ll get an error.
  • No negative numbers. If you want to delete the values, set the value to 0, or better yet, use the portal option in the previous section.
  • The max value supported is 2147483647, representing 24855 days. The value represents roughly 68 years, so it’s more than enough for most companies and requirements.
  • If you replace it with 0, then Power Automate won’t keep any history, the same as picking “Disabled” in the admin portal (previous section).
  • All values above the limit will be deleted, and they are not recoverable (at least at the time of writing), so be careful editing the value. As soon as the run is older than the value defined, it will be deleted.

The change could take a few minutes to propagate and take effect, and this will not bring back past executions that were removed.

Final Thoughts

The article provides you with, in my understanding, are the 2 best options to solve this problem. They are scalable and can quickly be deployed in the whole organization. Resist the temptation of storing the runs and times yourself. It will require more maintenance work for you and the team, and it will be error-prone. Also, you would need a lot of extra work to deploy it to existing and future Flows.

As to the 28-day value, Microsoft picked it, in my understanding, as a good compromise between the number of days that you will have information and the storage it will use in the database. Keeping the data forever would be overkill, and less than this could also raise some challenges and could not provide enough time for people to analyze the data.

My recommendation is to understand your usage and calculate, roughly, how many runs you will have. It’s a simple number of Flows x runs calculation that can provide you with a baseline to understand if you have room in your Dataverse to save more data or if you need to reduce it. Reducing the value could also be a quick way to reduce costs in case you’re going over your allowance for Dataverse. A simple change from 28 days to 20, for example, could give you the information that you need but save you a lot of space if you have a lot of Flows running constantly, so there’s no magical number that we can define that will work for all cases.

There are a lot of good reasons to increase or reduce the time, but only you can understand them based on your usage.

You can follow me on Mastodon (new account), Twitter (I’m getting out, but there are still a few people who are worth following) or LinkedIn. Or email works fine as well 🙂

Photo by Jed Owen on Unsplash

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Mastodon