Monday, September 8, 2014

Error in "Pause for" Action - Nintex Workflows

Error in Pause for Action
Recently I was working on a project where I had to develop multiple workflows calling each other. To provide some delays I used “Pause for” action at the start of the workflow so that the all the other workflows should complete before the current workflow proceeds ahead.
But what I found during this implementation was, whenever workflow pauses for some duration lets say 1  minute at “Pause for” action it throws error. But interesting thing was, even after throwing error, workflow continues to run and completes successfully.
Email triggered says Workflow Terminated unexpectedly for item.
Error message logged was “Error POC 1” failed to run.
I got below information when I discussed this issue with nintex support.

Reason: Nintex workflows are run by SharePoint workflow engine only (i.e. Windows workflow foundation). Workflow is first executed generally in World Wide Web Publishing Services (w3wp.exe). After a delay or pause, in which the workflow "sleeps", it wakes up and is then run by the SharePoint Timer Service (the owstimer.exe process). The only time this isn’t the case is if the w3wp.exe is under excessive load, in which case it postpones the workflow and the Timer Service is then used to the continue the process.

SharePoint dictates which Workflow Timer Service will run the workflow - so this could occur on any server on which the "Microsoft SharePoint Foundation Workflow Timer Service" is enabled.

When Nintex is deployed it install’s some DLL’s required for workflows on the WFE’s where
 Microsoft SharePoint Foundation Web Application service is enabled.
So when Workflow Timer Service attempts to run a workflow where Microsoft SharePoint Foundation Web Application is disabled it throws error.

Solution:
1)      Disable Workflow Timer Service to all the WFE’s where Microsoft SharePoint Foundation Web Application service is disabled.
2)      Or Enable Microsoft SharePoint Foundation Web Application Service on all WFE’s.

Related Issues: So due to the above reasons not only “Pause for” action throws error but some below mentioned actions also throws error.

Change State: Since while changing state in a State Machine Workflow, a hidden delay is involved. So in that case also, it may throw error in case after delay it got caught by WFE where Microsoft SharePoint Foundation Web Service is disabled but Workflow Timer Service is enabled.

Pause Until: This action also throws error while in a paused state until some date is passed.

Assign Flexi Task: Due to the delay involved before sending reminders, it may error out.

Similarly Task Reminder Action, Request Data, or any other action where delay is involved may throw errors if occupied by wrongly configured WFE’s.

1 comment:

  1. PowerShell >_ (Get-SPWebApplication $URL).UpdateWorkflowConfigurationSettings() from a WFE server should solve the issue without disabling services on app servers.

    ReplyDelete