ServiceNow - Transaction serialized to sessions

Xarielah6351749
Tera Contributor

We're having an integration with a backend that enables some widgets with AI capabilites for the organization.

 

Integration flow is throught "c.server.get" -> Server Side catching the action event -> script include that fires a RESTMessageV2 to the backend.

 

Sometimes API calls can take up to a minute, and transaction are serialized in a user session so for a full minute users are unable to navigate the platform. 

 

What solution could be for that?

1 REPLY 1

-O-
Kilo Patron

Obviously one needs to make it asynchronous.

One should find a table that would function like the MID queue.
- c.server.get -> create record in queue table.

- set up a record watcher for that record for a state change

- when the watcher fires, do what was done when c.server.get returned.

On the server side

- when a record in the queue is created, fire the integration asynchronously (via BR or Flow or whatever)

- when the integration completes, update the queue record's state, so that the client side watcher is fired.