Task Dependencies can be used to prescribe the order in which the tasks should be completed on a project. With dependencies, it can also be helpful to incorporate emailed alerts to the project team members to notify them whenever their assigned tasks are ready to be worked on. More specifically, alerts that are sent to the task owners as soon as all the dependent predecessor tasks are marked as complete.
Such an automation can be configured in Flow. This automation will help your users easily stay up to date on their projects and quickly see the tasks that are ready to be worked on.
This article walks through all of the steps for sending task owners notifications when all dependent predecessor tasks are completed. At a high level, the steps are:
Step 1: Set Up Dependencies | Additional Details
In order for the automation to work, it is important that dependencies are enabled and set up correctly between tasks on your projects. You can read more about enabling and setting up dependencies in the Task Dependencies support article.
For some additional information: the automation in this article uses the Predecessor Tasks Incomplete "behind the scenes" checkbox field on the TaskRay Task object as a trigger/starting point. This checkbox dynamically reflects whether a task has any dependent predecessors, and whether those are completed or not. By design, this checkbox is set to 'true' whenever a task has direct dependent predecessors that are not complete. As soon as all the direct dependent predecessors are completed, the Predecessor Tasks Incomplete checkbox is automatically updated to 'false'. In this specific automation, the update of Predecessor Tasks Incomplete to 'false' is used as part of criteria to kick off the automation to send the email notification to the owners of tasks that are ready to be worked on.
Step 2: Create Email Template [Admin]
The next step of the process is to create the email template that would be used to notify task owners when preceding tasks are completed. For this purpose, it is necessary to create a Lightning Email Template.
- From anywhere in Salesforce, navigate to the App Launcher (icon located to the left of the navigation bar in Salesforce).
- Within the App Launcher, search for and navigate to Email Templates.
- Click on the New Email Template button.
- In the New Email Template modal, enter Email Template Name (e.g. "Task Ready for Work (Predecessor Tasks Completed)") and Description.
- For Related Entity Type, select TaskRay Task (this will allow referencing fields from the TaskRay Task object in the email).
- For Folder, select a public folder to store the new email template.
- Under Message Content, enter a Subject (e.g. "Task Ready for Work").
- In the HTML Value text box, enter the text for the body of the email. Sample text below:
Hi {{{TASKRAY__Project_Task__c.OwnerFirstName}}},
The task {{{TASKRAY__Project_Task__c.Name}}} is ready to be worked on because all the dependent predecessor tasks have been completed. Click on the task name to review its details and make the necessary updates.
Tip: In the sample text provided, to turn the task name into a hyperlink that takes users to the tasks in TaskRay, it is necessary to configure a dynamic URL. This is a sample URL that can be used, as long as you modify the domain (in place of YOUR-DOMAIN-HERE) to match your org's domain: https://YOUR-DOMAIN-HERE.lightning.force.com/apex/TASKRAY__trtaskboard?projectid={{{TASKRAY__Project_Task__c.TASKRAY__ProjectId__c}}}&taskid={{{TASKRAY__Project_Task__c.Id}}} - Click Save.
Step 3: Create Email Alert [Admin]
Now that you have a notification template, the next step is to create an Email Alert. The email alert is necessary for the Flow, as well as to specify who the alert should be sent to. In this case, it will be the TaskRay Task Owner of the task that is ready to be worked on.
- From Setup, navigate to Process Automation | Workflow Actions | Email Alerts.
- Click on New Email Alert.
- Enter a Description (e.g. "Notify Task Owner When Dependent Predecessors Are Completed"). The Unique Name field should populate automatically.
- For Object, select TaskRay Task.
- For Email Template, click on the lookup icon and select the Task Ready for Work (Predecessor Tasks Completed) template that you created previously (from the section above).
- Select Recipient Type. For Search, select Owner. This will filter the list of Available Recipients below. From the list, select TaskRay Task Owner and move it to the Selected Recipients section using the Add button.
- Click Save.
Step 4: Set Up the Flow to Send the Notification Email [Admin]
Next, you will need to build the process that would send the notification email to the task owner to let them know that their task is ready to be worked on.
Flow Overview
When you are done setting up the flow, it will look something like this:
Follow the steps in the sections below to configure the Flow.
Step 1: Create New Flow
- From Setup, navigate to Process Automation | Flows.
- Click on the New Flow button.
- In the New Flow modal, select the Record-Triggered Flow option.
- Click on Create.
Step 2: Configure Start and Entry Conditions
When setting up a new record-triggered flow, it is necessary to specify the object and criteria that will trigger the automated process. In this case, we will select the TaskRay Task object because that is where the Predecessor Tasks Incomplete checkbox is going to be updated.
- In the Configure Start modal, click into the Object field and search for TaskRay Task.
- For Trigger the Flow When select A record is updated.
- In the Set Entry Conditions section, for Condition Requirements select All Conditions Are Met (AND).
- For the condition, set the following:
- Field = TASKRAY__trPredecessorTasksIncomplete__c (Predecessor Tasks Incomplete)
- Operator = Equals
- Value = {!$GlobalConstant.False}
- For When to Run the Flow For Updated Records, select Only when a record is updated to meet the condition requirements.
- Leave the remaining options as-is and click Done.
Step 3: Set Up Email Alert Action
The next part of building the process is to define the actions that will take place when the automation runs. In this case, the action will be to send an email alert to the task owner whenever all the dependent predecessor tasks are marked as complete (indicated by the Predecessor Tasks Incomplete field on the task.
- On the Flow canvas, click on the Plus / Add Element icon below the Start element.
- Select the Action option.
- In the New Action modal, in the Action field, search for the email alert that you created previously (e.g. "Notify Task Owner When Dependent Predecessors Are Completed").
- Enter a Label and API Name.
- Under Set Input Values, for Record ID, select {!$Record.Id} (clickpath: $Record > Id).
- Click Done.
Step 4: Save and Activate the Flow
Now that the Flow is fully configured, it is time to save and activate it.
- In the top right corner of the Flow canvas, click on the Save button.
- In the Save the Flow modal, enter the Label (e.g. "Send Email to Task Owner - Predecessor Tasks Completed") and API Name.
- Click Save.
- In the top right corner of the Flow canvas, click on the Activate button.
Try It Out!
That's it! Now, every time a task is completed in TaskRay, the owner of the next dependent task will get an email notification to begin work.