function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JMThorntonJMThornton 

Time-Based Workflow Hourly Limit Workaround?

Hello,

 

We're running into a problem where when we're loading lists of Leads and converting Lead --> Account we're running into the time-based workflow hourly limit (500 per hour.)

 

Our current design has as many as 4 workflows which may fire when a contact is either merged or created. The workflows fire on this schedule: 1 workflow at 0 hours, 2 workflows at 1 hour, 1 workflow at 2 hours.

 

Whenever we have a decent sized list of Leads (a few hundred) it runs into this issue. Any workflows above the 500 limit are then pushed to the next hour. 

 

First question: Are the workflows that are pushed off to the next hour still going to be run in chronological order? It seems that they are not because we're seeing workflows updating out of order causing data issues.

 

Second question: Is there any workaround to subvert the 500 per hour limit? Is there someway to do this programmitcally with an APEX trigger or something of the like? Can we time field updates in the future via APEX without utilizing workflows?

 

Thank you for your assistance!

-Jon

Cory CowgillCory Cowgill

You may be able to accomplish similar functionality with Schedule Apex and Batch Apex, although this will require custom code as opposed to declaritive setup. Batch Apex can process up to 50 million records.

 

You could change yoru process so that the workflow updates a boolean field on the newly creater Contact or merged contact. The workflow could update a field on the contact called "batchReady".

 

Setup an Apex Batch job which will process all Contacts where BatchReady == true. In the Apex Batch Job do whatever processing on the records that you need to do, and set the field BatchReady == false so it won't be picked up by the batch again.

 

Finally, if you have Batch Apex job which is working, use create an Apex Schedule class which will execute the Batch Job every hour.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm