6207 Views
3 minutes read
Categories
Microsoft 365 Office 365 Power Automate SharePoint

Export SharePoint Designer 2013 Workflow XAML

Beginning with SharePoint 2013 workflows are fully declarative irrespective of whether they are designed using SharePoint Designer or Visual Studio. Declarative indicates that no longer the workflows are authored in code and then compiled into managed assemblies.

Instead workflows are described in Extensible Application Markup Language (XAML) and interpreted at the execution time for activities and sequences. Being the native building blocks, XAML representation of workflows comes real handy for developers in situations like below:

  • Advanced debugging of workflow
  • Copy of workflow between sites with some modification
  • Integrating workflow in SharePoint app where workflow is not necessarily attached to any list within the app.

However while working with SharePoint Designer 2013 there is no direct method to export the workflow XAML and it is not intuitive. In this article we will explore one undocumented method to export a workflow in its XAML form.

The Process

Launch the SharePoint Designer 2013 and connect to a SharePoint 2013 site. The site can belong to On Premise SharePoint 2013 installation or to Office 365. Once connected select an already existing workflow or create a new workflow.

xaml 1

Figure 1: Select a Workflow

Next save the workflow as template by clicking on the “Save as Template” button in the ribbon. This will save the workflow as WSP package and save in the Site Assets library under the current site. The file will be saved by the same name as that of the workflow.

XAML 2

Figure 2: Save as template

Open the site in the browser and select “Site contents” from under Settings icon. Then select Site Assets from the app list. You should be able to find the WSP file in there.

XAML 3

Figure 3: Workflow WSP file in Site Assets

Download a copy of the file to your local desktop. Then change the extension of the file from WSP to CAB. This will change the file icon to that of a zip file. Extract the file using Winzip or WinRAR. Navigate within the extracted folder and you will find a folder structure similar to as shown below:

XAML 4

Figure 4: Workflow.xaml location

You will find the workflow.xaml file in the location as shown in the picture Figure 4. You can open up the XAML file in any regular XML editor for review and update.

XAML 5

Figure 5: Workflow.XAML

Happy coding!!

Pankaj Bose

About Pankaj Bose

Pankaj is responsible for offshore project delivery from Netwoven’s India operations. Pankaj has over 16 years of experience in software development and consulting with various organizations. He has been with Netwoven for over 4 years leading Netwoven’s Search practice. He is a frequent speaker at SharePoint and Search conferences.

Prior to joining Netwoven, Pankaj provided technical consulting services and development expertise in the field of Enterprise Content Management and Enterprise Search. He led the successful implementation of ECM for many Fortune 100 organization like Apple, Sun Microsystems (now Oracle), Lockheed Martin etc. Some of his applications won prestigious awards in the US.

Pankaj holds a Masters in Technology from Indian Institute of Technology, Delhi.

LinkedinTwitterFacebook

Leave a Reply

Your email address will not be published. Required fields are marked *