I recently wrote a big (200+ lines) List workflow in a SharePoint designer (SPD) 2013. Those of you who have done it know that it becomes hard to maintain the workflow of this size as SPD is not really designed to author large workflows.
After spending a few days, it become common for workflow designer to display validation errors every now and then which happened because SPD kept mysteriously deleting the variable references from the workflow actions.
Finally, i reached the stage where my workflow would not open in text-based designer mode, no matter what i do. It always opened in Visual designer mode with empty visio page.
Exporting the workflow as vsdx file and re-importing as a new workflow didn’t solve the problem.
After some experimentation, I was able to recover my workflow using the following procedure.
- I exported the original workflow as vsdx file using export to visio function.
- I deleted the workflow from SharePoint designer.
- In SharePoint designer, I created a new workflow “temp” and associated with my original SharePoint List.
- New workflow had only 1 line which was logging to history list. I published the workflow.
- On my computer, I renamed the .vsdx file (step 1) to .zip and extracted all its contents.
- In SharePoint designer, I went to navigation windows on left hand side, there i clicked All Files -> WfSvc1 (this is a known folder where SPD stores workflow files)
- In that folder, there were many sub-folders, each having a guid as its name. each folder represents a workflow.
- Went inside each folder and picked the folder which has most recent last modified date for workflow.xaml file (this represents workflow created in step 1)
- From the extracted folder (step 5) I copy pasted the file workflow.xaml to the SPD folder (step 8).
- Restarted SharePoint designer.
- Opened the workflow designer page for the new workflow “temp” and it showed the restored workflow.
- Renamed & published the workflow.
We hope this helps you solve your issue.