Skip to main content

We want to take backup of all Nintex Workflows and Delete them using Powershell Scripts. We found Rest APIs to Get and Export Workflows from Nintex documentation. Can someone please help me with API to delete Nintex Workflows to use in Poweshell ?

Hi @Vdhakol 

 

Does this help?
https://help.nintex.com/en-US/sdks/sdk2013/#Reference/SOAP/NW_REF_SOAP_DeleteWorkflow.htm?TocPath=Nintex%2520Software%2520Development%2520Kit%257CNintex%2520Workflow%25202013%2520Software%2520Development%2520Kit%257CNintex%2520Workflow%25202013%2520SDK%2520Reference%257CWeb%2520Service%2520Reference%257CService%2520operations%257C_____10


Hi,

Thanks for the reply.

Could you please share CSOM PowerShell script to run that SOAP service with credentials ?

I’m not getting how we can execute that SOAP request.

 

Thanks in advance.


Hi @Vdhakol 

 

The Nintex SDK is a c# toolkit that can be installed on the SP server.

 

see here the steps to install.

 

https://help.nintex.com/en-US/sdks/sdk2013/#Installation/SDK_NW_INS_NAV.htm?TocPath=Nintex%2520Software%2520Development%2520Kit%257CNintex%2520Workflow%25202013%2520Software%2520Development%2520Kit%257CInstalling%2520and%2520Using%2520the%2520Nintex%2520Workflow%25202013%2520SDK%257C_____0

 

and example code you could use to delete workflows is below, please keep in mind this is an old script but it should work.

 

using Nintex.Workflow;

// Connect to the Nintex platform
var client = new NintexClient();
client.Credentials = new System.Net.NetworkCredential("username", "password");

// Retrieve a list of workflows
var workflows = client.GetWorkflows();

// Construct the SOAP request
var request = new DeleteWorkflowsRequest();
request.WorkflowIds = workflows.Select(w => w.Id).ToList();

// Send the SOAP request
var response = client.DeleteWorkflows(request);

// Handle the response
if (response.Success)
{
Console.WriteLine("Workflows deleted successfully.");
}
else
{
Console.WriteLine("An error occurred while deleting workflows.");
}

 

Any other methods, using powershell or manually deleting may leave remnants in the dbs.

 

Jake


hi @Vdhakol 

 

Having looked around the old scripts I do have this script that targets the workflow template Nintex uses to delete them, However I cannot guarantee this will be thorough or accurate, it makes use a PnP and is written for 2016.

 

# Install PnP PowerShell module
Install-Module -Name "PnP.PowerShell" -Force

# Connect to SharePoint site
Connect-PnPOnline -Url "https://your-sharepoint-site-url" -UseWebLogin

# Load SharePoint Server Object Model assembly
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.dll"

# Get the current web
$web = Get-PnPWeb

# Get the Nintex workflows on the web
$nintexWorkflows = $web.WorkflowAssociations | Where-Object { $_.BaseTemplate -eq "NintexWorkflow2013" }

# Remove each Nintex workflow
foreach ($workflow in $nintexWorkflows) {
$web.WorkflowAssociations.Remove($workflow)
}

# Update the web to persist the changes
$web.Update()

 

Jake


Hi @Vdhakol 
Have you managed to resolve this?  


I got a response from Nintex team saying “There is no API method or end points available to remove/delete Nintex workflows from SharePoint online sites. So, there is no supported way to delete workflows in bulk through command line and you need to manually delete the workflows from the sites.”


Hi @Vdhakol 

I am sorry that we gave you the incorrect information but this post was in the Nintex for SharePoint forum and not in the Nintex for Office 365 forum and was not tagged with Office 365.
I have now moved the post to the correct forum.


Reply