temporalio / temporal

Temporal service
https://docs.temporal.io
MIT License
12.04k stars 849 forks source link

Allow retention period to be set per workflow completion type #2617

Open tsurdilo opened 2 years ago

tsurdilo commented 2 years ago

Is your feature request related to a problem? Please describe. Currently setting retention period does not take in account workflow completion type. For example users would like to set a different retention period for "Completed" vs "Failed" workflows.

Describe the solution you'd like Allow to set workflow completion type when updating retention for a namespace in tctl namespace update --retention X

Ryan-Thomas commented 2 years ago

Main reason we want this is that we set a retention period of 7 days, but it would be very helpful to have a longer retention to debug failed workflows without needing to store all the successful ones for longer.

It was also suggested that you make it possible to set retention period as part of WorkflowOptions on each workflow. We run Temporal as a multitenant service and we wouldn't want a team hogging the service's resources by setting some extraordinarily long retention for their own workflows. If you decide to allow setting retention on WorkflowOptions, it would be great if there is some server level config option that lets us enforce that WorkflowOptions retention doesn't exceed the namespace level default retention.

We don't really need to be able to set retention period in WorkflowOptions, we are mainly just interested in setting retention by completion type.

mxvsh commented 1 year ago

any update?

mittalsuraj18 commented 9 months ago

Hi, we too are interested in knowing if this can be done.

msainty commented 1 month ago

This would be interesting in regards to data governance e.g. some data you can keep for longer should it be related to something that is purchased. However you may trigger a workflow and only want to retain this data for a few days as something was not purchased. This flexibility would be very useful rather than having a set retention period for everything.

yosefrev commented 1 month ago

Hi, this feature would be really helpful for us as well. Thanks!