elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.31k stars 1.16k forks source link

Implement Workflow Definition Retention Settings #412

Open sfmskywalker opened 3 years ago

sfmskywalker commented 3 years ago

Currently, a Workflow Definition has a DeleteCompletedInstances property to control whether the workflow instance should be deleted after completion. It would be good to have more fine-grained control over retention settings of a workflow instance, such as:

smuki commented 3 years ago

It is suggested to add an "archive" setting

sfmskywalker commented 3 years ago

@smuki Do you mean an option to archive a workflow definition?

omid-tansaz commented 3 years ago

This is a great idea, and very much needed to keep the underlying infrastructure as stable and performing as possible.

Screenshot 2021-08-20 at 15 34 41

We have similar functionality in Camunda. The possibility to set a global value and allow overwrite on workflow definition level will give a broader operational control over retention and clean-up of database.

Perhaps, it also makes sense to have an on-demand option to start a clean-up for a specific query on instances, e.g., based on definition, specific version, time range.

sfmskywalker commented 3 years ago

@omid-tansaz That's a really great idea. As a first step, we now have a global setting that is configurable from appsettings / environment variables etc.

As a second step, it would definitely be good to have granular retention policy support on a per-workflow definition basis. Then as a third step we could have the "cleanup" screen you described.