Not all changes to a workflow require versioning. It is important to understand what does and does not so that workflows can be versioned appropriately. It is important when working with workflows to version them appropriately. This allows in-flight/in-progress workflows to continue successfully to resolution along their current path, while getting all new submissions to follow the new workflow process.
Changes that require versioning:
- Updates at the beginning (or before any of the deferred nodes) of a workflow (such as a new node) that are then referenced later in the workflow.
- Updates to versions of nodes where there are new outputs that are then referenced later on.
Essentially anything that adds a new reference, including new joins or junctions, are a consideration.
Note that workflows without any deferred nodes or routines are unlikely to have any in progress items at any particular time and no it is safer to not version those, though the larger they are the less safe it is.
Versioning trees is quite simple. You clone the tree and save the clone with a new name.
It is critical that when you are working with the full Kinetic Platform suite and not running trees for other sources, that you keep the original tree name for the new version. This means the clone is your backup. You clone, save as the new name, ex. Submit_v1, and then work on the Submit tree to create your new version.
This is likely the case from other sources as well. This is because the webhooks reaching out to the workflow system are looking for a particular path name and that path name includes the tree name, so the tree name must stay the same.
Versioning routines is slightly more complicated. The ideal case would allow your workflows that were already in process in that routine to continue and finish, would allow new workflows to enter the new routine, and would not require you to touch everywhere there is a routine v1 node and replace it with a routine v2 node. Well, there is actually a solution that allows for that. You can create your separate v2 of your routine (likely from cloning and modifying v1), and then you do the following:
You disconnect my start node from the existing workflow, leaving everything else about the existing workflow intact. Then you add the V2 routine and connect the start node to the V2 routine, passing the inputs from the V1 routine into the V2 routine. Then once the V2 routine returns, you also return that output from the V1 routine.
Once you have a v3 routine you do exactly the same, this prevents adding depth when adding versions.