cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Programmatical WF start fails

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]:Smiley FrustratederverCertificateValidationCallback = {$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;
}

Labels: (2)
Tags (1)
0 Kudos
Reply