System Events
Summarize
Summary of System Events
System Events in ServiceNow are special records that log specific system conditions and trigger corresponding actions. These events are generated by business rules that monitor changes and insert event records into the Event [sysevent] table, also known as the event log or queue. Events enable automation by responding to conditions such as record creation, updates, or comments.
Show less
Key Features
- Event Generation: Business rules use script logic to check conditions on records and add events to the queue using the GlideSystem eventQueue method.
- Event Record Structure: Each event record contains fields like Name (unique event identifier), Parm1 and Parm2 (parameters with record-related data), Table (the affected table), and Instance (record Sys ID).
- Event Processing: Scheduled jobs read from the event queue and invoke handlers that perform actions such as running scripts, sending notifications, triggering workflows, or starting inactivity monitors.
- Custom Events: Besides the default system events, customers can create custom events tailored to specific record changes to meet unique business requirements.
- Monitoring: The System Events and Jobs Dashboard allows customers to track event processing and scheduled job execution.
- Upgrade Considerations: During platform upgrades, event processing can be controlled via system properties:
glide.eventprocessor.alleventsupgradesafe: When true, all events are processed during upgrade (default is false).glide.eventprocessor.upgradesafeevents: When the above is false, this property lists specific events to process during upgrade.
Practical Benefits
Understanding and utilizing system events allows ServiceNow customers to automate responses to critical record changes, improve workflow efficiency, and maintain control over event processing especially during system upgrades. Custom events enable tailored automation aligned with specific business processes. Monitoring tools provide visibility into event and job execution health, ensuring reliable system operations.
Events are special records that the system uses to log when certain conditions occur and to take some kind of action in response to the conditions.
The system uses business rules to monitor for system conditions and to generate event records in the Event [sysevent] table, which is also known as the event log or event queue.
Event-generating business rules typically use this script logic:
If [some condition is true for the current record], then [add a specific event to the queue].
- If a user adds a comment to an incident record, add an incident.commented event.
- If a user adds an incident record, add an incident.inserted event.
- If a user updates an incident record, add an incident.updated event.
| Field | Description |
|---|---|
| Name | Unique name of event. Baseline event names include the record affected and the triggering action, such as incident.commented. |
| Parm1 | Event-specific parameter the system uses to pass record information to other parts of the system, such as a record Sys ID or a field value. |
| Parm2 | Event-specific parameter the system uses to pass record information to other parts of the system, such as a record Sys ID or a field value. |
| Table | Table to which the event applies. This is the same table on which the business rule ran. |
| Instance | Sys ID of the record to which this event applies. |
- Run a script action
- Send a notification
- Trigger a workflow activity
- Trigger an inactivity monitor
By default, the system provides events covering a broad view of application activity. If existing events do not meet your needs, you can create your own events to watch for specific changes to records.
For developer training, see Scheduled Script Executions and Events Objectives on the ServiceNow® Developer Site.
Use the System Events and Jobs Dashboard to monitor the system event processing system and the scheduled jobs processing system.
Event processing during platform upgrade
Determine which events are to be processed during a platform upgrade by configuring the following properties:
- glide.event_processor.all_events_upgrade_safe: Set to true to process all events during platform upgrade. Default = false.
- glide.event_processor.upgrade_safe_events: Configure a comma-separated list of event names to indicate that only specified events are processed. Default = <empty>.
This property is relevant only when glide.event_processor.all_events_upgrade_safe = false.