DEV Community

Discussion on: Retry automatically with Exponential Backoff in Cloud Workflows

Collapse
 
krisbraun profile image
Kris Braun

Hi Kenji, there's actually a simpler way to achieve this, but we (I'm the PM for Workflows) obviously haven't made it discoverable enough!

To add retries with exponential backoff to any step, simply wrap it in try... retry, providing either a default retry policy or a custom one (where you can specify the backoff parameters). Workflows will take care of retrying the step for you based on the response.

I will look into getting Workflows retry feature mentioned on the Cloud Functions doc page you mention!

Collapse
 
koshilife profile image
Kenji Koshikawa

Hi Kris,
Thank you for your great information.

It looks useful. I didn't know that.

I will try it. After adding verification, I will add notes to this article.

Collapse
 
koshilife profile image
Kenji Koshikawa

I added examples to use try/retry codes.
Thanks to @krisbraun.