Restarting Workflow
What it does
Sometimes a Record needs to go through its workflow again from the beginning. A step was approved by mistake, the Record was routed down the wrong path, or its data was corrected after the workflow had already acted on it. This Add-In restarts the workflow in one click. It cancels the Record's current work items, clears the fields the workflow uses to track progress, and routes the Record again as if it were new.
Settings
- Create a new Add-In and name it something like Restart Workflow.
- Under General Settings, set Type to Actions Only.
- Under Where/When to Show, turn on the Record location. Turn on the Search location as well if you want to restart many Records at once from search results.
- Use Record Types to limit the Add-In to the Record Types whose workflow it knows how to reset, and use When to Show to limit it to administrators or workflow managers.
- Set the option to Add-In will refresh the Record/Viewer screen after running.
- Under Confirmation Prompt, add a warning such as "This cancels the current workflow for this Record and starts it again from the beginning."
Actions
Add these actions under Record Actions, in this order. The order matters: the old work items have to be gone, and the progress fields cleared, before the new route starts, so that the workflow sees the Record the way it would see a new one.
1. Cancel Work Item
- Turn Cancel All on, so every work item for the Record is cancelled, including ones sitting in other users' inboxes.
- Turn Stop Processing OFF. This is the setting that makes the Add-In work. It is normally left on, and with it on the Add-In would stop right after the cancel, leaving the Record with no workflow at all. With it off, the cancel happens and the next two actions still run.
- Leave Skip History Log off, so the cancel shows in the Record's workflow history.
2. Record Multi-Value Update
Add one row for each field your workflow writes to record its progress, and put [DEL] in Field Value so the field is removed. Leave Line Number blank. These are the fields your trigger filters check to decide where a Record goes next, such as:
- Field Name ApprovedBy, Field Value [DEL]
- Field Name ApprovalDate, Field Value [DEL]
- Field Name Exported, Field Value [DEL]
Clear only the fields the workflow itself sets. Leave the Record's business data alone. If the workflow's first trigger routes on a field a user typed in, clearing that field changes where the Record goes.
3. Initiate Workflow Route
- Leave Record ID and Document ID blank to route the Record the Add-In is running against.
- Leave Trigger / Process and the Trigger Name box next to it blank to route the Record from the top of the trigger list, just like a new Record. To restart at a particular step instead, select that trigger.
- Leave Defer Actions off, so the new work item is in place by the time the Add-In finishes.
Optional: Add Record Note
Add an Add Record Note action at the end with text such as "Workflow restarted by [USERFULLNAME] on [DATE]", so there is a record of who restarted it and when.
Using it
Open the Record and click Restart Workflow, or check several Records in search results and run it from there. When it finishes, the Record's workflow history shows the old work items as cancelled and a new work item at the first step. Check that the new work item landed where you expected.
Notes
- The cancelled work items stay in the workflow history. Nothing is deleted.
- Keep all three actions together under Record Actions. They depend on running in sequence for the same Record.
- If your workflow tracks progress in many fields, list every one of them in the Record Multi-Value Update action. A progress field left behind can send the restarted Record straight past the steps you meant it to repeat.
- To send the Record to a step chosen at run time, put a field name in brackets in the Trigger Name box, for example [RestartAt]. If no trigger matches, the Record is routed from the top of the trigger list.