Solved

Several Workflow Instances Failed SharePoint Online

  • 11 March 2024
  • 2 replies
  • 38 views

Badge +1

My Nintex Automation cloud’s workflow makes use of a Nintex form, On Form submissions my Nintex Workflow cloud form is creating SharePoint list items and then initiating a multistage(Branch By Stage) workflow. Due to some issue in a specific Stage of th workflow several instances(up to 100 instances) failed. My SharePoint list is not having the Instance ID stored in it. 

Is there a way I can map my List Item IDs to the failed instance IDs and export the Failed instance data so that I can see what all Instances/List Items failed?

I have a workflow variable that tracks the SharePoint list item id from the Create SharePoint List item action, can it be retrieved using the Nintex Workflow Cloud API.
I’m referring to SharePoint Online.

icon

Best answer by Prem 12 March 2024, 00:42

View original

2 replies

Badge +1

I have a workflow variable that tracks the SharePoint list item id from the Create SharePoint List item action, can it be retrieved using the Nintex Workflow Cloud API.
I’m referring to SharePoint Online.

Badge +1

Today, as I delved into the API, I managed to navigate through Actions and their specifics within failed instances. However, I hit a roadblock when trying to access variable values. Currently, the Nintex Workflow Cloud API doesn't offer access to Workflow Variables or the Output Variables of built-in actions, with the notable exception of text entries in the Workflow History Logs.

Fortuitously, the Workflow History Log actions provided an unexpected solution. By examining the SharePoint List Item Display form URLs logged in the Workflow History, I was able to identify the ListItem IDs generated by my workflow instances. To extract the relevant log messages, I used the following command:

$workflowHistoryLogMessage = $workflowInstance.Actions | Where-object {$_.id -eq $workflowLogActionId}

My script consisted of retrieving latest 100 workflow instances using below endpoint and iterating them for extracting specific details.

$uri = $BaseUri/workflows/v2/designs/$WorkflowId/instances?" + ($queryParams -join '&') 
$response = Invoke-RestMethod -Uri $uri -Method Get -Headers $Headers

Hope this helps someone who is experiencing similar issues and who would like to map their Workflow Instances to the ListItem Ids they are creating using workflow. 

Storing InstanceID in the ListItem properties could be helpful, I will consider it when I’m designing my future workflows.

Reply