ServiceNow HR onboarding and offboarding are both built on Lifecycle Events, part of HR Service Delivery. You create an HR service for each journey, link it to a lifecycle event, and split the work into activity sets that release tasks to HR, IT, facilities, and the manager at the right time. Onboarding usually keys off the start date. Offboarding keys off the last working day and has less room for delay, because unrevoked access is a security problem, not just a poor experience.
This guide covers the mechanics: how the pieces fit, which trigger types to use for each journey, and how to find journeys that have stalled. For the process and data decisions that come before configuration, read HRSD employee onboarding best practices first.
How the pieces fit
Four records do most of the work:
| Record | What it is | Notes |
|---|---|---|
HR service (sn_hr_core_service) | The entry point an HR agent or integration starts | One per journey, such as Onboarding and Offboarding |
| Lifecycle event | The journey definition linked to the HR service | Holds the event type, activity sets, and display options |
| Activity set | A group of activities that start together | Each set belongs to one lifecycle event and has one trigger type |
Lifecycle event case (sn_hr_le_case) | The running journey for one person | The parent of the tasks and cases created by activities |
The person the journey is about is the subject person, a reference to sys_user. The case is usually opened by HR or an integration on behalf of that person, so the opener and the subject person are often different users.
Lifecycle Events requires the HR Lifecycle Events plugin (com.sn_hr_lifecycle_events), and its records live in the sn_hr_le scope. Most tables are protected by HR roles, so you need an HR admin role to configure and query them.
Activity set trigger types
The trigger type decides when an activity set releases its activities. Picking the right one matters more than any script you write.
| Trigger type | Runs when | Typical use |
|---|---|---|
| Immediate | The lifecycle event case starts | Kickoff tasks, collecting missing data |
| Date | A number of days before or after a date field | Equipment before start date, access removal on last day |
| Other activity sets | Named activity sets are complete | Day-one tasks that depend on account creation |
| Combination | A date, other activity sets, and conditions are all met | Provisioning that needs both a date and an approval |
| Advanced | A trigger script returns true | Rules the other types cannot express |
Two behaviours catch teams out:
- A Date trigger needs a value. If the trigger field is empty, the activity set does not run. It does not fail loudly either. The set just waits.
- Waiting sets are re-evaluated on an interval. The default is four hours. A set whose condition becomes true at 09:05 might not start until early afternoon. Plan due dates with that delay in mind instead of assuming instant release.
Prefer Immediate, Date, and Other activity sets. They are visible on the form and easy for the next administrator to follow. Use Advanced only when you have to, and keep the script short.
Design the onboarding journey
A workable onboarding lifecycle event usually has five or six activity sets:
- Prepare (Immediate): HR checks the hire data, the manager confirms role details and equipment.
- Identity (Date, before start date): create accounts and mailbox.
- Equipment and workplace (Date, before start date): order and ship hardware, assign a desk or badge.
- Access (Other activity sets, after Identity): request application entitlements that need an account to exist.
- Day one (Date, on start date): welcome tasks for the employee and manager.
- First weeks (Date, after start date): training, policy acknowledgements, check-ins.
Keep Identity and Equipment as separate sets running in parallel. Chaining everything in sequence makes one late task delay the whole journey.
Fulfilment that crosses into IT, such as provisioning through a catalog item, usually runs in Flow Designer. Follow the Flow Designer best practices for error handling and keep each flow focused on one outcome.
Design the offboarding journey
Offboarding uses the same engine with different priorities. The last working day is the anchor, and the order of work is driven by risk:
- Notify (Immediate): tell the manager, IT, and facilities, and confirm the last day.
- Knowledge transfer (Date, before last day): the manager reassigns open work and ownership of shared resources.
- Asset return (Date, before last day): arrange collection of laptop, badge, and other equipment.
- Access removal (Date, on last day): disable accounts and revoke entitlements.
- Final checks (Other activity sets, after Access removal and Asset return): HR confirms everything is closed.
Offboarding needs extra care in three places:
- Changing last days. Last days move more often than start dates. Test what happens to activity sets that have not triggered yet when the date field changes on your release, and include it in your test plan.
- Immediate exits. For a same-day departure, a Date trigger set to the last day might still wait for the next evaluation cycle. Give HR a separate service or a clear manual path for urgent exits rather than relying on the normal journey.
- Rehires and transfers. A person can have a closed offboarding case and a new onboarding case. Make sure your integration checks for an existing active case for the same person and service before creating another. The
hr_ActivitySetscoped API insn_hr_leincludeshasActiveCaseByServicefor this check.
Find stalled lifecycle event cases
Journeys rarely fail with an error. They stall: a date field was never filled in, a dependent set never completed, or a task sits with a group nobody watches. A short read-only report catches most of these.
Run this in Scripts - Background on a sub-production instance with an HR admin role, in the Lifecycle Events application scope (sn_hr_le). It only reads records.
// Read-only: report active lifecycle event cases older than a threshold,
// grouped by HR service, then list the oldest ones.
var DAYS_OPEN = 30;
var LIMIT = 20;
var agg = new GlideAggregate('sn_hr_le_case');
agg.addActiveQuery();
agg.addQuery('opened_at', '<', gs.daysAgoStart(DAYS_OPEN));
agg.addAggregate('COUNT');
agg.groupBy('hr_service');
agg.query();
gs.info('Active lifecycle event cases opened more than ' + DAYS_OPEN + ' days ago:');
while (agg.next()) {
gs.info(' ' + agg.hr_service.getDisplayValue() + ': ' + agg.getAggregate('COUNT'));
}
var le = new GlideRecord('sn_hr_le_case');
le.addActiveQuery();
le.addQuery('opened_at', '<', gs.daysAgoStart(DAYS_OPEN));
le.orderBy('opened_at');
le.setLimit(LIMIT);
le.query();
while (le.next()) {
gs.info(le.getValue('number') +
' | ' + le.hr_service.getDisplayValue() +
' | subject: ' + le.subject_person.getDisplayValue() +
' | state: ' + le.state.getDisplayValue() +
' | opened: ' + le.getValue('opened_at'));
}
For each case it lists, open the activity sets related list and look for sets still waiting to trigger. A waiting Date set with an empty trigger field is the usual culprit. Thirty days is a starting point. Onboarding journeys with a first-weeks set will legitimately run longer, so tune the threshold per HR service.
To find the individual tasks that are late rather than whole journeys, adapt the overdue active tasks report to the HR task table. For more on keeping queries like these fast, see the GlideRecord query performance guide.
Protect HR data in fulfilment tasks
Activities often create work for teams outside HR. A facilities fulfiller needs a name, location, and date. They do not need compensation or home address details. Keep the descriptions on activity templates limited to what the fulfiller needs, and check that notifications and work notes do not copy sensitive fields.
Test access by impersonating each role that touches the journey: HR agent, manager, IT fulfiller, facilities fulfiller, the subject person, and an unrelated employee. When something is visible that should not be, the ACL troubleshooting guide walks through finding the rule responsible.
Pre-go-live checklist
- Separate HR services and lifecycle events for onboarding and offboarding
- Every Date trigger points at a field your integration always populates
- Independent activity sets run in parallel, not chained
- Due dates allow for the activity set evaluation interval
- An urgent exit path exists that does not wait on the normal journey
- Integrations check for an existing active case before creating one
- Start date and last day changes tested on journeys already in progress
- Fulfilment task descriptions contain only the data each team needs
- Access tested by impersonating every role in the journey
- A scheduled review of stalled cases, owned by a named team
Regression testing pays off here, because a small change to one activity set can shift every journey. An ATF regression suite that starts a test onboarding and offboarding case and checks which sets trigger gives you a quick safety net before each release.