Dynamic retry delays on an activity

Is there a way to dynamically change, or schedule the execution time of the next retry for an activity.

The scenario I am thinking of contending with is calling an API which implements rate limiting, and being able to schedule the next retry after the time specified in the Retry-After header.

I have been trying to figure out a way of doing this, but the only thing I can come up with is returning an error back out to the workflow, and having it manage the delay by doing a Workflow.sleep call before retrying the activity again.

Is this the best way to tackle this specific problem?

Thanks,

Mark

Hi,

let me know if this helps What is a Temporal Retry Policy? | Temporal Platform Documentation

Antonio

This is absolutely perfect. I completely missed this in the docs!

The per-next-error retry delay is exactly what I need.

Thanks a lot Antonio!