diff --git a/temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java b/temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java index da5d2f736..30da4227d 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java @@ -817,6 +817,11 @@ public ExecuteNexusOperationOutput executeNexusOperation( ? dataConverter.fromPayload( b.get(), input.getResultClass(), input.getResultType()) : null); + // We register an empty handler to make sure that this promise is always "accessed" and never + // leads to a log about it being completed exceptionally and non-accessed. + // The "main" operation promise is the one returned from the execute method and that + // promise will always be logged if not accessed. + operationPromise.handle((ex, failure) -> null); return new ExecuteNexusOperationOutput<>(result, operationPromise); }