Lifecycle Events evaluation interval
Summarize
Summary of Lifecycle Events evaluation interval
This content explains how Lifecycle Events in ServiceNow handle the automatic triggering of timers within workflows, specifically focusing on activity sets and their evaluation intervals. It highlights the default behavior, options for immediate triggering, and configurable settings that impact how quickly activity sets are evaluated and triggered.
Show less
Activity Set Triggering Methods
- Activity sets can be triggered in various ways: immediately, by date, by trigger script (advanced), by conditions (based on table fields), or by a combination of these methods.
- When triggered by other activity sets, dependencies must be resolved before activation.
HR Activity Launcher Flow and Evaluation Interval
When a lifecycle event case changes to the Ready state, all activity sets are processed through the HR Activity Launcher flow; however, activities within sets are not triggered immediately.
If an activity set has no dependencies, its trigger conditions are checked. If conditions are unmet, it waits for a "Wait to reevaluate Trigger Script" timer (default every four hours). Even if conditions are met after an evaluation, the next check waits for the full interval, potentially causing delays.
The timer uses the snhrle.All activity set closure timer field to determine evaluation frequency. Administrators can reduce this default four-hour interval to trigger activity sets sooner but should do so cautiously to avoid excessive event triggering and potential cancellations.
Alternative Triggering with Condition with Event BR (Demo) Activity Set
- Included as demo data, this activity set demonstrates using server-side code (business rules, event scripts, scheduled jobs) to trigger the checkactivitysettrigger event.
- This event invokes the HR Activity Set Trigger Check workflow to evaluate whether an activity set should trigger immediately, bypassing the default evaluation interval.
- The activity set trigger type must be set to Condition for this method.
- Activation of the Human Resources Scoped App: Lifecycle Events for Enterprise (plugin com.snhrlifecycleent) is required to access this demo activity set.
- The Condition with Event BR (Demo) business rule listens for lifecycle event case state changes to "Work in Progress" and triggers the evaluation event.
- This setup is customizable to fit specific requirements.
HR Activity Set Trigger Check Workflow
This workflow is integrated within the HR Activity Launcher to allow server-side scripts to prompt immediate evaluation of activity sets. It does not directly trigger activities but checks if conditions are met to proceed sooner than the scheduled evaluation interval.
If the checkactivitysettrigger event fires, the workflow immediately assesses trigger conditions to reduce delays.
Administrative Controls
- Administrators can modify the default evaluation interval duration to shorten or extend the wait time before activity sets are checked again.
- Adjusting these settings impacts how quickly activity sets respond to changes but requires careful consideration to avoid workflow interruptions.
Practical Application for ServiceNow Customers
- Use the default evaluation interval for standard timing of activity set triggers to ensure stable execution.
- Implement the Condition with Event BR (Demo) activity set or customize server-side scripts to achieve faster evaluation and triggering of activity sets when immediate response is critical.
- Manage dependencies carefully when using activity sets triggered by other sets to prevent blocking.
- Adjust the activity set closure timer with caution to balance responsiveness with system performance and workflow integrity.
There is a mechanism available to ensure timers within a workflow trigger automatically rather than wait for the evaluation interval to trigger.
- Immediately
- By a date
- Trigger script (advanced)
- Conditions (fields from a table)
- Combination or different trigger types
- *Other activity setsNote:For more information on activity set triggering, see Configure a lifecycle event activity set and Lifecycle Events workflows.
*When an activity set is triggered by other activity sets it must wait for all dependencies to resolve before triggering.
HR Activity launcher flow
When a lifecycle event case is changed to the Ready state, all activity sets run through the HR Activity Launcher flow. The activities in each activity set are not triggered at this time. When an activity set is not dependent on other activity sets to trigger activities, the trigger conditions are analyzed.
If the trigger condition has not been met, it waits for the Wait to reevaluate Trigger Script timer to run (default is every four hours).
If the trigger condition is met, but after the evaluation interval runs, it has to wait another four hours before the activities set is re-evaluated. This can cause delays in an activity set to trigger.
The Wait to reevaluate Trigger Script timer uses the sn_hr_le.All activity set closure timer field under Lifecycle Event Properties to determine when to evaluate the activity set. The default value is four hours.
Condition with Event BR (Demo) activity set
- The trigger type for the activity set must be set to Condition.
- The Condition with Event BR (Demo) activity set triggers when the state of primary lifecycle event case moves to Work in progress.
- The Email - Condition with Event BR (Demo) activity is included with the Condition with Event BR (Demo) activity set.
- The Condition with Event BR (Demo) activity set contains the
HR Activity Launcher workflow. It also contains the
Condition with Event BR (Demo) business rule.
- The Condition with Event BR (Demo) business rule runs after the state of an LE case changes to Work in Progress.
- It then looks for the workflows that are running for the LE case until it finds the HR Activity Set Trigger Check workflow and broadcasts the check_activity_set_trigger event to that workflow.
- You can modify the Condition with Event BR (Demo) activity set,
Email - Condition with Event BR (Demo) activity, and
Condition with Event BR (Demo) business rule to fit your
requirements.Note:For more information, see Lifecycle Events workflows and Business rules.
HR Activity Set Trigger Check workflow
- The HR Activity Set Trigger Check workflow is called when an activity set is not dependent on other activity sets.
- It periodically checks if the trigger condition for an activity set has been met.
- If the trigger conditions have not been met, it still waits for the evaluation interval to run.
- If the check_activity_set_trigger event fires, the Activity set trigger conditions are checked immediately.