Automating Deployment

  • 30 March 2020
  • 4 replies
  • 19 views

Userlevel 6
Badge +13

Hi All,

I had a quick scour of the forums for this and I didn't find anything obvious, maybe I'm looking for the wrong terms.

 

Anyway, in my current contract, our client has always used Powershell to automate the deployment of Nintex assets. This worked for us as our sites follow a framework so certain workflows are always deployed to all sites. This would be tiresome to do manually.

Anyway, whilst Powershell is great, it's also a skill that someone has to possess in order for it to be used/maintained.

So when I was studying the workflow.asmx service, and noticed the options for publishing workflows, I thought I'd run a little side project to see if I could simplify the process of automated deployment of workflows and it works, it's also quite simple.

I have a list, a library and workflow.

The developer uploads their workflow.nwf file to the library, fills in a form that has a few parameters required for deployment, and away it goes. I used a web service to get all the webs in our site collections (we only have a few due to our setup) and then pulled out the URL from the XML that service returns, put them in a collection and iterate through each one. I do a quick error check to ensure the site has the library/list that was defined in the form by the dev (we have a few non-standard sites), and if it does, fetch the nwf file into a variable and tidy up the XML (<,>,& need tidying), then run the web service call to deploy the workflow.

 

This was so simple I assume others must have done before. Has anyone done this sort of thing, and if so, how far have you taken your automated deployment through Nintex? Workflows? Forms? Lists? Sites? Or is it that not many people have this sort of structure in their environments that requires repetitive deployment?

 

Between Nintex and and Microsoft they must have given us enough in the API's to do most repetitive tasks.


4 replies

Badge +16

@garypowelljones is this what you did?

Badge +2

I took the PnP approach.


 


I wrote an extensibility handler that could extract workflows and forms a PnP template, then provision them as well.


 


I used PnP PowerShell to provision from the desktop, but it could be plugged into any code using PnP provisioning framework


 


Under the hood, the extension gets the workflows from the SharePoint site, checks if its a Nintex workflow and if so, then talks to Nintex API's to extract the information. Similar for forms.


 


Note - this only works on-prem and I wrote it for SharePoint / Nintex 2013 - never tried it with later versions and certainly wouldn't work with Nintex on the cloud.


 


PnP template looked something like...


<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2018/05/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.0.1808.0, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
<pnp:Templates ID="CONTAINER-NINTEXDEMO">
<pnp:ProvisioningTemplate ID="TEMPLATE-NINTEXDEMO" Version="1" BaseSiteTemplate="STS#0" Scope="RootSite">
<pnp:Providers>
<pnp:Provider Enabled="true" HandlerType="SPR.Provisioning.PnPNintex, SPR.Provisioning, Version=1.0.0.0, Culture=neutral, PublicKeyToken=57993f61b5475340">
<pnp:Configuration>
<CustomWorkflowForms xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ons.gov.uk" xsi:schemaLocation="http://sharepointresource.co.uk .NintexProvisioning.xsd">
<Workflows>
<ListWorkflows>
<Workflows>
<WorkflowInfo>
<ID>b425f7a6-17d1-4ba3-bedd-e96e01741104</ID>
<Name>List Workflow</Name>
<Type>Nintex</Type>
<FilePath>NintexWorkflow18b474307-593f-4d77-afa6-c061976b8b39.xml</FilePath>
<BaseID>8b474307-593f-4d77-afa6-c061976b8b39</BaseID>
<Scope>List</Scope>
<ListID>24d71370-25bb-40fc-966e-62c4d5541013</ListID>
<ListName>Documents</ListName>
<StartOnCreated>false</StartOnCreated>
<StartOnUpdated>false</StartOnUpdated>
<InstantiationUrl>_layouts/15/NintexWorkflow/StartWorkflow.aspx</InstantiationUrl>
<AssociationData>&lt;dfs:myFields xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;dfs:queryFields /&gt;&lt;dfs:dataFields&gt;&lt;d:SharePointListItem_RW&gt;&lt;/d:SharePointListItem_RW&gt;&lt;/dfs:dataFields&gt;&lt;/dfs:myFields&gt;</AssociationData>
<Action>Publish</Action>
</WorkflowInfo>
</Workflows>
</ListWorkflows>
<SiteWorkflows>
<Workflows>
<WorkflowInfo>
<ID>653eeb22-075d-49ba-a11b-817c657ad777</ID>
<Name>Site Workflow</Name>
<Type>Nintex</Type>
<FilePath>NintexWorkflow268263f8-001c-4fe8-a2dc-f0d8e64e37e1.xml</FilePath>
<BaseID>268263f8-001c-4fe8-a2dc-f0d8e64e37e1</BaseID>
<Scope>ContentType</Scope>
<HistoryList>NintexWorkflowHistory</HistoryList>
<TaskList>Workflow Tasks</TaskList>
<StartOnCreated>false</StartOnCreated>
<StartOnUpdated>false</StartOnUpdated>
<InstantiationUrl>_layouts/15/NintexWorkflow/StartWorkflow.aspx</InstantiationUrl>
<AssociationData>&lt;dfs:myFields xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;dfs:queryFields /&gt;&lt;dfs:dataFields&gt;&lt;d:SharePointListItem_RW&gt;&lt;/d:SharePointListItem_RW&gt;&lt;/dfs:dataFields&gt;&lt;/dfs:myFields&gt;</AssociationData>
<Action>Publish</Action>
</WorkflowInfo>
</Workflows>
</SiteWorkflows>
<ContentTypeWorkflows>
<Workflows>
<WorkflowInfo>
<ID>d50cd7cc-d2d0-4047-bcdf-ef0cdddb5925</ID>
<Name>second</Name>
<Type>Nintex</Type>
<BaseID>2e0ba319-fc74-4715-8822-0c30fb136193</BaseID>
<Scope>ContentType</Scope>
<ContentType>0x01010058DDEB47312E4967BFC1576B96E8C3D4</ContentType>
<HistoryList>Workflow History</HistoryList>
<TaskList>Tasks</TaskList>
<StartOnCreated>false</StartOnCreated>
<StartOnUpdated>false</StartOnUpdated>
<InstantiationUrl>_layouts/15/NintexWorkflow/StartWorkflow.aspx</InstantiationUrl>
<AssociationData>&lt;dfs:myFields xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;dfs:queryFields /&gt;&lt;dfs:dataFields&gt;&lt;d:SharePointListItem_RW&gt;&lt;/d:SharePointListItem_RW&gt;&lt;/dfs:dataFields&gt;&lt;/dfs:myFields&gt;</AssociationData>
<Action>Publish</Action>
</WorkflowInfo>
</Workflows>
</ContentTypeWorkflows>
<WebWorkflowsTemplates>
<Workflows>
<WorkflowInfo>
<ID>b82851fa-f200-421c-9ae9-5fd9250cbf75</ID>
<Name>Site Content Type Workflow</Name>
<Type>Nintex</Type>
<FilePath>NintexWorkflow82851fa-f200-421c-9ae9-5fd9250cbf75.xml</FilePath>
<Scope>ContentType</Scope>
<StartOnCreated>false</StartOnCreated>
<StartOnUpdated>false</StartOnUpdated>
<Action>Publish</Action>
</WorkflowInfo>
</Workflows>
</WebWorkflowsTemplates>
<SiteWorkflowsTemplates>
<Workflows>
<WorkflowInfo>
<ID>2e0ba319-fc74-4715-8822-0c30fb136193</ID>
<Name>Site Collection Reusable</Name>
<Type>Nintex</Type>
<FilePath>NintexWorkflow2e0ba319-fc74-4715-8822-0c30fb136193.xml</FilePath>
<Scope>ContentType</Scope>
<StartOnCreated>false</StartOnCreated>
<StartOnUpdated>false</StartOnUpdated>
<Action>Publish</Action>
</WorkflowInfo>
</Workflows>
</SiteWorkflowsTemplates>
<WorkflowSchedules>
</WorkflowSchedules>
</Workflows>
<Forms>
<ListForms>
<Forms>
<FormInfo>
<Name>Item</Name>
<ListID>001f35ce-f713-4234-bedf-b1b9e5750d46</ListID>
<ContentTypeID>0x0100517368018192244D82AC4EA3C58C3079</ContentTypeID>
<FilePath>NintexForm01f35ce-f713-4234-bedf-b1b9e5750d46_0x0100517368018192244D82AC4EA3C58C3079.xml</FilePath>
<Scope>List</Scope>
<ListName>FormList</ListName>
<Action>Publish</Action>
</FormInfo>
</Forms>
</ListForms>
<ContentTypeForms>
<Forms>
<FormInfo>
<Name>Nintex Form</Name>
<ListID>08079a57-185f-45e6-94c4-8efa68e5b199</ListID>
<ContentTypeID>0x0100B0E66FB342EC694FADC4AE6C87E9B65900FB0B2D02C5533D46A13CAE21137BC879</ContentTypeID>
<FilePath>NintexForm8079a57-185f-45e6-94c4-8efa68e5b199_0x0100B0E66FB342EC694FADC4AE6C87E9B65900FB0B2D02C5533D46A13CAE21137BC879.xml</FilePath>
<Scope>ContentType</Scope>
<ListName>CTypeList</ListName>
<Action>Publish</Action>
</FormInfo>

</Forms>
</ContentTypeForms>
</Forms>
</CustomWorkflowForms>
</pnp:Configuration>
</pnp:Provider>
</pnp:Providers>
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
Userlevel 6
Badge +13

I think that's very much the route that we had been going down before, but for deployment of all major assets, columns, content types etc. The problem was the maintenance overhead, it would take an age to build the config of all these assets. Obviously, scaling it back to just Nintex assets makes that a lot easier.


 


I think my mindset with the deployment through workflow itself was to keep the skillset within the Nintex arena only. So I wouldn't think that anyone coming into my role in the future would need anything other than Nintex experience and a little knowledge around XML and web services to make this work. It also only took a couple of days to do.


 


We're working on Forms at the moment.


 


As you highlighted though, the problem comes when we move to SharePoint Online. Deploying SharePoint assets will work, but Nintex assets (unless being done with via a 3rd party service with full access to your tenant or the ability to host the web service internally with access to the tenant) will never be an option due to the limitations of the app model.


 


Potentially something for the Workflow Cloud environment to handle (I've not had chance to venture there much yet)?

Badge +1

Hello Happy new years


 


Have you found a way to deploy nintex forms using webservice? We are tasked to deploy forms and workflow to 50+ site collection so we need to find a way to make automated deployment work.

Reply