K2 Five 5.1 and Cloud Update 4 introduced a bug where workflow deployment will fail with an error like “Missing reference at activity [ActivityName]"/ This error occurs if you created third/successive manual actions (associated with Task Results) on a user task step in the workflow designer. When you deploy the workflow, the Missing reference error appears.
You see the following error when trying to deploy your workflow (where the activity and item names are specific to your process):
After creating actions from the Task tab (A), switch to the Results/ Voting tab (B). Rename the second and successive Task Results (renaming first Task Result is optional). This will eliminate the duplicate items that cause the deployment error.