How to adjust workflow start timeout, or optimize the performance of workflow manager

Dear experts,

I'm working on SharePoint 2013 with Workflow manager 1.0. I developed a workflow and customized its initialization form. When I click the 'Start' button try to start the workflow, I got an error like below picture.

It looks like a timeout problem, because after about 3 minutes I could receive the email from this workflow and see tasks created, in most cases. After investigated the log file, I found the error message below:

System.TimeoutException: The HTTP request has timed out after 20000 milliseconds. --->

System.Net.WebException: The request was aborted: The request was canceled.    

at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)    

at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.OnGotResponse(IAsyncResult result)     --- End of inner exception stack trace ---    

at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)    

at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)    

at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)    

at Microsoft.Workflow.Client.WorkflowManager.StartInternal(String workflowName, WorkflowStartParameters startParameters)    

at Microsoft.SharePoint.WorkflowServices.FabricWorkflowManagementClient.StartInstance(String serviceGroupName, String workflowName, String monitoringParam, String activationKey, IDictionary`2 payload)    

at Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.StartWorkflow(WorkflowSubscription subscription, IDictionary`2 payload)    

at Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.StartWorkflowOnListItem(WorkflowSubscription subscription, Int32 itemId, IDictionary`2 payload)    

at Microsoft.SharePoint.WorkflowServices.WorkflowInstanceServiceServerStub.StartWorkflowOnListItem_MethodProxy(WorkflowInstanceService target, XmlNodeList xmlargs, ProxyContext proxyContext)    

at Microsoft.SharePoint.WorkflowServices.WorkflowInstanceServiceServerStub.InvokeMethod(Object target,String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)    

at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)    

at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeMethod(Object obj, String methodName, XmlNodeList xmlargs, Boolean& isVoid)    

at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessMethod(XmlElement xe)    

at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessOne(XmlElement xe)    

at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe)    

at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process() cd74089d-dccf-00d5-5477-49b5118fe560

RequestMessage:

<Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName="Javascript Library">

  <Actions>

    <Method Name="GetExternalVariable" Id="16" ObjectPathId="12">

      <Parameters>

        <Parameter Type="String">Approvers</Parameter>

      </Parameters>

    </Method>

    <Method Name="GetExternalVariable" Id="17" ObjectPathId="12">

      <Parameters>

        <Parameter Type="String">Days</Parameter>

      </Parameters>

    </Method>

    <ObjectPath Id="19" ObjectPathId="18" />

    <Method Name="StartWorkflowOnListItem" Id="20" ObjectPathId="18">

      <Parameters>

        <Parameter ObjectPathId="12" />

        <Parameter Type="String">22</Parameter>

        <Parameter Type="Dictionary">

          <Property Name="Approvers" Type="String">i:0#.w|nnitcorp\xrdu</Property>

          <Property Name="Microsoft.SharePoint.ExternalVariable.Approvers" Type="String">i:0#.w|nnitcorp\xrdu</Property>

          <Property Name="Days" Type="String">5</Property>

          <Property Name="Microsoft.SharePoint.ExternalVariable.Days" Type="String">5</Property>

        </Parameter>

      </Parameters>

    </Method>

  </Actions>

  <ObjectPaths>

    <Identity Id="12" Name="50e607f0-ceab-4a8c-90c5-81e2f2ba78d9:aa3d1bb1-680e-413a-8dc1-281746512b32" />

    <Method Id="18" ParentId="8" Name="GetWorkflowInstanceService" />

    <Constructor Id="8" TypeId="{4ccc7f0e-bf7e-4477-999c-6458a73d0039}">

      <Parameters>

        <Parameter ObjectPathId="6" />

      </Parameters>

    </Constructor>

    <Property Id="6" ParentId="4" Name="Web" />

    <StaticProperty Id="4" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />

  </ObjectPaths>

</Request>

This confirms that this error is a timeout error. But I didn't find any document stating where to adjust this timeout setting. Does anyone know about it?

Further, I found if I repeat starting the workflow for 2 or 3 times, it becames very fast. I guess it is related with some cache setting or IIS host setting. The setting contols after a while if no request to the workflow manager, the cache of this service will be released.

If no way to adjust the timeout of workflow start request, nor adjust the cache duration of workflow manager, is ther anyway to simulate a request to the workflow manager and I could use a PowerShell script to 'activate' it, for instance every 10 minutes?

Thank you very much.

May 26th, 2015 1:02am

Hi Alex,

Did you install the workflow manager in a separated server?

If yes, please make sure that you can ping the workflow manager server from SharePoint server and you can access SharePoint site on workflow manager server.

If network between SharePoint and Workflow Manager is fine, I recommend to remove the workflow service application proxy: Get-SPWorkflowServiceApplicationProxy | Remove-SPServiceApplicationProxy.

Then re-register workflow service: https://technet.microsoft.com/en-us/library/jj663115.aspx.

Thanks,

Victoria

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2015 10:29pm

Hi Alex,

Go to workflow Instance management DB, and look for Instances table.

Make sure the one you are using is started.

May 27th, 2015 11:45pm

Hi Victoria,

Thank you for your reply. Actually I install the workflow manager on the same server with SharePoint Server, and the SQL Server is also on the same one.

My understand is, if the workflow manager doesn't receive any request for a while, it will fall asleep, then when a new request arrives, system has to wake up workflow manager, which takes about 3 mintes, then it resume working. I'm not sure whether this is controlled by IIS, application pool or workflow manager itself. If it is configurable, how to change this 'idel time'?

Or, as my plan B, is there any way to use PS to simulate a request to workflow manager to 'wake up' it every 5 minutes to keep it response in short time?

Thank you very much.

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 1:31am

Hi Rahul,

Yes, the workflow manager is working. The problem is, after no request for a while, the workflow manager will fall asleep, at least it looks like that. So it can not reponse the first request in 18 seconds, which is the timeout of the workflow initiation form.

And my purpose is, make the workflow initiation form wait for longer, or make the workflow manager always wake up. But I can not find any way to mak it. Do you have any idea about this?

Thank you very much.

May 28th, 2015 1:34am

Hi Alex,

I recommend to restart the service WorkflowServiceBackend before starting workflow.

If the issue can be resolved, you can make a script to restart this service periodically. 

More reference:
http://blogs.msdn.com/b/laleh/archive/2014/09/03/sharepoint-2013-workflow-troublehsooting.aspx

Thanks,

Victoria

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 11:42pm

Hi Victoria,

Thank you for the reference blog. I will have it as my plan C.

After further investigation, I'm 80% sure this problem is caused by javascript async call timeout on the workflow initiation form, but it seems no developer reference about how core.js is implemented. So it is very hard to troubleshoot and change the default timeout value.

Br,

Alex

May 29th, 2015 12:04am

Hi Alex,

As this issue is a little complex, and it is difficult to troubleshoot this error in forum support.

I recommend to open a ticket with Microsoft and they will help to do more research in your environment.

Thanks,

Victoira

Free Windows Admin Tool Kit Click here and download it now
June 1st, 2015 11:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics