Skip to content
Employment status refresh

Employment status refresh

Keeps each employee’s employment status — Active, Pending or Inactive — in step with the calendar.

How it works

An employee’s status depends on today’s date: they are Pending before their employment starts, Active while it runs and Inactive once it has ended. The employee list stores that status so it can be filtered quickly, and nothing else recalculates it when only the calendar moves. Without this job, a new starter stays Pending and a leaver stays Active until somebody edits them.

Each night the job picks the employees with an employment that started, or ended, since its last finished run — on its very first run, every employment that has started. For each of them it recalculates the employee’s entry in the employee list — status, current team, manager and employment terms — and updates who counts as a manager, since only active employees make someone a manager. Employees it could not refresh are tried again on the next run, and a missed night is caught up on the next one.

It runs first in the nightly batch, so the other jobs that night already see today’s statuses. That matters beyond the list: active employees are the ones considered as approvers, get timesheet periods and automatic registrations, and are excluded from data-retention clean-up.

When it runs

Daily. It only triggers when an employment has started or ended since the last run, or when the last run left employees to retry.

Parameters

This job has no parameters.

Job results

MetricDescription
refreshedEmployees whose entry was recalculated
failed_idsEmployees that could not be recalculated — retried on the next run
sinceRun date of the previous run the window started from (absent on the first run)

Troubleshooting

IssueSolution
A leaver still shows as ActiveCheck the end date on their employment. The status changes the night after the end date has passed — the end date itself is still a working day
A new starter still shows as PendingThe status changes on the night of their start date. Check that the start date is right
A run for a future date failsExpected. The status is always worked out from today, so the job refuses a run date that has not arrived yet