Office 365 PnP Workflow Provisioning

%3CLINGO-SUB%20id%3D%22lingo-sub-23221%22%20slang%3D%22en-US%22%3EOffice%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23221%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20tell%20me%20which%20steps%20I%20should%20follow%20to%20privision%20a%20Reusable%20SharePoint%20workflow%20created%20with%20SharePoint%20Designer%3F%26nbsp%3B%3C%2FP%3E%3CP%3EExtracting%20a%20PnP%20template%20with%20-Handlers%20Workflows%20seems%20to%20be%20the%20first%20step%2C%20but%20I'm%20not%20sure%20what%20my%20VSO%20project%20needs%20to%20have%20in%20order%20to%20provision%20a%20workflow.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%2C%3CBR%20%2F%3ER%C3%A9my%20Bosman%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-23221%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-51784%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-51784%22%20slang%3D%22en-US%22%3ESo%2C%20you%20tried%20with%20Workflow%20of%20type%202013..%20I've%20tried%20with%20wf2010%20with%20no%20success%2C%20maybe%20I%20do%20something%20wrong%2C%20or%20not%20work%20with%20them..%3CBR%20%2F%3EThank%20you%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-51352%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-51352%22%20slang%3D%22en-US%22%3EI%20only%20tried%20list%20workflows%20using%20sp2013%20on%20office%20365.%20But%20others%20should%20work%20too.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-51299%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-51299%22%20slang%3D%22en-US%22%3EHi.%3CBR%20%2F%3EWhen%20you%20say%20Workflow%2C%20which%20type%20of%20workflow%3F%3CBR%20%2F%3EWorkflow%20SP2010%20(created%20with%20spd)%3CBR%20%2F%3EAnd%20if%20yes%2C%20list%20or%20reusable%3F%3CBR%20%2F%3EWorkflow%20SP2013%20(created%20with%20spd)%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-24556%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-24556%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20help%20Pieter!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23241%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23241%22%20slang%3D%22en-US%22%3E%3CP%3E%40Deleted%2C%3C%2FP%3E%3CP%3EYes%2C%20simply%20do%20Apply-SPOProvisioningtemplate%20(%20or%20the%20c%23%20equivalent)%20to%20apply%20the%20template%20and%20the%20workflow%20inside%20the%20tmeplate%20will%20be%20provisioned%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23240%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23240%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Pieter%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20this%20means%20you%20will%20need%20to%20use%20the%20exported%20xml%20in%20your%20pnp%20file%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ekr%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPaul%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23231%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23231%22%20slang%3D%22en-US%22%3E%3CP%3E%40Deleted%2C%20yes%20SPD%20workflows%20are%20exported%20and%20imported%20using%20PnP%20Templates.%20No%20need%20for%20WSPs.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23229%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23229%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Pieter%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20mean%20workflows%20that%20do%20not%20exist%20yet%20in%20a%20tenant%20but%20which%20you%20want%20to%20upload%20to%20a%20new%20tenant.%3C%2FP%3E%3CP%3Edo%20you%20need%20to%20upload%20the%20WSP%3F%20or%20is%20there%20a%20new%20way%20how%20to%20do%20this%3F%20bypassing%20a%20wsp%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20see%20when%20i%20get%20a%20export%20the%20whole%20workflow%20is%20exported.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKr%2C%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPaul%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23228%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23228%22%20slang%3D%22en-US%22%3E%3CP%3E%40Deleted%2C%20what%20do%20you%20mean%20by%20new%20workflows%3F%20Workflows%20that%20are%20not%20exported%20from%20an%20existing%20site%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23227%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23227%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Remy%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20having%20a%20simular%20issue%20with%20Csom%20C%23.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdding%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20a%20way%20how%20to%20upload%20new%20wf's%20with%20pnp%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-23224%22%20slang%3D%22en-US%22%3ERe%3A%20Office%20365%20PnP%20Workflow%20Provisioning%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-23224%22%20slang%3D%22en-US%22%3E%3CP%3E%3CU%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F25137%22%20target%3D%22_blank%22%3E%40R%C3%A9my%20Bosman%3C%2FA%3E%2C%3C%2FU%3E%3C%2FP%3E%3CP%3EThe%20easiest%20way%20to%20figure%20out%20how%20to%20do%20this%20is%20by%20using%20the%20PowerShell%20commands%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-SPOProvisioningtemplate%20and%20Apply%3CSPAN%3E-SPOProvisioningtemplate%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20could%20run%20this%20with%20or%20without%20the%20Handlers%2FExcludeHandlers%20options.%20If%20you%20just%20do%20the%20workflows%20you%20risk%20not%20including%20the%20columns%2Fcontent%20types%2Flists%20etc%20that%20may%20be%20required%20by%20the%20workflow.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20want%20tot%20do%20this%20via%20code%20then%20simply%20replicate%20the%20same%20code%20as%20is%20used%20within%20the%20code%20used%20by%20the%20above%20PowerShell%20commands%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi all,

 

Can anyone tell me which steps I should follow to privision a Reusable SharePoint workflow created with SharePoint Designer? 

Extracting a PnP template with -Handlers Workflows seems to be the first step, but I'm not sure what my VSO project needs to have in order to provision a workflow. 

 

Many thanks,
Rémy Bosman

11 Replies
Highlighted

@Rémy Bosman,

The easiest way to figure out how to do this is by using the PowerShell commands

 

Get-SPOProvisioningtemplate and Apply-SPOProvisioningtemplate

 

You could run this with or without the Handlers/ExcludeHandlers options. If you just do the workflows you risk not including the columns/content types/lists etc that may be required by the workflow.

 

If you want tot do this via code then simply replicate the same code as is used within the code used by the above PowerShell commands 

Highlighted

Hi Remy,

 

I am having a simular issue with Csom C#.

 

Adding @Vesa Juvonen 

 

Do you have a way how to upload new wf's with pnp?

Highlighted

@Deleted, what do you mean by new workflows? Workflows that are not exported from an existing site?

Highlighted

Hi Pieter,

 

i mean workflows that do not exist yet in a tenant but which you want to upload to a new tenant.

do you need to upload the WSP? or is there a new way how to do this? bypassing a wsp?

 

i see when i get a export the whole workflow is exported.

 

Kr,


Paul

Highlighted

@Deleted, yes SPD workflows are exported and imported using PnP Templates. No need for WSPs.

Highlighted

Hi Pieter,

 

so this means you will need to use the exported xml in your pnp file?

 

kr,

 

Paul

Highlighted

@Deleted,

Yes, simply do Apply-SPOProvisioningtemplate ( or the c# equivalent) to apply the template and the workflow inside the tmeplate will be provisioned

Highlighted

Thanks for your help Pieter! 

Highlighted
Hi.
When you say Workflow, which type of workflow?
Workflow SP2010 (created with spd)
And if yes, list or reusable?
Workflow SP2013 (created with spd)

Thanks!
Highlighted
I only tried list workflows using sp2013 on office 365. But others should work too.
Highlighted
So, you tried with Workflow of type 2013.. I've tried with wf2010 with no success, maybe I do something wrong, or not work with them..
Thank you