I recently built a prototype to show how SharePoint and SharePoint Designer workflows can be used to automate an HR performance review process. I had to use a secondary workflow as described in SharePoint Designer: Create a secondary workflow, but had to come up with a different solution for how to set due dates. Following is an explanation of why I needed the secondary workflow for this example and how I got the due dates to work.
The basic requirements are:
I created the following in SharePoint:
Now the workflows. A workflow needs a list or library item to be started. Since the Performance Reviews form library only contains completed review forms, it is not a candidate for the workflow. Instead, my Reviewers list contains the mapping between employees and reviewers and is where the workflow will start. Following the diagramming used in the referenced article, here are my lists and workflows:
The Performance Review workflow uses the Assign a To-Do Item action to assign tasks to the reviewers.The Set Task Details workflow is required because the Assign a To-Do Item action has the following limitations in this case:
Now the trick is: how does the Secondary Workflow find the Employee name and the Due Date? As described in the article referenced above, the Secondary Workflow can use the Current Item – Workflow Item ID to reference the Reviewers item id that caused the task to be created. I can then use that Workflow Item ID to lookup the associated item in the Reviewers list and lookup the Employee name, like this:
Now, how about the Due Date? Since I gathered that as an initiation variable in the Primary Workflow, it’s not immediately available to the Secondary Workflow. So, I better make it available. I do that by having the Primary Workflow store it in the Current Due Date column in the Reviewers list. Then, the Secondary workflow can look it up just like Employee like this:
Now I have tasks with rich titles and descriptions, specific due dates, and detailed notification emails.