You can do this whith powershell:
Start a workflow:
Add-PSsnapin Microsoft.SharePoint.PowerShell
$SPAssignment = Start-SPAssignment
$web = Get-SPWeb "http://YourSharePoint/Site"
$site=Get-Spsite "http://YourSharePoint"
$list = $web.Lists["Your List"]
foreach($item in $list.Items)
{
$manager=$site.WorkFlowManager
$culture = [System.Globalization.CultureInfo]::InvariantCulture
$association=$list.WorkFlowAssociations.GetAssociationByName("Worklflow Name", $culture)
$data=$association.AssociationData
$wf=$manager.StartWorkFlow($item,$association,$data,$true)
}
Stop-SPAssignment $SPAssignment
And to monitore workflow status (SharePoint Online):
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
Function GetWorkflowStatus([Microsoft.SharePoint.Client.List]$list,[int]$listItemId, [string]$workflowName)
{
$context = $list.Context
$listItem = $list.GetItemById($listItemId)
$context.Load($listItem.FieldValuesAsHtml)
$workflowStatusField = $listItem.ParentList.Fields.GetByTitle($workflowName)
$context.Load($workflowStatusField)
$context.ExecuteQuery()
if ($listItem.FieldValuesAsHtml[$workflowStatusField.StaticName] -ne $null)
{
$statusValue = $listItem.FieldValuesAsHtml[$workflowStatusField.StaticName]
Write-EventLog -LogName Application -Source 'Application Error' -Message $statusValue -EventId 2337 -EntryType error;
}
return $null
}
See the erros codes of workflows.