The "Wait for Duration" action available in the Workflow Builder expands the capability and flexibility of Workflows to handle automations in a variety of scenarios. Using this action, you can now preset your workflow to pause at specific times, and for a specific duration, before continuing on to subsequent actions. This will be helpful for admins who wish to double check prior actions before proceeding, make time for manual tasks, or allow for input and confirmation from other affected users or departments.
Adding the “Wait For Duration” Action
The "Wait for Duration" action is defined as an action that "pauses a workflow for a set number of hours or days and then resumes the workflow once that duration has expired."
This action can be found in the "THEN" section of the Workflow Builder, listed in a section specifically designated for BetterCloud actions:
When added to your workflow, you can customize this action in the "Properties" pane of the Workflow Builder, by selecting the numerical duration that the workflow should wait, and if this duration is measured in days or hours:
You'll also see a cautionary statement: "Conditions (IF) are only checked when a workflow triggers. They will not be rechecked once your workflow resumes." This means that, after the wait for duration action completes and the workflow continues to subsequent actions, the original triggering conditions of the workflow will not be rechecked, and the workflow will operate under the assumption that they are still valid. For example, if the Workflow is triggered “When a user is moved to the Students Org Unit” and during the “Wait for Duration” stage they are moved out of the Students Org Unit, the Workflow will still continue on.
"Wait for Duration" actions can be used in any order in a workflow, including the first or last action. A single workflow can also support an unlimited number of "Wait for Duration" actions. However, the cumulative total of paused time supported in a single workflow can be no more than 2 years (730 days, or 17,520 hours.)
Auditing Paused Workflows
Once a published workflow has been triggered and reaches its "Wait for Duration" action, this action will measure and begin counting down its allotted time until completion from the moment the action started.
For example, days are measured from the exact time that the "Wait for Duration" action began, rather than by calendar day: If a "Wait for Duration" action is set to pause the workflow for five days, and is triggered at 12pm on Monday, this action will complete at 12pm on Friday.
The status of a workflow's paused instances can be monitored by selecting "View Results" from the workflow's dropdown menu in the Workflow Manager:
Here, any instances that are currently paused will display the following in the "Instances" section of the workflow's results flyout tab:
- The “Targets” column will show who the Workflow was acted on.
- The "Status" column will list this workflow as "WAITING", and display the number of days or hours until the pause completes.
- An "Actions" column will provide options to stop the workflow entirely, or skip the remainder of paused time and continue on to any subsequent actions.
Each individual action will show in the Workflow Report when you click on Instance ID where you can also stop or skip the Wait For Duration action.
Managing Paused Workflows
From the Workflow's Results flyout tab, electing to stop an existing workflow instance that is currently paused will cause the entire workflow instance to stop, skipping all subsequent actions. You'll be required to confirm this action:
If you move forward with stopping a workflow, this will be reflected with a “Stopped” status, and all subsequent actions after the pause listed in its report will be listed as "Incomplete" because they did not run:
If you choose to skip the remainder of the current waiting period instead, the workflow will revert to an "In Progress" status, as it moves on to any subsequent actions:
When any remaining actions have completed, your Workflow will update to display the appropriate status that represents the success or failure of your workflow as a whole.
Deactivating/Deleting a Paused Workflow
If you try to deactivate a Workflow that has instances in progress, they will not be stopped. The actions will still continue after the Waiting period has completed. You can still choose to stop or skip these actions before or after deactivating your Workflow.
It is not possible to delete a Workflow that has instances in progress. You will need to view the results and stop the individual instances before deleting.
- Conditions (IF) are only checked when a workflow first triggers. They will not be rechecked once your workflow resumes from a pause.
- A single workflow can support an unlimited number of "Wait for Duration" actions. However, the cumulative total of paused time supported in a single workflow is no more than 2 years (730 days, or 17,520 hours.)
- Paused days are measured from the exact time that the "Wait for Duration" action began, and are not measure by calendar day.
- If you choose to delete an existing workflow from within the Workflow Manager, you must first stop any instances that are currently paused.