Skip to content

Architect track

Scale & integration architecture

Patterns for volume, resilience and loose coupling.

3 sections · 16 entries

Integration pattern picker

Match the pattern to latency, volume and who owns the source of truth.

NeedPatternServiceNow tooling
Real-time create/update, low volumeSynchronous RESTScripted REST / Table API, RESTMessageV2
Must not lose messagesAsync + queue + retryEvents, async BRs, Flow with error handling, outbound queue table
Bulk nightly loadBatch importImport Set API, data sources, transform maps, concurrent imports
Reach on-prem systemsProxy through MID ServerMID Server, ECC queue, IntegrationHub spokes
Common SaaS (Jira, Teams, Azure…)Spoke, not custom codeIntegrationHub spokes and Workflow Studio
CMDB from external toolsConnector + IREService Graph Connectors
Stream of events from monitoringEvent ingestionEvent Management, alerts, aggregation rules

Scale patterns in code

Snippets for work that has to survive volume.

Event on a dedicated queueHidden gem

A fifth eventQueue argument routes events to a named queue so heavy work does not block the default one. Pair it with a scheduled job that processes that queue.

// Business rule (after/async)
gs.eventQueue('x_rsa.sync.requested', current, current.getUniqueValue(), '', 'x_rsa_sync_queue');

// Script Action on x_rsa.sync.requested does the outbound call,
// records attempt count and next_retry, and re-queues on 429/5xx.

Chunked scheduled job

Process a slice per run and remember where you stopped. Safe to re-run, never times out.

var BATCH = 500;
var lastId = gs.getProperty('x_rsa.cleanup.last_sys_id', '');
var gr = new GlideRecord('x_rsa_staging');
gr.addQuery('processed', false);
if (lastId) gr.addQuery('sys_id', '>', lastId);
gr.orderBy('sys_id');
gr.setLimit(BATCH);
gr.query();
var last = '';
while (gr.next()) {
  // ...process one row idempotently...
  gr.setValue('processed', true);
  gr.update();
  last = gr.getUniqueValue();
}
gs.setProperty('x_rsa.cleanup.last_sys_id', last); // '' when done = start over

Scale & resilience rules

What changes when a solution goes from pilot to enterprise volume.

  • ✦Async by default. Anything slower than a few hundred milliseconds leaves the user transaction.
  • ✦Idempotency keys. Correlation ID + upsert so retries and replays never duplicate.
  • ✦Backpressure. Respect 429s and Retry-After; cap concurrency per target system.
  • ✦Dead-letter. After N failures park the message, alert a group, allow one-click replay.
  • ✦Archive & rotate. Archive rules and table rotation for high-volume logs and staging tables.Hidden gem
  • ✦Transaction quotas. Know the quota rules that cancel long REST and UI transactions; design under them.Hidden gem
  • ✦Load test. Rehearse peak volume in a sub-prod before go-live, not after the first incident.

Snippets are provided as-is under the MIT licence, without warranty. Test in a sub-production instance first. ServiceNow is a trademark of ServiceNow, Inc.; this page is independent and not affiliated with or endorsed by ServiceNow.