To resolve, we had to:
1. Create new workflow on the same list
2. Add dummy if condition to generate xoml.rules file in the new workflow
3. Copy paste the steps and rules from existing workflow to new workflow by opening the files in notepad
4. Publish new workflow, Disassociate the existing workflows and Associate the new workflow
5. Post validation that things are working as expected, rename existing workflow to Workflow_Corrupted or Workflow_Old to clearly identify the same in future.
The solution is also described in another blog here, difference being my preference to rename instead of delete the existing workflow.
Like Samar, what I really want to know is the root cause of what causes the workflow to get corrupted?
My colleague Rajdeep Chakraborthy suggests it’s a Caching issue. It’s a hosted server, and we don’t have access to server to do IIS reset and immediately validate. I am ruling out XML Well Formedness as we are copy pasting existing xml and it works. Wondering what else can cause the issue?
Rajdeep found a simpler solution. Detaach existing workflfow, do required changes, and attach it again to the list.
“Go to List Settings > Workflow settings > Remove a workflow > Select Remove option from the radio button and click OK. Then open the workflow again from SharePoint designer, make some changes and click Finish, so it is associated again.
Your changes should now appear”
The problem is likely to occur if there are running instances of previous version of the workflow. I did not have any pause/delay activity and ideally, all my workflows should have run to completion.