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

Store workflow definitions in Persistence store rather than memory?

Open softwareguy74 opened this issue 7 years ago • 7 comments

It seems like the default behavior is to require workflow definitions to be loaded into memory.

My concern here is unnecessary memory usage JUST to maintain a list of registered workflows, which can get quite large in a large production environment, even when not in use. Instead, could it be changed to where workflow definitions (along with each version) are persisted in the optional persistence store? That way, when a workflow is started (or continued, such as after a service failure), it will load the definition required on the fly from the persistence store just for that execution, and then release it from memory immediately after?

softwareguy74 avatar Jun 03 '19 12:06 softwareguy74

Currently this is not supported out of the box... you could create a custom implementation of IWorkflowRegistry that persists them externally. FYI, I am currently building a new project that uses WorkflowCore to build a stand-alone workflow server that can be deployed to Kubernetes, and this will drive many more features for WorkflowCore.
I will keep you updated on this.

danielgerlag avatar Jun 04 '19 03:06 danielgerlag

The server project sounds wonderful! But could it be Docker as well? And will it be able to use RabbitMQ and/or Redis for multiple node HA cluster?

softwareguy74 avatar Jun 04 '19 11:06 softwareguy74

Absolutely, that is the main idea.

danielgerlag avatar Jun 04 '19 14:06 danielgerlag

Any approximate eta on a first pass of the server option? We were attempting to build our own around workflow core but would much rather wait for your implementation. Thanks!

softwareguy74 avatar Jun 14 '19 12:06 softwareguy74

I have a basic working proof of concept, but there are still many things that I want to refine before publishing it. My goal is for 2 or 3 months from now.

danielgerlag avatar Jun 15 '19 14:06 danielgerlag

Hi @danielgerlag , if I create a custom IWorkflowRegistry, how can I determine when is the proper time to release the workflow definition? I don't know exactly when the workflow has finished (I mean, after the last step there are some other internal logic going on right? and maybe removing the definition can break that logic). Also, why we need to care about loading the definition in order to be able to run a workflow? doesn't should the StartWorkflow() on WorkflowController check if the definition is already loaded and load if it not and proceed?

leobel avatar Oct 24 '19 19:10 leobel

Closing as not planned — this has been open for several years without recent progress. Please open a new issue if this is still relevant on a current Workflow Core release.

wfcore-manager avatar Aug 22 '26 18:08 wfcore-manager