I have a workflow that triggers on create when a user submits a document to a library (InfoPath).
The workflow has actions enclosed in an Action Set set to run as the workflow owner (a user with full control permissions).
The first action is Set Permissions which gives the Initiator "ViewOnly" permissions.
This is followed by a Commit Pending Changes action.
These two actions have been working correctly for the past year.
I had to add a Pause for 5 Minutes action, followed by an UpdateXml action at the end of the workflow, which updates a processing instruction text to relink the InfoPath form. I even "caught the errors" for the action using the Error Handling section.
The workflow runs correctly 60% of the time, and crashes with System.InvalidOperationException the remainder, even when I handle errors.
The event log on the Server shows the following:
03/16/2015 14:10:18.68 OWSTIMER.EXE (0x2670) 0x2164 SharePoint Foundation Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 7945bbe4-ab06-4b5e-9cb5-f2b99af6e2c6 2638c18d-83cf-47a9-bd69-b16f3dbed8fb
03/16/2015 14:10:18.68 OWSTIMER.EXE (0x2670) 0x2164 SharePoint Foundation Workflow Infrastructure 98d4 Unexpected System.InvalidOperationException: Invalid Operation at Nintex.Workflow.Activities.UpdateXmlActivity.Execute(ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run() 2638c18d-83cf-47a9-bd69-b16f3dbed8fb
If it wouldn't happen 60% of the time, I 'd suggest it 's a permissions issue and I 'd recommend you to set Full control permissions firstly and at the end of the workflow set the "View Only" Permissions.