Run the jobs
The scheduled jobs that keep Intervals current, how to run one now, the one-off jobs you start, and who they run as.
Every Sojourn job runs as the admin who schedules or starts it, with that admin's access, and the Health Monitor shows each run. No job calls a service outside Salesforce. Schedule the jobs as a dedicated, long-lived Sojourn admin user rather than a person who may leave: if that user is deactivated, every run fails, and the Health Monitor says so and names the user.
Scheduled jobs#
Open Sojourn Settings, then Jobs under Operations. Each job has its own card with an On or Off pill, its last run, and its next one: Turn on schedules a job, Change saves a new interval or time, and Turn off stops it. A run that is still going when the next one is due is skipped. The Overview keeps one line saying how the jobs stand, for example "Live values On, every 15 minutes. Reconcile Off. Summaries On, daily at 01:00.", with Open Jobs.
| Job | When | What it does | Plan |
|---|---|---|---|
| Live values | Every 10, 15, 20, 30, or 60 minutes | Keeps minutes to date and breach flags current on open Intervals. On Plus, also writes the minute fields on records of objects with Write live values to the record on | Free and Plus; the minute fields are Plus |
| Reconcile | Daily, at the time you choose | Closes and flags every Interval of records that were deleted or merged, tracks records brought back from the Recycle Bin again, records values that changed without capture, and retries Limit and DML errors | Free and Plus |
| Summaries | Daily, at the time you choose | Counts closed Intervals into daily and monthly summary rows for reports. After it, purge runs when retention keeps a number of days | Free and Plus; purge is Plus |
Reconcile flags the closed Intervals of a deleted or merged record too, not only the open ones it closes. It reads them 2,000 at a time, one batch after another, for as long as the run has room, so one run flags them all for almost any record. A record with more than one run has room for is finished at the end of that run, when Reconcile looks again at the records it flagged, or by the next days' runs while the record is in the Recycle Bin.
When a record comes back from the Recycle Bin after Reconcile flagged it, its Intervals lose the flag and each Interval Reconcile closed at the deletion opens again, so the days in the Recycle Bin count in that value. Reconcile checks Closed at Deletion on the Intervals it closes, and only those open again: an Interval that had already ended stays ended, such as the owner stay of a record that was closed when it was deleted, or agent work that had finished. Summary rows only ever add, so for the 15 days a deleted record can be brought back, and one day more so the next Reconcile can open them again, Summaries and Rebuild summaries leave out the Intervals Reconcile closed at its deletion: once the 16 days have passed, each is counted as it closed, and if the record comes back, each is counted once, when it closes again. No stay is counted twice. Cases, Leads, and Opportunities are tracked again the moment they are undeleted; other objects at the next Reconcile, however many deleted records are still in the Recycle Bin, and a change made to such a record before then starts its Intervals again from that change.
Reconcile corrects Intervals that are open: a value that changed without capture closes the open Interval and opens the new value's. It never starts a field's first Interval, so a field with none, for example after a Fresh start, waits for its next change, and a blank field timed from its first value gets nothing until it has one.
How far back Live values reaches#
Live values refreshes open Intervals that started in the last 90 days, unless you change it. An Interval open longer than that keeps the minutes to date and breach flag of its last refresh, and so do the minute fields on its record: for a Case that has stayed in one status for four months, the Status Interval shows the minutes it had at 90 days, and a Goal it passes after that is flagged as a Breach only when the Interval closes.
To change the window, set Keep current for on the Live values card, from 1 to 365 days. The box shows the saved number, or 90 while none is saved, and its hint names the default; clear the box to go back to 90. The window saves with the card's Change, or Turn on when the job is off, before the schedule: a number outside 1 to 365 is refused with what to enter, and the schedule stays as it was. Turn off and Run now do not save it.
Run a job now#
Run now on a job's card starts one run of Live values, Reconcile, or Summaries straight away, as you, whether the job is scheduled or not. Its schedule stays as it is, and the run follows the same plan rules as a scheduled one: on the Free plan, a Live values run flags breaches and writes no minute fields. A notice says the run started, for example "Reconcile started.", and the Health Monitor shows the run. Run now is refused, with the reason, when:
- that job is already running: "Live values is already running."
- Salesforce already holds 100 batch jobs waiting to run, the most it allows: see When Salesforce already holds 100 batch jobs.
Jobs you start#
| Job | Started from | Plan |
|---|---|---|
| Catch up | Catch up on the Tracked objects list, after a pause | Free and Plus |
| Backfill | The Backfill tab of an object's screen; see Backfill past Intervals | History and Seed are Plus; Fresh starts no job |
| Purge now | Purge now on Retention and purge; see Keep or purge Intervals | Plus |
| Rebuild summaries | Rebuild on Summaries; see Summaries | Free and Plus |
One catch up and one purge run at a time across the org, and one backfill per object. A catch up and a backfill never run together: each is refused while the other runs. Catch up, Purge now, and Rebuild summaries run as batch jobs; Backfill runs as a chain of short jobs, one after another (see How a run works).
When Salesforce already holds 100 batch jobs#
Salesforce holds at most 100 batch jobs waiting to run, in the Apex flex queue, for the whole org: your own jobs and other apps' count too. Sojourn counts them before it starts any job, its scheduled runs and the jobs you start alike, and when 100 are waiting:
- A job you start from a screen (Run now, Catch up, Run backfill, Purge now, or Rebuild) is refused, and nothing starts or changes. The notice names the job, for example "Salesforce is already holding 100 batch jobs, the most it allows, so Reconcile cannot start now. Try again once some have run; Apex Flex Queue in Setup lists them."
- A scheduled run of Live values, Reconcile, or Summaries, and the purge that runs after Summaries, steps aside: it writes one row to the Error Log, for example "Reconcile did not start: Salesforce is already holding 100 batch jobs, the most it allows. The next run tries again.", and the next run tries again. The Health Monitor's Errors tab lists the row. While that row is open, later runs of the same job that step aside add no row, so a queue that stays full all day leaves one row per job, not one per run; once you resolve the row, the next run that steps aside writes a new one.
Apex Flex Queue in Setup lists the jobs that are waiting. Once some have run, Sojourn's jobs start again as usual.
Sojourn counts the queue and then starts the job, so two admins who start jobs at the same moment while 99 are waiting can both see room. The second start then fails with Salesforce's own message about the flex queue instead of Sojourn's; nothing is half-written, and you can start it again once some jobs have run.
After a sandbox refresh#
Salesforce does not copy scheduled Apex jobs when it creates or refreshes a sandbox, so in the new sandbox Live values, Reconcile, and Summaries are Off on the Jobs screen, and the Health Monitor shows each as a warning. Turn on the ones you want there, as a Sojourn admin of the sandbox. A job you turn on works on the sandbox's records only: Live values writes the minute fields on the sandbox's records, and a purge deletes the sandbox's Intervals, never production's.
A new or refreshed sandbox also sends only system email until you change its email deliverability in Setup, so the breach alert email does not go out from it until then.
Still to check in your sandbox, because it depends on the sandbox and on what it copied:
- The plan. On the Free plan, Sojourn Settings shows the Plus notices. If the sandbox shows them and production is on the Plus plan, tell us.
- The data. Which Intervals, summary rows, and purge files the sandbox holds follows its type and what it copies from production. The Usage card on the Overview counts what is there.
Before you uninstall#
Turn off every scheduled job first, on the Jobs screen. See Uninstall Sojourn.
Updated in release 1 This page changes in the same pull request as the feature it describes.