1
votes

I have developed a workflow for automatically closing appointments that are 28 days past the start date. To do this I have created a organisation scoped workflow using a Workflow timeout activity to wait until 28 days after the start date before closing.

I am concerned that this may place an increasingly large load on the CRM implementation as the number of appointments increases (thousands could be open with waiting workflows attached).

How can I check this? does anyone know how often the async service will poll to check whether the timeout has been reached, and does it make a lot of difference on the number of open activities?

2

2 Answers

4
votes

Thousands of pending/waiting workflows isn't an issue, now if it passes the million record mark then you might have issues. The big thing you have to monitor is your asyncoperation table. You'll probably see a performance hit if your table grows passed the 1-2 Million mark and the workflows are being created faster than the async service can process them. There are a few things you can do to improve performance and prevent the table growing out of control:

  1. Make sure you regularly schedule the following job to clear out any processed records and rebuild indexes/statistics as necessary. KB968520
  2. Enable the following registry key which will automatically purge any processed records. KB974896

Other than that you should be in good shape.

2
votes

The technique of using the job in KB968520 is OK, but it's better practice to create "self-policing" workflows, that will expire themselves in an appropriate time (whatever is appropriate for your db) if the actions they lead to aren't taken. This uses a technique known as a 'Parallel Wait Condition' and is discussed here.

Parallel wait's will force workflows to "clean up" even when the records they affect (or which they are affected by) have been removed from the database.