I’ve gotten the distinct honor of being allowed to beat my head against SharePoint 2013 workflows. This is in part due to rebuilding or updating servers that we use in our Power User Fast Track course. I want to share my frustration with it by using the phrase “mittens for snakes”. This phrase was introduced to me about the same time I spent approximately 4 hours trying to figure out why a perfectly good installation of Workflow Manager was not working correctly. Let’s take a look…
(disclaimer: this article was written in a bit of frustration so take it with a grain of salt.)
SharePoint 2013 Workflows have made a departure from previous editions in that you now connect to a service that is intended to be offloaded. The main reason, I assume, is to support multiple SharePoint farms. This makes complete sense if you look at SharePoint 2013 design concepts as being motivated mostly by the impending great Office 365 push of 2013. For on premise? We’re getting mitten-y.
SharePoint 2013 will run 2010 workflows perfectly well. If you want the 2013 Workflows then you need to follow a process.
- Install User Profile Service and make sure that it is working properly to sync your users from Active Directory. If this step is not completed then even if you do everything else correctly, your users CANNOT run 2013 workflows. The 2013 workflows make sure a user running a workflow (or a user you are emailing) is in the User Profile Service.
- Install Workflow Manager 1.0. I highly recommend looking for and using Microsoft Web Platform Installer. This is a handy little tool with all kinds of goodies at your fingertips. The setup process is NOT intuitive. The first time I tried to install (2 years ago), the Microsoft documentation was a mess of hyperlinks and vague ordered steps. Save yourself and google a blog for this step.
- Connect SharePoint to the Workflow Manager. This step involves going back to your SharePoint farm and running Register-SPWorkflowFlowService in a SharePoint Management Console. I highly recommend here going to take a look at the URL for the workflow service to make sure that you can see the XML from the service. It should by default be something like “https://<servername>:12290”. Note the default port number and the HTTPS. IF you can see the XML, then try to register the workflow service.
- Tidy up and try it out. What is that supposed to mean?
Step 4 is where the “magic” happens. IF by magic you mean frustration and mittens. I was reloading the workflow manager for the 4th time last Wednesday because I ran into problems. The first issue was that my User Profile Service was being uncooperative. We reset Student machines to checkpoints on a regular basis and I’m used to that. The secondary problem was that I could NOT get my custom SharePoint Designer Workflow to run. I kept having my workflow canceled with the error Exception details: System.ApplicationException: HTTP 401 {“error_description”:”Invalid JWT token. Could not resolve issuer token.”}
Thank the maker that I ran across this particular TechNet discussion. In this discussion some admins discovered that to get your Workflow Manager connection working correctly immediately, you HAVE TO RUN A TIMER JOB ON TOP OF STEPS 1-3 ABOVE. That timer job is Refresh Trusted Security Token Services Metadata feed. This timer job is set to run daily. So if you install Workflow Manager at the wrong time, Surprise! It won’t work until this timer job comes around to let you run workflows: potentially 24 hours later.
I’m sure there is some reason for this just as I’m sure there is someone out there that can justify making fuzzy hand wear for snakes. Still, this seems fairly unnecessary or should be triggered by the installation process some how. A cursory glance through the Troubleshooting documentation for workflow manager 1.0 doesn’t reveal any mention of this. I’m sure there are a lot of things that happen in the background that I’m not aware of, but I’ve seen that particular error message so many times and reloaded so many times that I come near to rage that it’s all because some timer job wasn’t triggering. Even worse could be that it is simply supposed to take so long to run by design. If that’s the case then waiting 24 hours to be able to use your Workflow Manager is a horrible design decision that should at least be documented somewhere.
All in all, I’m left looking at a Service that doesn’t do what I want half the time and doesn’t install correctly the other half. While I understand that mittens are the greatest thing when climbing a mountain or working in arctic conditions, apparently I’m a snake.