workflow-core
workflow-core copied to clipboard
Delete Workflow Through IWorkflowRepository
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.
How do you determine which workflows to delete and when to delete them?
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.
We could implement that, but we'd need to do it for every persistence provider, there are 8 of them :)
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?
Traceability ?!