Notification system for long running operations

Hello,

I was directed here by support, since they were unable to help me find a solution.

Our use case is pretty simple:
Wire a button on Retool to a REST API call, which fires a long running operation, such as: cleaning up a database, machine learning, processing data, etc. The operation will run and can be completed in couple of minutes or couple of hours.

Currently there is no way for us to track these operations in Retool or to update Retool state once the operation is finished. The solution could be as simple as a Rest API call to Retool, which we call in our own implementation after the operation had completed. It would be even better if we could displayed errors that happened during the long running operation as well.

Thanks!

1 Like

If this is a job that runs regularly, you may want to consider a scheduler or queue to manage this long running process. API calls should really be used for shorter events/jobs. You could build a listener and then have that listener handle the notifications but that might be a bit cumbersome to do in js

Hmm, do you have any links or sample code on how we would do this?

No, I don't, sorry, but I still think that you should have a worker do what you are expecting Retool to be able to do (i.e. - Celery)
Maybe you could write js code in Retool that executes every hour to check to see if the job is completed?