AnsweredAssumed Answered

Programmatical WF start fails

Question asked by mvahsen on Aug 13, 2018

Hi there,

I'm programmatically starting a workflow via Powershell but the WF keeps stuck "in processing"

The Workflow only contains a log action and the log is shown. Environment is SP 2013. The WF never ends.




$url = "myurl";

$listName = "myListName";
$web = Get-SPWeb -site "http://mySite/";
$list = $web.Lists[$listName];
$workflowname = "myWFName";

$view = $list.Views["ViewName"]
$items = $list.GetItems($view)


[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

$webserviceurl = $url + '/_vti_bin/NintexWorkflow/Workflow.asmx';

$pw = convertto-securestring -AsPlainText -Force -String "pw"
$credential = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\user",$pw

$webserviceurl = $webserviceurl
$page = New-WebServiceProxy -Uri $webserviceurl -Credential $credential;
$page.Url = $webserviceurl;


foreach($item in $items)
$exportedworkflow = $page.StartWorkflowOnListItem($item["ID"],$listname,$workflowname, '');
Stop-SPAssignment -global;