Next Tutorial: Patching Bugs In Other Automation With Spigots
π§ Overview
Salesforce’s native job scheduler is limitedβyou can only run scheduled jobs once per hour using standard Cron expressions. This creates bottlenecks, especially when near real-time automation is needed.
Spigots removes this limitation by allowing jobs to run as often as once a minute (or even faster), enabling a whole new class of fast-reacting, data-driven automations.
π« Native Limitation: Salesforce Scheduler
- Standard scheduled jobs (like those used by DLRS) must run on a fixed schedule.
- Fastest interval: once every hour
- This delay limits the freshness of calculated data (e.g. rollup summaries)
- Real-time mode is error-prone (due to governor limits or transaction rollbacks)
β Spigots Solution: Always-Running Spigots
Spigots introduces atomic, composable automation units that can be:
- Always running
- Executed based on real-time conditions (e.g. if data exists to process)
- Scheduled independently of native Salesforce limitations
π§© Example: DLRS Rollup Every Minute
To run DLRS rollups more frequently, we define a Spigot like this:
Spigot:
Name: Run DLRS Rollup Job
Schedule: Always Running
Inputs:
Object: dlrs__RollupSummaryScheduleItem__c
Limit: 1
Actions:
Name: Trigger DLRS Job
Type: Spex
Subtype: Batchable
Function: RollupJob
Namespace: dlrs
π How It Works
- Every minute (or at a configurable interval), Spigot App Configurantions run and evaluates the ‘ready to run’ Spigots.
- If there’s at least one DLRS job waiting (via the
dlrs__RollupSummaryScheduleItem
__c object), it triggers thedlrs.RollupJob
Batch Class. - This results in DLRS rollups executing roughly once a minute, instead of once an hour.
π Benefits of Frequent Scheduled Jobs in Spigots
Benefit | Description |
---|---|
π Fresh data | Your rollup fields (e.g. Last Call Time ) updates quickly, improving automation accuracy |
π₯ No governor errors | Avoids real-time DLRS mode, reducing risk of rollback errors |
π§ Simple setup | Just define a Spigot — no special cron expressions or Apex scheduling needed |
π§ͺ Example Use Case: Lead Outflow
With this Spigot running every minute:
- A completed call Task logs on a Lead
- DLRS updates the
Last Call Time
field within 1β2 minutes - A downstream Spigot evaluates if the Lead qualifies for outflow, which depends on Last Call Time.
- All fully automated, nearly instant, and guaranteed to be correct
π§΅ Summary
Spigots supercharges scheduled jobs in Salesforce by:
- Letting you define event-driven or high-frequency Spigots
- Eliminating reliance on hourly cron-based limits
- Unlocking near-real-time rollups and workflows, safely and scalably
Leave a Reply