A specific set of circumstances govern when a service task that fails in SHAR can be observed and retried.

  1. a service task function returns an error (not of type errors.ErrWorkflowFatal) AND retries configured in the task spec are exceeded AND taskSpec.behaviour.defaultRetry.defaultExceeded = 0 (pause). This is exercised in the test case TestFatalErrorPersistedWhenRetriesAreExhaustedAndErrorActionIsPause
  2. a service task function returns an errors.ErrWorkflowFatal type error. SHAR immediately publishes to the fatal error subject regardless of what is specified in the taskSpec.behaviour.defaultRetry.defaultExceeded. This is exercised in the test case TestRetryFatalErroredProcess

In both of these cases, a message is published to the WORKFLOW.<namespace>.System.Process.FatalError.<processId> topic. The message is of type FatalError and contains the WorkflowState at the time the fatal error occurred.

Retry of service tasks that have fatally errored.

In both of the above scenarios, the process is effectively “paused” and cannot continue execution. It is however possible to retry the service tasks that have failed using the client.Retry() and client.RetryFromPriorElement() functions.

Note that there will need to be some modifications to these functions. They currently accept an element id however it is probably more correct for them to accept an activity id instead. This is because there are circumstances where an element might have been executed twice.