Step retries
Hello, I need one help. I have one workflow with some do steps, if any step got failed and it's maximum retry also got failed so can i retry it manually by any way? cloudflare doesn't provide API to retry specific step manually but by doing any hack can I achieve manual retry for any step?
5 Replies
Hey, when your step fails after the last retry it will throw an error that you can catch on your code, then you can do whatever you want! If you really want a manual retry, after you catch that error you could send a notice to inform you and wait for an event that would make that step run again. There are many different ways to approach this!
We don't have an API to retry a specific step because if that step fails, then the entire workflow fails and ends - you can't go back after reaching a final status.
(You can always change the step config to what best suits you)
@Olga Silva What is other ways to do specific step retry?
You mean besides changing the
WorkflowStepConfig ?@Olga Silva Yes,
You can put as many retires as you wish into
WorkflowStepConfig (https://developers.cloudflare.com/workflows/build/sleeping-and-retrying/#retry-steps)
Other than that, you could eventually try catch that step that failed after every retry and then decide what to do. Maybe do a step.sleep followed by some logic to call that step.do() , but there are other options - it's just how you decide to code it.Cloudflare Docs
Sleeping and retrying
This guide details how to sleep a Workflow and/or configure retries for a Workflow step.