NOT_FOUND: workflow execution already completed

Hi all,
I faced issue with the following trace:

io.temporal.failure.ApplicationFailure: message='Workflow has already removed', type='io.temporal.client.ActivityNotExistsException', nonRetryable=false
	at io.temporal.failure.ApplicationFailure.newFailure(ApplicationFailure.java:70)
	at com.test.activity.MockJobLifeCycleActivitiesImpl.preProcess(MockJobLifeCycleActivitiesImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.temporal.internal.sync.POJOActivityTaskHandler$POJOActivityInboundCallsInterceptor.execute(POJOActivityTaskHandler.java:293)
	at io.temporal.internal.sync.POJOActivityTaskHandler$POJOActivityImplementation.execute(POJOActivityTaskHandler.java:252)
	at io.temporal.internal.sync.POJOActivityTaskHandler.handle(POJOActivityTaskHandler.java:211)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:192)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:154)
	at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
14:15:53.847 [Activity Executor taskQueue="ASSORTMENT_LIFECYCLE", namespace="default": 1] ERROR i.t.internal.worker.PollerOptions - uncaught exception
java.lang.RuntimeException: Failure processing activity response. WorkflowId=6a84dbc9-5f7a-42c5-a018-59575ae0cbe1, RunId=6797bac9-4b6b-40b4-950f-66f054ec1e00, ActivityType=PreProcessPlan, ActivityId=d30d091a-49cf-30d1-a0d5-b74763930db3
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.wrapFailure(ActivityWorker.java:259)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.wrapFailure(ActivityWorker.java:154)
	at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:79)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: workflow execution already completed
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
	at io.temporal.api.workflowservice.v1.WorkflowServiceGrpc$WorkflowServiceBlockingStub.respondActivityTaskFailed(WorkflowServiceGrpc.java:2757)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.lambda$sendReply$1(ActivityWorker.java:305)
	at io.temporal.internal.common.GrpcRetryer.lambda$retry$0(GrpcRetryer.java:79)
	at io.temporal.internal.common.GrpcRetryer.retryWithResult(GrpcRetryer.java:97)
	at io.temporal.internal.common.GrpcRetryer.retry(GrpcRetryer.java:76)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.sendReply(ActivityWorker.java:299)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:196)
	at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:154)
	at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73)

I created activity and usually run it from workflow. During activity execution I throws ApplicationFailure.newNonRetryableFailure(). After that in few second I see “Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: workflow execution already completed.”. I want to stop workflow waiting of activity result after throwing newNonRetryableFailure.
How I can do that? Or how I can handle not found case?

Regarding the error, see this forum question and answer below it.

I want to stop workflow waiting of activity result after throwing newNonRetryableFailure.

Can you show your code? Seems you are invoking the activity async and not waiting on it to complete before completing workflow execution.
You could also set failures for which not to retry your activity via ActivityOptions->RetryOptions->setDoNotRetry