Loading

FAQ on 'time-based' workflows

Дата публикации: Oct 13, 2022
Описание


You can define rules that trigger time-based workflow actions off any Date or Date Time field on an object. 

Example of time-based workflow:  Generate critical date reminders to remind Opportunity owners when a large Opportunity (amount greater than $1M USD) is 14 days away from the intended Close Date. Use the same rule to notify the executive sponsor and change the ownership of the Opportunity if the Close Date is just 10 days away.

Решение


Here's our top questions, tips, and considerations:
 

How do I create a Time-Based Workflow?

This feature leverages the existing Workflow engine, which includes two sections: Immediate actions and Time-dependent actions.

The basic rule configuration is the same, but for time-based rules, you configure time-triggers in the Time-dependent actions section. Each time trigger can execute one or more Workflow actions. Please review Add Automated Actions to Your Workflow Rule.
 

Can I have time-based workflows on custom objects?

Yes, and on any object currently supported by Workflow.
 

What units of time are supported?

Currently, days and hours are supported.
 

Can I have my time-based workflow action count only business days?

Standard functionality is based on all days and cannot exclude weekends.
 

How does time-based workflow impact my existing records?

Workflow rules are not triggered retroactively. If you create a rule now, the rules are not applied to previously created records.
 

  • Example: When you create an Opportunity reminder rule, it doesn't run against existing Opportunities. The new rule only applies to records created or updated after the rule is activated.
     

What workflow actions can I use with time-based workflow?

All existing actions will be available: Email Alerts, Field Updates, Tasks, and Outbound Messages.
 

Can I configure multiple actions to occur at different points in time for the same rule?

Yes, you can create a timeline of actions by configuring multiple time triggers and defining actions for each one.
 

  • Example: Consider a rule for all high value opportunities (value > $500K, probability > 70%). The immediate actions could include sending an email alerts to the Account team stating that a new high value Opportunity has been created. The time-dependent actions could include the following:
    • 10 days before the Opportunity close date, assign a Task to the Opportunity owner to follow up with the customer.
    • 7 days before Opportunity close date, change the owner of the Opportunity to VP Sales, and send an email alert to the new owner.

 

Are there any restrictions for time-based workflow?

Yes, it's not possible to configure a time-dependent workflow action that's set to evaluate criteria "Every time a record is created or edited."
 

Can I see which time-dependent actions are pending executions?

Yes, all pending actions to be triggered on a future date appear in the Workflow Queue. See Monitor Pending Workflow Actions.

System Administrators can view and manage the queue from:

Classic

  • Improved Setup Under Interface (Enabled): Go to Setup | Monitor | Time-Based Workflow
  • Improved Setup Under Interface (Disabled): Go to Setup | Administration Setup | Monitoring | Time-Based Workflow

Lightning

  • Improved Setup Under Interface (Both Enabled & Disabled): Go to Setup | Environments | Monitoring | Time-Based Workflow
 

Will the pending actions in the queue ALWAYS trigger?

No. Time-dependent actions remain in the Workflow Queue until processed or the rule criteria for the Workflow Rule are evaluated as "false." If a record no longer matches the rule criteria when the rule is evaluated, Salesforce removes the time-dependent actions queued for that record.
 

  • Example: An Opportunity Workflow Rule may specify:
    • A criteria set to "Opportunity: Status not equals to Closed Won, Closed Lost."
    • An associated time-dependent action with a time trigger set to 7 days before the Opportunity close date. If a record matching the criteria is created on July 1st and the Close Date is set to July 30th, the time-dependent action is scheduled for July 23rd. However, if the Opportunity is set to "Closed Won" or "Closed Lost" before July 23rd, the time-dependent action is automatically removed from the queue.
 

Can the pending actions for a record be queued again?

Yes, if the record is updated and you set the evaluation criteria to be "When a record is created, and anytime it's edited to subsequently meet criteria" (The record should not have previously met the entry criteria).
 

  • Example: If the Opportunity status is changed from "Closed Lost" to "Prospecting" and the Workflow rule evaluation criteria is set to "When a record is created, and anytime it's edited to subsequently meet criteria" (Assuming the record did not previously meet the criteria), Salesforce re-evaluates the time triggers and adds the appropriate actions to the Workflow Queue.

 

What if the evaluation criteria is set to "Only when a record is created"?

In this case, the Workflow rule evaluates the time triggers only once. If the record that fired the rule changes and no longer meets the evaluation criteria, the pending actions are removed from the queue and the rule is never reapplied to the record.

All pending actions are evaluated only for as long as the rule criteria is true. While Salesforce evaluates the rule every time the record is updated, it does not trigger all the actions associated with the rule every time.
 

  • Example: Consider two rules that are identical, except the evaluation criteria of Rule 1 is "On create only" and Rule 2 is "When a record is created, and anytime it's edited to subsequently meet criteria."
    • If you create a record that matches both rules, Salesforce executes the immediate actions and queues the time-dependent actions of both rules. If you then update the record and it no longer meets the rule criteria, Salesforce removes the pending actions for both rules. If you then update the record so it meets the rule criteria again, Salesforce only executes the actions associated with Rule 2.

 

What happens if I update the value of a date field used in a time trigger?

Salesforce recalculates the time trigger as long as the time trigger has not yet fired and the recalculation does not reschedule the time trigger to a date in the past.
 

  • Example: If a Workflow Rule alerts the Opportunity owner 7 days before the Opportunity Close Date and the close date is set to Feb 20, 2018, Salesforce sends the alert on Feb 13, 2018. If you update the Close Date to Feb 10, 2018 and the current date is Feb 2, 2018 (or before), Salesforce reschedules the alert for Feb 3, 2018. The evaluation date of pending actions is ALWAYS reevaluated and updated (if necessary) irrespective of the rule criteria. If the rule is evaluated to false, it won't matter as the actions are removed from the queue.

 

What happens if I delete a record that has pending actions?

The pending actions are deleted from the Workflow Queue and cannot be restored, even if you undelete the record.
 

Why do I get an error "Pending Workflow" when trying to convert a lead?

If there are any pending Approval Processes or Workflows to be triggered, you will not be able to convert a Lead. That said, you can remove the pending actions under Setup and the conversion will go through.

Learn more in the "Time Trigger Processing" section of Considerations for Time-Dependent Actions and Time Triggers.
 

How to retroactive trigger workflow rule on already existing records?

Get the full set of instructions in our Retroactively trigger workflow on current records help article.
 

Why do time-based workflow actions not always executing at the exact time displayed?

This is standard behavior. Time based workflow actions will not always execute at the exact time displayed in the Monitoring setup menu. Please review Time Based Workflow Execution interval is 15 minutes.

Номер статьи базы знаний

000385301

 
Загрузка
Salesforce Help | Article