Thursday, October 16, 2008

Running two versions of workflow at the same time

Hi All,

Versioning of Workflow is something very interesting to me. I came across to a scenario where i needed to run two versions at a time.

Let me explain you the scenario and making you understand about versioning in workflow.

Versioning is not directly supported in MOSS and in workflow. you have to manage it. it is not like you place the different version numbered assembly and program start using it. no this is not the case for this. here it is a different trick.

When you build the workflow deploy it in production environment, there might be many number of workflows running in the system. you cannot change them directly because then otherwise it will stop the work. so this cannot be done. all you have to do is you have to make the different versions of it. Now different version does not mean different Version number because that will also not make any sense as it will be entirely a new workflow because you will have to change the File Assembly reference where ever taken in the program like workflow.xml file or any other association and initiation form. so this cannot be done.

So what is the solution to have two different versions of workflow running at the same time?

You have several business rules running in workflow and if workflows are already triggers in production environment you cannot change them. you might have several corrections and change in the existing workflow. but that will then affect the existing workflow which should not be actually.

When you go to the list settings or document library settings and then workflow settings, you can see your attached workflow for that list or document library. when you click on the remove workflow, you will find three options. (1) - new (2) -No new instance (3) remove workflow. Here No new instance makes sense. it means currently attached workflows will not trigger now onwards on this list. here there is only one limitation is that you cannot have the same name of workflow to have two instances running for it. so you need to change the name only. so in workflow.XML just change the name of the workflow and then redeploy it. so hence you will have that workflow as well. so select that workflow add it to the same list or document library and then allow it to run a new instance.

so here what we did is we stopped the already running instance of the workflow and we've attached a same workflow with only name change. so all existing workflow will not get affected and from now onwards new workflow will only gets triggered which will have new business rules or any change.

That's it. your job of running two different versions of workflow is done.

No comments:

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to