For a while I have been meaning to look into Henril’s Workflow Automation Tool. The reason being that when CRM 2011 first can out I created a workflow automation tool myself. It was developed for my current employer, so in reviewing this tool not only do I share my experiences with Henril’s version, I also get to bench mark my own version. If you are interested in this tool you can download it or find more info on it here.
So what is workflow automation? Simply put it allows us to fire off specified workflows on a scheduled basis. While customising MSCRM you may find that you need automation to run every now and again to check the state of your records. With no easy way to do this in CRM, customisers tend to use workflow waits in their workflow stages. This can drain a lot of resources, and also leave you with a system where thousands of records have several workflows running on them which are stuck in a waiting state. Eventually your CRM system slows down and you don’t dare cancel any of the waiting workflows for fear it may ruin a records state within your define business process. Sound familiar? Well the workflow automation tool helps us around this problem!
Henril speaks of another reason why you would want to use the workflow automation tool. This is what he has to say about his creation.
CRM Workflow is great feature that it is configurable and also smart. In fact, it is so smart it is capable of detecting infinite workflow execution. Quite often, we see the need to configure a workflow to re-execute itself at the end of its process either by simply updating a field which the workflow is tracking on or start itself as child workflow. However, CRM is smart enough to detect this infinite execution after about 5-6 executions then eventually terminates it.
Below is a typical example scenario when you would need to create an infinite workflow. You would like to automatically generate appointment (or task, email) reminder based on certain date field value, eg. one month after Last Appointment Created. You then create a workflow to execute on field value change of Last Appointment Created. Once the appointment has been created, you would then update the Last Appointment Created field to current date and time, therefore, trigger the same workflow.
Hence the purpose of Workflow Automation is a workaround to the above limitation and allow user to automate or schedule workflow execution.
Typically, user will manually create and configure the workflow within Dynamics CRM. The workflow must be configured executable on demand. Rather than setting up the workflow triggers in the workflow itself, user creates a scheduled task via Task Scheduler to execute the workflow via Workflow Automation.
I’ve not looked in to it myself, but it doesn’t surprise me that CRM is smart enough to prevent workflow recursive executions. At the end of the day it’s a feature that exists to help us prevent our CRM Servers from draining their resources. So Henrils point is very valid.
The tool is basically a console application that can be placed on to the CRM server or a PC that can see the CRM Server. Although I haven’t tested the latter I am guessing it is capable of this due to its configuration setup. Before you can execute the tool you have to configure two XML files. One which informs the tool about CRM and how to connect to it. The other which informs the tool about the workflows it has to run. Once both of these files are configured, the tool can be executed through Windows Scheduled Tasks. Executing the tool through scheduled tasks is how we manage when the tool should run.
Within this file you place the details required for connecting to your CRM Server. This is where you place
- CRM Server URL.
- Organisation Name.
- Discovery Service URL.
- Organisation URL
- Credentials (Optional)
The downside to this credentials file is that it seems that the tool can only connect to one CRM server and organisation. This means that if I want to configure the tool for another organisation I have to copy the tool and its dlls to another folder. Then I can alter the copied versions credentials to connect to a different server. Also the credentials section seems a little odd to me. The reason being that the tool works on default credentials. So when creating a scheduled task you specify the user to start the workflow tool up as. Plus if you want to actually use the credentials section within the XML file for this tool it is not encrypted. The only reason why you may require this is if you are connecting to a hosted CRM system. I must stress that the tool mentions nothing about working on a hosted environment.
In this config file you can specify as many workflows as you want. Each workflow must be the following.
- A Manual Workflow
- Contain a fetchXml query to retrieve the records to run the workflow against.
I really like the idea of using fetchXml to retrieve the data. Although the tool doesn’t say you can, potentially you could run the fetchXml against a hosted system. I’d like to point out that the author says nothing about this working against a hosted CRM system, however I see no reason why you could not place this tool on a machine within your network and point it at the hosted CRM system. As long as you can see your discovery and organisation service the concept this tool is built around should work.
I must stress I have not tested this… but,
- Allowing us to specify the connection URLs means we can point to the hosted environment.
- Allowing us to specify credentials means we can enter windows live IDs and passwords.
- Allowing us to run fetchXml against the SDK means we don’t interact with the database directly.
This means the workflow automation tool could potentially work for hosted environments as long as you have a local dedicated machine to run the tool on!
I do think this tool lacks a lot of polish. An interface would be nice that allows us to configure the tool. Though I am happy to alter XML files not everyone will be. Also I’d really like more visual feedback from the tool when running it. The tool simply runs and closes giving no indication of successfully or unsuccessful operations. IE.
- Has the tool connected to CRM.
- Has the tool located the workflows to run.
- Is there problems with the workflows.
- Has the tool located the data to execute the workflows against.
- What workflow is currently being executed.
There is a log file that is produced by the tool that does contain some of this information but I always prefer in your face visual representations of whats going on.
It would also be nice if I can deploy the tool once and point it at many organisations. I feel having to manage several instances of the application for different organisations a little messy.
I do however like this concept and the tool! But I would do, I created my own implmentation of this concept! I will however stick to my implementation of the workflow automation tool, but I would recommend this tool to anyone looking to add scheduled workflow automation to their CRM system.
I have opened up on a discussion on the workflow automation tool. If you want to share your experiences you can add your opinion here.