Retry Policy For activities with internal service and external service calls

Hi, One of the activities in our workflows comprises of calls to internal services and external services. The internal service is used to quickly retrieve a data required for the external service call and exception can occur in both.

We would like to configure different Retry policy for each of the services.
for e.g. : internal services could have a quick retry policy of retry interval of 5s and max attempt of 3.
While for the external services, we may want to retry 10 times with a minimum of 30s interval and some BackoffCoefficient.

How can this be achieved? Do you recommend using dotnet IHttpClientFactory with polly retries for internal services?

What do you recommend and do you have any documentation around this or samples?

Different activities can have different retry policies in the activity options when called from the workflow. It is very normal to give one activity call a different retry policy than another. Can see the .NET docs about activity options, though it doesn’t cover every option specifically like retry policy. Can see general retry policy documentation about retry policies. Also can see the API docs for ActivityOptions.RetryPolicy property and the RetryPolicy class.

Do you recommend using dotnet IHttpClientFactory with polly retries for internal services?

Whether you retry inside your activity is up to you, but most people rely on activity retry behavior in to Temporal.