Can one app see if another app is running?

I have an app that is used to show an overview of my courier's runs, which are represented in Monday.com boards. It uses a javascript file that runs every 2 minutes to trigger the workflows that talk to Monday.com, our car tracking servers, and Google Maps for driving time between locations. The workflows use Retool Database for local storage of the combined/transformed data that the app displays. I don't want/need any of it running when the app isn't being used, and the app has a "power" switch so it can be stopped/restarted without exiting.

Because the (main) app is triggering all the data exchanges, I don't want multiple instances running, so I'm making another (viewer) version that just shows the data that's already in the Retool Database.

Is there a way that my viewer app can tell if the main app, and its recurring javascript, is running?

Hi @CarlaK

Why not using the Workflow scheduling capability instead of run the task from the App every 2 minutes?
In this case the Workflow would be totally singleton without the issues you've mentioned.

Hope this help.

@abusedmedia I don't want it running at all if no one is using the app

In that case you should create a table in database to handle active sessions. The Workflow checks that table and if no recent sessions present, skip the task.

Hope this help.

1 Like

Thanks @abusedmedia Let us know how it goes, @CarlaK :slightly_smiling_face:

Thanks @abusedmedia, I haven't had a chance to work on it since I posted, but have mulled over your suggestions. I'm planning to put a timestamp in a database table every time the app updates itself. The other app then just checks if the timestamp is recent.

1 Like