Clarification on Workflow Instance Behavior After Workflow Design Update

Hello Moqui Community and @aabiabdallah ,

I’m working on implementing workflows using Moqui’s workflow engine and have a question about how workflow instances behave after a workflow design update.

Here’s the scenario:

  1. I’ve created a Document Approval Workflow with an initial design. This includes steps like “Draft,” “Pending Review,” and “Approved,” with an approval group set to “Managers.”
  2. I created and started an instance of this workflow, and it’s currently running, following the original design.
  3. After that, I updated the workflow design to add a new approval group (e.g., “Supervisors”) in addition to “Managers.”

My question is:

  • Does the update to the workflow design automatically affect the workflow instance that is already running, or will it continue following the original design (with only “Managers” in the approval group)?
  • I understand that new instances will always follow the latest version of the workflow design, but I’m not sure how the system handles existing instances. Do I need to manually update the running instance to reflect the new workflow design, or is there a built-in mechanism for this?

Any guidance or best practices for handling this type of scenario would be greatly appreciated!

Thanks in advance!

  1. Your changes would take effect only if the workflow instance has not yet reached the approval activity (via the activityId & activityExecuted fields). If workflow instance is already in the approval activity then changes will not be picked up.
  2. The workflow component version from Netvariant does not currently handle workflow design versioning well. So it is probably best if you write an SECA to restart the active workflow instance once the workflow is updated.

FYI, I am almost done writing the next version of the workflow component, and I’m hoping to release it before the end of this year. The new release will handle versioning very well, and will integrate better with existing entities. The learning curve and developer experience will also be significantly improved.

3 Likes

Thanks aabiabdallah for your response and your contribution, looking forward to the next version, one requirement we are coming across is the ability to override the Users / Groups when creating an instance, [i.e. while attaching the workflow to a document and initiating the workflow instance],
From a business perspective, we need the same workflow[same review and approval steps] to be applied to different documents [i.e. documents created by different Departments] and the reviewer or approval groups need to be different for these different departments, Having review / approval groups at department level would have been ideal, however i do not believe there is a concept of department in the workflow engine[please clarify if i’m missing something], hence would it makes sense to add capability to override Users/ Groups at the instance level; Pls share if you have come across similar requirements and your suggestions for resolving this.

1 Like

Hi integrines, thank you for your response. I have encountered this requirement before and can confirm that it is handled in the new version of the workflow engine. The current version only supports User, User Group and Initiator crowd types. The new version supports all these in addition to a service register that gives you the ability to load and assign parties dynamically.

3 Likes

Great to know @aabiabdallah will look forward to the new and improved version to an already wonderful contribution.

1 Like