Surendra_
ServiceNow Employee
ServiceNow Employee

🚀 Exploring the latest ServiceNow platform features! Let's examine the Processing Framework and how it affects Platform Queue Behaviour.

 

Problem: When creating an event registry for a custom queue (following the steps at https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/script/useful-scripts/task/qu...), and one must write Job Context code to use the GlideEventManager API. However, this approach offers limited flexibility in defining queue behaviours such as processing sequence (parallel or sequential). Additionally, as your environment scales with more nodes, your jobs (associated sys_triggers) don't scale up automatically.

 

Introducing Plugin : Processing Framework

(Plugin id: com.glide.processing.framework)

If one spins up a fresh PDI now, this plugin will be available OOB. Try to register a new event and this info message points to Queue Registration.

Surendra__0-1738619144214.png

 

 

Now we can associate some configuration to the queue too, available configs:

Event Processing Order Parallel or Sequential Parallel: Multiple jobs either a constant number of scale with nodes Sequential: There will be only one job for this queue.
Job Configuration Type Constant or Scale with node
Number of jobs

 Integer to determine how many jobs you wish to configure per node. Observation: Max jobs are controlled by global.ProcessingFrameworkUtil and SNC.ProcessingFrameworkUtil and same work as a configuration safety too it seems.

 

 

Surendra__1-1738619144336.png

Few other new table under this plugin can be checked here.https://{pdi}-now.com/now/app-manager/home/plugin/id/com.glide.processing.framework/details

Let’s try to register a new event under a custom queue.

 

Start by first creating a queue (sysevent_queue).

Sequential Queue would look something like this:

Surendra__2-1738619144218.png

 

Parallel Queue, scaling will be available only with this option.

Surendra__3-1738619144219.png

 

 

 

As the flag Automatic Job Scheduling is selected these configuration will create sys_trigger entries automatically.

State in Red - Are the automatically created parent jobs along with child jobs in case of parallel.

Now lets register an event for this newly created sequential queue for our example and a corresponding Script Action and create some events.

Surendra__4-1738619144286.png

 

Surendra__5-1738619144315.png

 

 

 

Background Script/Xplore to create some events.

Surendra__6-1738619144323.png

Shoutout to James Neale for Xplore. GitHub

//Fire 500 or 1000 events
//background script

Array(500).fill(0).map((_, i) => gs.eventQueue('global.custom.event.new',current,i,gs.getUserName()));

 

Log and Event Log

 

logs.png

 

Surendra__8-1738619144209.png

 

 

 

And you can check the queue stats too in RL.

Surendra__9-1738619144388.png

 

Please explore it throughly before making it live on production, this is something that my team found recently and we thought of sharing with all. 

 

#ServiceNow #Yokohama #Xanadu

4 Comments