Wait blocks are used to pause a workflow until a period, which is specified by the user in the Wait block, expires.
Adding a wait block to a workflow
- Click Configuration > Workflows.
- Click a workflow. Alternatively, click Add to create a new workflow.
- Click the Blocks tab
.
- In the General section, drag and drop the Wait block onto the canvas.
Editing the wait block
To specify the time period, click Edit .
Figure 1: Specifying a wait period
You can manually enter values in the fields. Alternatively, you can use global variables.
Example 1
To standardize the wait period for types of workflows, you can create global variables.
Figure 2: Using a global variable to specify a wait period
For example, you can create a global variable called offboarding_wait_time_hrs and specify a value such as 6 and then insert the global variable in the Hours field in any workflow.
You can use global variables to specify wait periods in days, hours, and minutes.
Example 2
Figure 3: Using a workflow variable to store the wait period
In this offboarding type scenario, you want to deactivate an Okta user account and then delete it, But, before you delete the Okta account, you want to pause the workflow. And, depending on whether a checkbox is enabled or disabled in a user's record, apply a different wait period.
Adding a workflow variable
To store the wait period, you create a workflow variable:
- Click Variables
.
- Click ADD VARIABLE.
- Enter the name of the variable.
- Select Numeric (up to 20 digits) as the data type.
- Save your changes.
Result
The workflow variable is created. In this scenario, the name of the variable is Hold X Days.
Calculating the wait period
Before you pause the workflow, you calculate how long the workflow should be paused.
The wait period is determined by the value in the
extended_offboarding field in the user's record. This field is a custom field that was created for this use case.
Figure 4: Attributes of the Extended Offboarding field for the Users object
In the Update block called Calculate Hold Period, you create a coding field and reference the workflow variable, Hold X Days and then enter the following code to determine the wait period depending on whether the extended_offboarding field in a user's record is enabled (1) or disabled (0).
Figure 5: Screen capture of Calculate Hold Period update block
In this scenario, you apply a wait period of 90 days when the Extended Offboarding checkbox is enabled, and 30 days when the Extended Offboarding checkbox is disabled.
Comments
0 comments
Please sign in to leave a comment.