Call function in an NG Client instance from server

I am trying to find a way of calling a function in an instance of an NG Client; primarily, this is to process a callback from another web page opened from that client.

The JSClient can be used for Headless Clients to use queueMethod() but I cannot find a way of getting a JSClient instance from the GetClientID() of an NG Client. The closest I can find is plugins.headlessclient.getOrCreateClient(), which is again only for headless clients.

The upshot being that I am seeking a way to call a function in a running instance of NG Client from a call received on the server; unless it is possible for an instance of NG Client to get a callback directly.

To get the full picture:
What is it that this callback action should do?
Write data, UI update, both, anything else?

also how is this first call triggered?
because you seem to talk about another kind of webpage opened by the ngclient
so that is just in another tab?
and that wants to call then the server based on some url?

Then inside that url you need to give some uuid that you know what client that is…
And maybe that url can just be a rest url to server that hits a rest api (headless client)
that headless client uses then the broadcaster (clientmanager plugin) to broadcast a message over a specific channel with that uuid
the ngclient listens on that channel knows its uuid and knows then this message is mine (or that channel name is the uuid and you have many channels)

Thanks for the responses. To provide more detail, we have to provide a callback URL to a payment service, so if we get a specific notification of a status from an external payment API call to this service, it requires the application to open up a separate web page supplied in the response for more details to be entered. This separate web page is run by a bank and requires additional data to be entered by the user before the transaction can continue.

This entails that the Servoy app has to await the response of the callback from this web page in the NG Client and I’ve been trying to work out a way to implement this.

is that redirect done in the same browser tab where the ngclient is loaded?

because potentially you could use then a deeplink callback url that just calls a function when it is done, then you are hitting the same NGClient instance.
If that payment can take longer then 60 seconds it could be that you need to increase the window timeout, see APP_NG_PROPERTY.WINDOW_TIMEOUT

It would be opened in a separate browser tab; it is an interesting idea to open in the same tab then deep link back but I think it would be tricky as we have no control over what is in the called web page. If one of them said something like, “You can now close this window”, it could really throw a spanner in the works.

if you open this in a separate window then you just need to follow the first comment i did in this thread.

So the callback the 3rd party website does is a rest api call to our rest service (headless client) and that headless client just relays that message to our clientmanager.getBroadcaster() on a channel which will be picked up by the ngclient that did the initial call