Workflow versions attached to the records

Ruchi19
Mega Contributor

I wanted to confirm, whenever workflow changes are made and new version is published, it gets attached to the new records only and old records still remain associated to older versions of workflow. Is that understanding correct?


I also wanted to know how to find out which versions of the workflow is associated with a specific record?


and how to apply new published version of workflow to the existing records if that's possible.


Thanks for your inputs.


2 REPLIES 2

adiddigi
Tera Guru

You are right. The new version of the workflow will NOT be associated with the old records. There is really no way(at least none that I know) to find which ones have the old ones, or which one refer to new ones, except that you will have to manually open them and see the contexts.



The way in which you will have to apply the new version is by cancelling the old Workflow and attaching the new workflow by Script.



Workflow Script - ServiceNow Wiki should give you a good idea as to re-start a workflow.


seanpmcclean
ServiceNow Employee
ServiceNow Employee

Abhiram has the right idea:Workflows are actually broken into


- "Version" (think template or definition file)


- "Context" (think copy associated with ticket / record / etc)



When the conditions for the Version are met, SN copies a record into the Context table, associating that context with the ticket / record / etc.   If you are looking at a workflow - you can easily tell the difference between Context and Version:


Version will have the title in the center and no color coding of Activities:


workflow version.jpg




Context will have the timestamp to the left and color coding:



workflow context.jpg



If you modify the Version and want existing contexts to be changed, again, Abhiram is right in the main:   you would need to dis-associate the existing contexts - deleting or removing them in some way - and then finding a way to get those records to pick up the new Version and make copies in the context table with the new version.



There is an article on how to end an existing workflow context that might help you with the first part:


Administering Workflow Contexts - ServiceNow Wiki


(basically navigate to it via workflow context and then select the "cancel" related link)



Getting those records to pick up the newly updated Workflow version might be a bit trickier.   you might do it by script, OR possibly set the workflow Version conditions so broad that the "orphaned" records would pick the new version up, and re-generate contexts.



I believe there are some great articles about this by Michelle Corona



Hope this is helpful - will ask you also to mark Abhiram Diddigi's response as helpful too.