Task rules allow you to add conditional tasks to a workflow based on specific criteria, such as anticipated spend or responses in a request form. This guide provides examples to help you customize your workflow using task rules.
Example Scenario: Conditional Approval Tasks
In this example, you will use task rules to include different approval tasks based on the requesting department. For instance, if the request is from the PeopleOps department, Mary Moe will approve it. Otherwise, Jane Doe will approve it.
You can use this example as a starting point for creating your own task rules and workflows.
Step 1: Assign a Purchase Category to Your Workflow
To begin, assign a purchase category to your workflow. This allows you to pull questions and answers from the category’s request form.
- For a New Workflow: Use the Purchase Category (optional) dropdown in the Add a New Workflow modal.
If you’re editing an existing workflow, follow these steps:
- Open the workflow in Workflow Studio.
- Click the ellipsis [...] next to the workflow you're editing
- Select Edit Workflow Details.
- Select a category using the Purchase Category dropdown.
- Click Save.
Step 2: Add a Conditional Approval Task
Now, add an Approval task that includes a task rule. This rule will trigger the task for requests from a specific department, such as PeopleOps.
- Open the workflow in Workflow Studio.
- If starting from a blank workflow, click Add a Task.
- If starting from an existing task, click one of the Add a Task icons.
- In the Add Tasks sidebar, select Approval as the Task Type.
- Provide a Task Name.
- Scroll down to Rules section and click View dropdown.
- Under Include this Task, select When.
- Select Request Form Question.
- In Search for a question, select Select a department. This question is included in all request forms.
- In Select an answer, select a department, such as PeopleOps.
-
Under Due Date & Assignment, assign the task using the fields.
-
Note: Task durations are counted in calendar days, including weekends and holidays.
-
- For example, you can select Teammate and select an Assignee to assign the task to a specific approver.
- Fill out the remaining fields for the task as desired. Then click Add Task.
- The task appears in your workflow. The task includes an Include based on Request Form answer tag to indicate it’s conditional.
Step 3: Add a Parallel Conditional Task
Add another Approval task to the workflow. This task will run in parallel to the previous one and work similarly. However, this task’s rule only includes the task for requests outside the department.
- In the same workflow, click the task you previously added.
- Click the Add a Task icon at the bottom of the task.
- In the Add Tasks sidebar, select Approval as the Task Type.
- Enter a Task Name.
- Click View next to Rules.
- Under Include this Task, select When.
- Select Request Form Question.
- In Search for a question, select Select a department.
- In Select an answer, select every department except the department you selected for the previous task rule. For example, if you previously selected PeopleOps, select every department other than PeopleOps.
- Under Due Date & Assignment, assign the task using the fields.
- Fill out the remaining fields of the task as desired. Then click Add Task.
- The task appears in your workflow. Like the previous task, the task includes an Include based on Request Form answer tag to indicate it’s conditional.
Step 4: Configure the Next Task
Add a task that immediately follows the two conditional tasks. Configure this task to open if either task is completed.
- In the same workflow, click one of the Approval tasks you added previously.
- Click the Add a Task icon to the right of the task.
- In the Add Tasks sidebar, click Add Trigger. Add both of the previous Approval tasks as triggers.
- Select the ALL trigger. This ensures the workflow doesn’t unintentionally skip tasks.
- Select a Task Type, add a Task Name, and assign the task.
- Fill out the remaining fields of the task as desired.
- Click Save Task.
Congratulations! You’ve used task rules to conditionally include Approval tasks based on a request’s department.