Getting Started with Process Builder – Part 2 (Adding a Time-dependent Action)

Getting Started with Process Builder – Part 2 (Adding a Time-dependent Action)

Last Updated on November 24, 2020 by Rakesh Gupta

Big Idea or Enduring Question:

How do you schedule a time-based action using Process Builder?

Objectives:

After reading this blog, you’ll be able to: 

  • Understand the basic of scheduling an action using Process Builder 
  • Learn how to automate the process which requires users to perform certain activity after x Hours or Days

Business Use case

Corey Eridon is working as a System Administrator at Universal Containers (UC). He received a requirement to auto-update Asset Description (with the sentence “Update the Serial Number “) field after 1 day of its creation if Asset’s Serial Number is blank.

Automation Champion Approach (I-do):

Workflow Rule allows you to update the fields from the same object or parent object (In the case of master-detail relationship only). Whereas Process Builder allows you to update the record from the same object or records from the child object or records from the parent object (either Master-detail or Lookup relationship). 

As we are moving away from the Workflow Rule, Corey should use Process Builder. 

Before we dive into the solution to help Corey, though, we need to first understand what is Process Builder and its components. 

The solutions involve two steps.

  1. Ensure that the process builder is fired when the Serial Number field is blank on the Assets record. 
  2. Use the Update records action to update the assets description whenever a specified criteria is met. 

Let’s begin building this automation process.

Guided Practice (We-do):

There are 6 steps to solve Corey’s business requirement using Process Builder. We must: 

  1. define process properties
  2. define evaluation criteria
  3. define process criteria
  4. set time for actions to execute
  5. add action – update records
  6. Check paused flow interviews

Step 1: Define Process Properties

  1. Click Setup.
  2. In the Quick Find box, type Process Builder.
  3. Select Process Builder, then click New.
  4. Name the Process and click the Tab button. The API Name will populate. 
  5. As a best practice, always input a description
  6. The process starts when A record changes.
  7. Click Save.

PB Blog - 3

Step 2: Define Evaluation Criteria

  1. Click on the Add Object node to begin selecting the evaluation criteria.
  2. Select the Asset object from the dropdown list.
  3. Start the process when a record is created or Edited.
  4. Click Save.Pb Blog - 3.2

Step 3: Define Process Criteria

  1. Click the Add Criteria node to begin defining the process criteria.
  2. Name the criteria.
  3. The criteria should execute actions when the conditions are met.
  4. Set Conditions
    1. Field: Asset | Serial Number
    2. Operator: Is null
    3. Type: Boolean
    4. Value: True
  5. Select All of the conditions are met (AND)
  6. Make sure to select Do you want to execute the actions only when specified changes are made to the record? checkbox. 
  7. Click Save.

PB Blog - 3.3

Step 4: set time for actions to execute

  1. Below Scheduled Actions, click Set Schedule.
  2. Set Field Values:
    1. Row 1:
      1. 1
      2. Days
      3. After
      4. CreatedDate
  3. Click Save.

PB Blog - 3.4

Step 5: add action – update records 

  1. Below 1 Day After CreatedDate Scheduled Actions, click Add Action.
  2. For Action Type, select Update Records
  3. Name the action.
  4. Select the option Select the Asset record that started your process record type. 
  5. Select the Asset record type. 
  6. Criteria for Updating Records: No criteria – just update the records!
  7. Set Field Values:
    1. Row 1:
      1. Field: Description
      2. Type: String
      3. Value: Update the Serial Number
  8. Click Save.

PB Blog - 3.5

Almost there! Once everything looks good, click the Activate button. Moving forward, an asset will be automatically updated after one day of its creation if the Serial Number remains blank. 

Step 6: Check paused flow interviews 

  1. Click Setup.
  2. In the Quick Find box, type Paused Flow Interviews.
  3. Now you will see all action waiting for execution. 

PB Blog - 3.6

Note:- Before you activate your process, you will want to make sure that you have assigned data in the correct format because Process Builder obeys validation rules. If some fields are required by using validation rules, then make sure you have added those fields. Conversely, if some fields are required on the page layout, you can ignore those fields. 

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Note: –  I am grateful to Copado, Docomotion, FormAssembly, OwnBackup, and Conga for sponsoring my blog.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

25 thoughts on “Getting Started with Process Builder – Part 2 (Adding a Time-dependent Action)

  1. Hi Rakesh,

    We have a limit that the total number of flow interviews that are executed per hour is 1000.

    If flow interviews are more than 1000, then I believe they will be queued and gets executed in the next hour. My question is- can I view these pending interviews also in ‘paused and waiting interviews’ section? or is this section only for time based scheduled actions ?

    1. Ideally, it should be queued and gets executed in the next hour (I will suggest you, get in touch with Salesforce support for more details)
      I think yes, you can view in ‘paused and waiting interviews’ section

      1. Thanks for the reply.
        Can you also tell me if there is any way we can figure out the start and end time of a running process?

  2. Hello Rakesh, Really Appreciate your work in the automation concepts of the platform. I would like to know if the time dependent actions that are created on Process builder and on workflow behave differently. I have tried looking up on forums but didn’t find a clear answer for that. Any help or Information would be really helpful.

      1. I remember while studying about the differences about workflows and process builder that they behave a bit differently when it comes to time dependent actions. I don’t exactly remember the article or the blog where I read that. I just wanted to know if they behave in the same way or differently. As this blog has in detail content about automation in salesforce, I thought you are be the right person to shoot this question to.

  3. Hi, Firstly I love your contribution to the Salesforce community. I come here for inspiration and ideas!

    So I am trying to contribute myself. I had a great idea to allow admins to schedule repeating process builds/workflows by using the scheduled report feature.

    Declarative Scheduler – use the reporting engine and subscribe feature to update records in report on a daily/weekly/monthly schedule. I have created a generic apex class to help admins tackle this problem. It utilises reports to define, filter and schedule updates. 

    -Create a report with the record id in column 1 and a datetime field in column 2
    -Add the filters you like
    -Click subscribe. Then select a custom action.
    -Set up when you would like these records to update and then schedule away
    -On the scheduled time the datetime field will be updated.
    -Set up a process builder to fire when that field changes. And voilla you have a repeating schedule.

    See the first draft here. I would love your ideas and suggestions:
    https://github.com/dthowell/DeclarativeScheduler

  4. Hi Rakesh,

    What if Criteria changes while a Flow is paused? Is it supposed to cancel it (like it would for a time-based workflow rule)?

    I am using Process Builder to send Email Alerts 7 days after criterias are met, and Email Alerts are still getting sent even when the criteria changes between day 1 and 6 and no longer meet the rules.

    Thanks!

    1. • For processes that are set to run when a record is created or edited, scheduled actions remain in the queue only as long as the criteria for those actions are still valid. If a record no longer matches the criteria, Salesforce removes the scheduled actions for that record from the queue.
      • For processes that are set to run when a record is created, Salesforce never reevaluates the record with that process. Scheduled actions remain in the queue, even if the record no longer meets the associated criteria when the scheduled actions are executed.

  5. Hi,

    I did exactly the same. My time based action was to kick in after 4 days on cases, if the status is still New. I am posting a chatter notification. I did a test run in my sandbox, and it worked well, for all cases! But in production, it stopped working. As in all the cases were created and had a status change in the next 2 days of creation, but the time based action still kicked in. Isn’t it supposed to be deleted once it is out of the criteria (just like time based WFR)? Please help, because it did work in my sandbox, and not in production it did not, and it has alerted a bunch of users unnecessarily.

      1. Please go through this article
        https://help.salesforce.com/articleView?id=process_limits_scheduled.htm&type=0&language=en_US

        –> For processes that are set to run when a record is created or edited, scheduled actions remain in the queue only as long as the criteria for those actions are still valid. If a record no longer matches the criteria, Salesforce removes the scheduled actions for that record from the queue.

        –>For processes that are set to run when a record is created, Salesforce never reevaluates the record with that process. Scheduled actions remain in the queue, even if the record no longer meets the associated criteria when the scheduled actions are executed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.