Saturday, April 15, 2017

SharePoint 2013 Workflow Troubleshooting


Features of SharePoint 2013 workflows Troubleshooting.

SharePoint 2013 workflows are powered by Windows Workflow Foundation V4. Its built on the WCF Messaging functionality.

Now SharePoint workflow transform itself from process to platform.

Means WCF can communicate within machine and network level using TCP/IP and capable of communicating outside of your network using Web service call using http/https.

Windows Workflow Foundation 4 workflows are a structured collection of workflow "activities" that creates the relationship to SharePoint as "action".

To start the workflow development activities, you need to install the Workflow Manager.
This will be installed on out of your SharePoint Server. This is the new feature introduced in SharePoint for isolating the workflow process and Scaling the Workflow services for SharePoint.

You can also use the SharePoint 2010 workflow activities for backward compatibility purpose only. If you are creating the new workflow from the scratch then you should choose the "SharePoint 2013 as platform type".

To install and Configure the workflow for  SharePoint, please follow up this link

https://technet.microsoft.com/en-in/library/jj658588.aspx

I managed to install and configure it, but still I am not able to see the "SharePoint 2013 workflow" on the platform type in SharePoint Designer. It shows the below error.



"The Option for the SharePoint 2013 workflow platform is not available because
the workflow service is not configured on the server.
Please contact your server administrator."

First you need to ensure the "Workflow Service application proxy" has been associated with your Web Application in central administration page as shown in this image.





To resolve this problem,you need to register the workflow service to your site.

Register-SPWorkflowService -SPSite 'http://win-236tjq4buqi' -WorkflowHostUri 'https://localhost:12290/'

After this command , I have received the error "The root of the certificate chain is not a trusted root authority"


To resolve this problem, you need install the SSL certificates on the server where Workflow Manager installed and also your SharePoint Server configured to use the SSL.
Please see this MSDN link that helps your how to install the workflow Manager Certificates on the SharePoint 2013

Another troubleshoot , An error says " The underlying connection was closed:An unexpected error occurred on a received with Client Activity Id.

Resolution for this, You have to use the WorkhostUri URL without HTTPS


Finally, I am managed to install and configure the "Workflow Manager" on my server and set to go for exploring the SharePoint 2013 Workflow Development.



For best practices, you should not install the Workflow Manager on the server where the server elevated to AD and SharePoint installed machine.

For development purpose, you can use the workflow without SSL and ignore the above best practices.


After this, I was trying to create the simple workflow that logs the message the workflow history, My workflow started and few minutes it cancelled its self  automatically.

Upon digging the reason for this cancel problem further through fiddler, the workflow attached to the list failing with HTTP 401- Unauthorized despite I am logging in as Administrator and configured the Workflow Manager with the administrator account.

Workflow need to have read and write permission on . To elevate this permission to workflow, you need to activate the site feature called "Workflows can use app permissions"