On the first of January we had an issue where a lot of Contracts passed their end date. This caused a time-dependent workflow to fire, but there were so many occurrences (15000+) that it took a very long time. In the future we expect this number to increase greatly.
I'm wondering whether my plan to use the Apex Scheduler and turn this into a (reoccurring) batch job is a good idea? And in a more generic sense, what would determine whether to use a time-based workflow or a batch job for actions like these?
Best Answer
Scheduled apex jobs are the only time-based alternative for time-based workflows within the SFDC platform currently. So your idea of moving to scheduled apex is the way to go.
As a general way of making the decision between the 2, I'd say use time-based workflow unless you run into its limitations, including (but not limited to) the following:
https://help.salesforce.com/HTViewHelpDoc?id=workflow_time_action_considerations.htm&language=en_US