I have a remote worker that is doing some processing and is called from a workflow which only invokes an activity on the remote worker.
This workflow could be invoked multiple time in a short period of time, while the worker takes longer time to process each request. However, each call to the worker is an of an updated state, so this means that only the last request is important.
Each workflow could have a unique ID based on the resource I wish to update, so it is easy to identify when if I have multiple workflows (all of which but one are redundant) which ones I need to drop.
Is there a way to manage the queue of pending workflows so that I would be able to prevent the worker from processing ALL requests, and instead only run the last request available?
For example, say I have a camera service taking a single image per 1-10 second, and sending this image to a processing workflow which takes about 5 seconds to process. If the camera service sends multiple images to the worker, I want to only process the last one.
Should I even use temporal for this? Does it make sense to cancel a workflow and start a new one each time?