Workflow Versioning

A workflow process definition is identified by the process name. Any update to a current definition is saved as a new instance of WorkflowDefinition record. This new record has the same process name but has a new auto asigned id property. Attribute latest(a boolean) in the WorkflowDefinition model identifies if the record is the latest BPMN definition for given process name. This attribute is set to true for the latest copy of the workflow definition. Any update causes the previous active copy to be marked as latest: false (inactive). The new definition becomes active.

Running instances of workflow process are maintained in WorkflowInstance model. This maintains it’s association with definition using id property. Accordingly, already running processes continue to follow the previous flow definition as they are locked on to old process definition id (which is now inactive latest:false). Whenever the new process instance is triggered it picks up new active definition (latest:true) and locks on to the new id.

Once a newer copy is available, it is not possible to force trigger the older definition. Any new executions of this workflow will always take the latest copy. However, already running instances will continue to use older version.