Glide events relative to workflows
Summarize
Summary of Glide events relative to workflows
Workflows in ServiceNow utilize several Glide events to interact with the script engine and manage workflow execution. These events are triggered by lifecycle actions on GlideRecords—such as insert, update, delete, and query—and cause the workflow engine to respond accordingly. Although these events are integral to workflow operation, they generally do not have explicit, direct uses for customers within workflows beyond starting or advancing workflow states.
Show less
Workflow Glide Events and Their Roles
- Insert Event: Triggered when a GlideRecord is inserted. It wakes up the script and workflow engines to start workflows associated with the inserted record, either by direct reference (e.g., request items, SLA timers) or by matching conditions on the record’s table. This event primarily initiates workflows and can also be triggered manually via scripting.
- Update Event: Triggered upon updating a GlideRecord. It causes the workflow engine to look for running workflows linked to the updated record and advance them through the next transitions where relevant.
- Delete Event: Triggered when a GlideRecord is deleted. Similar to the update event, it prompts the workflow engine to find running workflows associated with the deleted record and move them forward as appropriate.
- Query Event: Triggered when querying the Glide database. It causes the workflow engine to check for running workflows related to the queried record and advance them as needed.
Practical Implications for ServiceNow Customers
These Glide events operate behind the scenes to ensure workflows respond dynamically to changes in records. Customers typically do not need to manage these events directly but should understand that:
- Inserts can automatically trigger new workflows linked to the record.
- Updates, deletions, and queries can advance running workflows based on the current state of the record.
- Manual triggering of workflows is possible through scripting if custom control is needed beyond these events.
Understanding these event triggers helps in troubleshooting workflow behavior and designing workflows that align with record lifecycle events.
Workflow uses several Glide events.
| Event | Description | Purpose | To Use | Source | Thread | Listeners |
|---|---|---|---|---|---|---|
| Insert | Global event set upon the insert of a GlideRecord that causes the script engine, and through that the workflow engine, to wake up. | Starts workflows that are associated with the current GlideRecord either by reference, as in request items and SLA timers, or by conditions associated with the GlideRecord's table. | There is no explicit customer-facing use for this in a workflow. It is part of the Glide engine, and with this event, the only thing workflows can do is start. Workflows can also be started manually using a script. | Workflow Engine, RunEngine | Current thread, current mutex | User action of insert |
| Update | Global event set upon the update of a GlideRecord that causes the script engine, and through that the workflow engine, to wake up. | Looks to the Workflow Context [wf_context] table to find running workflows that are associated with the current GlideRecord by document ID. | There is no explicit customer-facing use for this in a workflow. It is part of the Glide engine, and with this event, the only thing workflows can do is advance through the next set of transitions. | Workflow Engine, RunEngine | Current thread, current mutex | User action of update of a GlideRecord |
| Delete | Global event set upon the delete of a GlideRecord that causes the script engine, and through that the workflow engine, to wake up. | Looks to the Workflow Context [wf_context] table to find running workflows that are associated with the current GlideRecord by document ID. | There is no explicit customer-facing use for this in a workflow. It is part of the Glide engine, and with this event, the only thing workflows can do is advance through the next set of transitions. | Workflow Engine, RunEngine | Current thread, current mutex | User action of delete of a GlideRecord |
| Query | Global event set upon the query of the Glide database that causes the script engine, and through that the workflow engine, to wake up. | Looks to the Workflow Context [wf_context] table to find running workflows that are associated with the current GlideRecord by document ID. | There is no explicit customer-facing use for this in a workflow. It is part of the Glide engine, and with this event, the only thing workflows can do is advance through the next set of transitions. | Workflow Engine, RunEngine | Current thread, current mutex | User action of query of a GlideRecord |