← All guides

ServiceNow HR Onboarding and Offboarding with Lifecycle Events

Build ServiceNow HR onboarding and offboarding with lifecycle events: HR services, activity sets, trigger types, and checks that keep journeys on time.

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:

RecordWhat it isNotes
HR service (sn_hr_core_service)The entry point an HR agent or integration startsOne per journey, such as Onboarding and Offboarding
Lifecycle eventThe journey definition linked to the HR serviceHolds the event type, activity sets, and display options
Activity setA group of activities that start togetherEach set belongs to one lifecycle event and has one trigger type
Lifecycle event case (sn_hr_le_case)The running journey for one personThe 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 typeRuns whenTypical use
ImmediateThe lifecycle event case startsKickoff tasks, collecting missing data
DateA number of days before or after a date fieldEquipment before start date, access removal on last day
Other activity setsNamed activity sets are completeDay-one tasks that depend on account creation
CombinationA date, other activity sets, and conditions are all metProvisioning that needs both a date and an approval
AdvancedA trigger script returns trueRules 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:

  1. Prepare (Immediate): HR checks the hire data, the manager confirms role details and equipment.
  2. Identity (Date, before start date): create accounts and mailbox.
  3. Equipment and workplace (Date, before start date): order and ship hardware, assign a desk or badge.
  4. Access (Other activity sets, after Identity): request application entitlements that need an account to exist.
  5. Day one (Date, on start date): welcome tasks for the employee and manager.
  6. 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:

  1. Notify (Immediate): tell the manager, IT, and facilities, and confirm the last day.
  2. Knowledge transfer (Date, before last day): the manager reassigns open work and ownership of shared resources.
  3. Asset return (Date, before last day): arrange collection of laptop, badge, and other equipment.
  4. Access removal (Date, on last day): disable accounts and revoke entitlements.
  5. 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_ActivitySet scoped API in sn_hr_le includes hasActiveCaseByService for 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.

Frequently asked questions

How do lifecycle events handle ServiceNow HR onboarding and offboarding?

Each journey is an HR service linked to a lifecycle event. Starting the service creates a lifecycle event case in the sn_hr_le_case table, and the lifecycle event's activity sets create the tasks, HR cases, and requests for each team, released by their trigger type.

Which activity set trigger types are available?

Lifecycle Events supports Immediate, Date, Other activity sets, Combination, and Advanced triggers. Immediate runs when the case starts, Date runs relative to a date field, Other activity sets waits for named sets to finish, Combination mixes those conditions, and Advanced uses a script.

Why did my date-triggered activity set not run?

The most common cause is an empty trigger field. If the date field the activity set points to has no value, the set does not trigger. Waiting activity sets are also only re-evaluated on an interval, four hours by default, so a set can start a few hours after its date condition is met.

Should onboarding and offboarding share one lifecycle event?

No. Give each its own HR service and lifecycle event. They have different triggers, owners, and deadlines, and offboarding carries security work that should not wait on onboarding-style dependencies. Share reusable building blocks such as activity templates where it makes sense.

More practical ServiceNow notes.

Back to the guides