How to distinguise between activity failures

I have an retriable activity sorrounded with try catch in the workflow implementation. In the catch block I want to distinguise between the below scenarios and execute next activity accordingly,

  • a non-retryable exception occured
  • the last retry attemp failed
  • retry timeout exhausted

How to acheive it? I understand Activity.getExecutionContext().getInfo().getAttempt() returns current attempt but how to get the maximum retry count value?

1 Like