Async
Jace Benson
Table of content
Async processing is work that runs outside the current database transaction. The record saves, the response goes back to the user, and the async work runs when the system gets to it. It's the "do this later" mechanism of ServiceNow.
When to Use Async
- Slow operations — sending emails, making outbound REST calls, generating reports
- Fire-and-forget — you don't need the result before the user gets their response
- Heavy processing — PA collections, data imports, bulk record operations
- Decoupling — you want the main transaction to be fast and reliable, and defer expensive work
Don't use async when you need the result immediately — use in-memory for that. Don't use async for simple operations that run in a few milliseconds — you're just adding queue overhead for no benefit.
How Async Works
Async work is queued on the sys_trigger table (scheduled jobs, events) or the sys_execution_queue table (flows, script actions). The system processes these queues based on:
- Scheduled time — run at a specific time or interval
- Event queue — fire when a GlideEvent is triggered
- Flow queue — process Flow Designer executions asynchronously
- Script queue — script actions from the
sys_script_queuetable
Async Types
- Async Business Rules — business rules that run after the transaction commits
- Scheduled Jobs — run at specified intervals (daily, hourly, custom)
- Scheduled Scripts — one-off or recurring script execution
- Events — GlideEvent-based triggers and listeners
- Flow Designer — flows that run async
- Data Imports — loading data asynchronously
- PA Collections — Performance Analytics data collection
- Script Actions — reusable async scripts triggered by conditions