workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

Delete Workflow Through IWorkflowRepository

Open matthew-kump opened this issue 3 years ago • 5 comments

We are reading the workflow from the persistence provider after the workflow completes. The IWorkflowRepository provides APIs to get the workflow but no API to delete the workflow. I see there is an IWorkflowPurger but only with an API to purge workflows based on datetime.

If the IWorkflowRepository can have an additional API to delete based on the workflow Id it would make cleaning up workflows a little easier after they complete.

matthew-kump avatar Mar 18 '21 21:03 matthew-kump

How do you determine which workflows to delete and when to delete them?

danielgerlag avatar Mar 24 '21 02:03 danielgerlag

We are running in a cluster environment and listening to the events coming back. So when the workflow completed event is triggered we read the workflow from the persistence to get its data. After reading from persistence we would then like to delete this workflow using its Id and no need to keep it around for long periods of time.

matthew-kump avatar Mar 25 '21 18:03 matthew-kump

We could implement that, but we'd need to do it for every persistence provider, there are 8 of them :)

danielgerlag avatar Mar 26 '21 03:03 danielgerlag

Right now workflow persistence is not automatically deleted at the end of the workflow? Why would an ended workflow need to keep data?

PS: I found there is a purge method https://github.com/danielgerlag/workflow-core/issues/368 Any chance to auto-purge when workflow completed?

diegosasw avatar Jan 31 '24 16:01 diegosasw

Traceability ?!

cjundt avatar Jan 31 '24 18:01 cjundt