Implementing Delayed Job Retry with Workflow and DurableClock
I'm porting some code from BullMQ to Workflow and am looking at how to implement the equivalent of delaying a job (https://docs.bullmq.io/patterns/process-step-jobs#delaying). I have an
Activity that makes an external API request and then performs some processing; the request may receive a 404 response, in which case it needs to be retried in, say, an hour. Ideally, if it hasn't been found after, say, a week, mark it as failed. (The activity might fail for other reasons, and there might be multiple workflow runs delayed at the same time.) I'm thinking that this would involve running the Activity again after a DurableClock.sleep on the specific error (and keep doing this if needed). Is that the right kind of approach here?