Lifecycle Event (LE) FAQDescriptionLifecycle Event (LE) FAQ Product Documentation: Enterprise Onboarding and Transitions LE Lifecycle Event Best Practices and Performance Expectations: KB1307612 (Lifecycle Event Best Practices and Performance Expectations) Troubleshooting tips: One of the best ways to troubleshoot any LE issue is to check the LE workflow execution and the activity set execution contexts ("Show Workflow" and "Activity Set Execution" related links on the LE case). Also, each of the activity sets has an associated activity set context which shows you all the workflow activity history - this gives you a pretty good picture of what was happening in the LE workflow. . Frequently asked questions: 1. Why is the Activity Set stuck and not progressing (activities were not launched) even though the trigger condition is met? Possible reasons: 1. The LE configuration is changed while there are existing LE cases with the same LE type. E.g. The Activity Set trigger type is changed from "dependent on other activity set" to advanced. LE cases created before this change would have their activity set workflow context waiting for the parent activity set to finish. So the activity set won't trigger even if the advanced script returns true. A possible workaround is to manually error out the activity set and resume the LE case. Note: This is just a possible workaround and is not the intended use case of the Resume functionality. Also, this won't work if the activities are already completed or the tasks are already created. Test out a couple of LE cases before applying this workaround to all the affected cases. And this should be tested in sub-prod before performing this in prod. Note: Use caution when changing the following activity set configurations: AudienceTrigger typeAdding new activities to an activity set The changed configuration will not be picked by existing LE cases in the following situations: Activity sets that are already triggered Activities that are already generatedActivities that are already completed Only activity sets, activities, or LE cases that have not yet been triggered will use the new configurations. Thorough testing is strongly recommended in a sub-production instance if you decide to modify any of the above configurations while having existing LE cases. 2. Customization Check if there's any customization done to any LE workflow activities or related Script Includes. Also modifying any script include might cause RCA records to become invalidated. Check if there are any related invalidated RCA records and allow them as appropriate. 3. Misconfiguration E.g. 1. Create a new Activity Set AS2 with trigger = Activity Set AS12. Deactivate AS13. Test the LE>> AS2 will remain in 'Awaiting Trigger' indefinitely (*or for 5000 WF executes, and then it gets Cancelled) Root cause: this is a wrong configuration: If AS1 is deactivated, trigger type of AS2 should not be dependent on AS1. It should be made immediate. 4. Small evaluation interval causing workflow context to cancel due to maxing out the max count - for this, check the LE workflow context to see if there's any workflow errors. 5. Could be RCA error leading to the inability to call/access some script include like hr_ActivitySet 6. Other possible causes: a) The subject person might not have met the audience at the time when the activity is being launched b) The activity might have been inactive at that point of time. 2. No to-dos are shown on LE ticket page when the filter has only the "completed" checkbox selected By design, for the to-dos to show up in the task list for an activity set, the user needs to select: At least one from the Required or Optional checkboxes AND At least one from the Completed or Upcoming checkboxes Enhancement to make this more user-friendly is on the roadmap. 3. Why did my workflow context get cancelled? The maximum workflow activity count might have been reached. This could happen when there are long-running LE cases or the evaluation interval of an activity set is too small. To increase the max workflow activity count, see #4 below. The increase will only apply to new workflow contexts but not the existing ones. 4. How do I increase the maximum workflow activity count? The max workflow activity count can be updated by checking out the hr activity set launcher workflow and opening the workflow properties icon (under the activities tab). 5. How do I make the activity set trigger condition evaluation faster or immediate so the activities can launch sooner? By default, the evaluation interval is 4 hours. If you want to trigger the activity set sooner, there are 2 ways. 1. We introduced a new feature in San Diego that provides the ability to trigger the activity set once the trigger condition is met (no need to wait for the default 4 hours). For more details, review the documentation here: Lifecycle Events evaluation interval 2. Reduce the evaluation interval of the activity set (see #6) and increase the max workflow activity count (see #4) This is not recommended as this could hit the max workflow activity count limit which will cause the workflow context to get cancelled. 6. How do I change the evaluation interval of an activity set? Either update the evaluation interval field of the activity set (might need to configure the form to show the field) OR Set a system property when the evaluation_interval column is null (see Lifecycle event properties) 7. Why does the LE Test feature give an error in the "HR Activity Set Launcher" workflow if there are too many activity sets or activities? The "HR Activity Set Launcher" workflow input "Activity set inputs" might exceed its max length (default is 4000) if there are many activity sets and/or activities. (See KB1156535 (Lifecycle Event Test functionality gives an error in the HR Activity Set Launcher workflow)) The solution is to increase the workflow input "Activity set inputs" max length (e.g. from 4000 to 8000). 8. Records generated from an activity of type flow are not showing up under the activity set in ESC Any tasks generated from the flow will not be associated with the activity set on ESC, since we cannot determine the records generated from the custom flow. However, if you would like the task generated from custom flow to show up under the activity set in ESC then the Activity Status [sn_hr_le_activity_status] record should have its Generated Record field to be set to the record generated from the flow. This should be set in the custom flow by looking up the Activity Status record using the following filter below /sn_hr_le_activity_status_list.do?sysparm_query=activity_set_context.hr_case=<sys_id Parent LE Case>^activity=<sys_id of the activity with flow> 9. The error message "There is an error in the workflow. You can resume case to restart the workflow." is displayed at the top of the LE Case Form and one or more of the Activity Set Executions are in Error. In the logs, you might see the following stack: WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.088df2fe534a22003066a5f4a11c08de.script at line 700WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.088df2fe534a22003066a5f4a11c08de.script at line 610WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.088df2fe534a22003066a5f4a11c08de.script at line 544WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.088df2fe534a22003066a5f4a11c08de.script at line 252WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.d3669766c0a8016901828e92d1202ac5.script at line 104WARNING *** WARNING *** Evaluator: org.mozilla.javascript.EcmaError: "parent" is not defined.Caused by error in sys_script_include.088df2fe534a22003066a5f4a11c08de.script at line 1705WARNING *** WARNING *** Get for non-existent record: sn_hr_core_template:76c7eaa9dbebc950859143d91396196c, initializingWARNING *** WARNING *** Get for non-existent record: sn_hr_core_template:76c7eaa9dbebc950859143d91396196c, initializingSEVERE *** ERROR *** sn_hr_le (hr_ActivitySet): org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (Launch Activities - advanced script; line 11) The OOB Query Business Rule "SNC Template Query" (sys_script.do?sys_id=f5ab8f060a0a0bc50013f5ab4b8315c1) on the sys_template table (note that sn_hr_core_template extends from sys_template ) adds an additional encoded query: global=true^ORuser=" + gs.getUserID() + "^ORgroups=javascript:gs.getUser().getMyGroups()For non-admin users, the above Query BR might prevent the user from accessing the current Template being queried, depending on the above query. The solution is to make sure that the data in sys_template can be accessed by the user submitting the LE Case. 10. Emails defined in the Lifecycle Event's Activities of type 'Notification" are not being sent. The most common cause of this issue is that the OOB Notification "Lifecycle Activity Notification" (/sysevent_email_action.do?sys_id=de49d5a9537232003585c3c606dc344f) might have been deactivated. If that's the case, and no other custom notifications have been set up to trigger when event "sn_hr_le.notification_activity" is fired, then no emails will be sent from the Lifecycle Event. For more details on how Lifecycle Event Notification works, see KB1633397 (How do Lifecycle Event Notifications work) 11. Activity Set is in Error and the error '"{Activity_Set_name}" activity set state changed to Error for the following reason: ErrorMethodName: _isActivityCompleted ## java.lang.NullPointerException' can be seen in the Case work notes. Open the Activity Set Execution record for the Activity Set in error and review the list of its Activity Status records. One of them might reference a non-existing Activity. The most common cause of this issue is the Activity having been deleted from the Activity Set definition while the LE Case is still in flight. The only solution is it to reinstate the missing activity. 12. Activity Sets with trigger type "Other Activity Sets" or "Combination" remain in "Awaiting Trigger" indefinitely. This issue usually affects long-running LE Cases (6+ months) where one Activity Set of type Combination depends on another Activity Set and a Date. If the first Activity Set is completed more than 6 months before the specified Date being reached, the wf_context for the original Activity Set might get deleted and therefore the waiting Activity Set will never move forward from the "Awaiting Trigger" state. The OOB Table Cleaner for the "wf_context" table is set to 15,552,000 seconds (180 days) https://instance_name.service-now.com/nav_to.do?uri=sys_auto_flush.do?sys_id=552f483c0a0a0b900082121e6ea5b65eThe matchfield for Table Cleaner for the "wf_context" table is "ended" and the condition is "Active is false". This means that any Inactive wf_context records with their "ended" field set to a value older than 180 days are being deleted. Since there is no wf_context anymore for the original Activity Set, the depending Activity Set won't be able to progress, as the current logic relies on the wf_context to check whether a depending ActivtySet is finished or not. If you expect LE cases to last for more than 6 months, you would need to update the value of the above table cleaner (System Maintenance > Table Cleanup) to make sure the wf_context records for any active LE Case do not get deleted. There is no easy fix for currently-affected LE Cases. Also, see KB1650793 (Activity Set Context stuck in 'Awaiting Trigger' even if its dependent Activity Sets have finished). 13. Duplicate Activities being generated within the same Activity Set. Looking at the Workflow Logs for the workflow context "HR Activity Launcher" of the affected Activity Set, you can see an error similar to: Workflow 'HR Activity Launcher' with context 9d88f9e6ebe30a50540df3a2dad0cdb6 terminated 2024-07-25 07:23:47 UTC with : Transaction cancelled: maximum execution time exceeded This issue can occur when the transaction that creates the case and triggers the "HR Activity Launcher" takes too long.The course of action is usually similar to this:1. Case is created and LE triggered in the same transaction (note that, OOB the LE Case is created in Draft and then it moves to Ready and that's when the LE triggers; in this scenario, the case is created in Ready state directly)2. Workflow "HR Activity Launcher" starts3. WF Activity "Launch Activities" starts4. Activities start getting created. This might take a long time5. The original transaction (that created the case and triggered the WF) times out 5 minutes after it started (as per the Quota Rule - more on this below) WHILE the WF Activity "Launch Activities" is still executing6. The "Transaction cancelled: maximum execution time exceeded" error message can be seen in WF Context Logs7. The original transaction terminates (5 minutes after it started)8. As per workflow design, the Workflow does NOT error out when its originating transaction times out, but rather simply RE-EXECUTES the current Activity from the beginning. So, in this case, the current activity is "Launch Activities"9. The "Launch Activities" activity restart (possibly on a different node, with a different transaction) and generates duplicate activitiesThe transaction that generates the case and attaches the WF might time out because of one of the OOB Transaction Quota Rules, most likely: Quota Rule "REST and JSON Catch All" (sysrule_quota.do?sys_id=84622fa19f1122005cf3ffa4677fcf1f) set to 300s (5mins) or Quota Rule "REST Batch API request timeout" (sysrule_quota.do?sys_id=39e96633e7170300917484fa03f6a93b) set to 30sThe solution is to increase the Maximum Duration (seconds) for the involved Transaction Quota Rules to a value higher than the expected case creation duration. Exercise caution as Transaction Quota Rules apply to the whole platform. 14. Activity Set Context is stuck in the "Running Activities" state. This can happen if the Activity Set contains an Activity of type "Catalog Item" or "Automated Order Guide". If the generated_record on one of the Activity Status records is EMPTY, and the related Activity has its "Wait for generated task to complete = true", it will wait forever. The "generated_record" field gets populated when the HR Task is of type submit item/order guide, ONLY when the related item/order guide is submitted from the ESC portal todos. Make sure to submit any LE-related Catalog Item/Order guide only from the hrm_todos_page page on the Employee Center. 15. Activity Set Context completes in Error with error message 'Cannot set property "rootParent" of null to "<sys_id>"'. One of the Activity Sets in your Lifecycle Event might complete in Error. Looking at the Workflow Context related to the failing Activity Set Execution, the following error might be seen: Wait to reevaluate Trigger Script(b819b98a73d51010e9b37de86cf6a75e): org.mozilla.javascript.WrappedException: Wrapped org.mozilla.javascript.JavaScriptException: TypeError: Cannot set property "rootParent" of null to "0320ec431b21bc10bd9bdc25cc4bcb81" (// Check if the trigger type is not "script (advanced)". For type script, the condition is already evaluated as false in the previous WF activity and therefore, no need to create a future to-do'// Also, check if the future-todo API is already invoked. (for trigger type 'date', this WF activity may run multiple times)try {var regId = workflow.scratchpad.registration;var trigger_type = '';var grContext = new GlideRecord('sn_hr_le_activity_set_context');if (grContext.get(regId))trigger_type = grContext.activity_set.trigger_type;if (!workflow.scratchpad.futureRecordCreated && trigger_type != "script") {// This script will create JSON representing future to-dos for the activity set which are not triggeredvar util = new sn_hr_le.hr_ActivitySet().createFutureTodos(workflow.scratchpad.registration,workflow.variables.subject_person_id);workflow.scratchpad.futureRecordCreated = true;}// Set 'answer' to the number of seconds this timer should waitanswer = new hr_ActivitySet(regId).getLoopInterval();} catch (err) {workflow.scratchpad.errMessage = err.message;workflow.scratchpad.err = err;throw err;}; line 23) (<refname>; line 273) The "rootParent" mentioned in the exception is used in function '_updateFutureJSON' of Script Include "hr_ActivitySet"sys_script_include.do?sys_id=088df2fe534a22003066a5f4a11c08de Looking at the logic in this method, it is failing to create one of the Future To-Dos correctly. Check the list of Future To-Dos for the affected Activity Set / HR Case:/sn_hr_le_future_todo_list.do and check whether any of them have an empty 'Future JSON' field. The LE Activity referenced in the above Future To-Do might be pointing to an 'HR Template' that does not exist on the instance. On the UI it displays as empty while from XML you can see that its value is:<hr_template display_value="">3e426d7f1b362410309fff7e034bcb59</hr_template> The issue is that the sn_hr_core_template record with sys_id=3e426d7f1b362410309fff7e034bcb59 does not exist on the instance. Solution: - Import the HR Template [sn_hr_core_template] record referenced in the 'broken' ACtivity from another instance (if you know where it was developed on and you still have it)OR- Update the HR Template on the LE Activity pointing to an HR Template that exists on the instance.