How to stop non-deterministic error retry forever?

Hey,

I am testing with golang-sdk and java-sdk. I try to catch all throwable from our definition. But I still find non-deterministic error makes the workflow task retry forever. Could we have a way to make it stop or block for a while?

1 Like

Hi @maki_XIE

NonDeterministicException is not propagated to workflow code, as you have mentioned you can not catch it.

To stop your workflow from retrying the workflow task when facing a non-deterministic code, you can use setFailWorkflowExceptionTypes in WorkflowImplementationOptions

WorkflowImplementationOptions.newBuilder()
   .setFailWorkflowExceptionTypes(NonDeterministicException.class)
   .build(),

Another way is to set WorkflowRunTimeout in your WorkflowOptions to limit the duration of your workflow run, so after some time including workflow task retries, the workflow will fail.

Both options will fail your Workflow Execution.

1 Like