From 9263e00e93262de3d39f103420cdcd12fc19b6f5 Mon Sep 17 00:00:00 2001 From: gruzovator Date: Sat, 4 Apr 2026 18:45:50 +0300 Subject: [PATCH 1/3] fix: IsWorkflowExecutionAlreadyStartedError now unwraps WorkflowExecutionAlreadyStarted --- temporal/error.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/temporal/error.go b/temporal/error.go index 7801e2250..1e583fde0 100644 --- a/temporal/error.go +++ b/temporal/error.go @@ -214,8 +214,9 @@ func IsApplicationError(err error) bool { // WorkflowExecutionAlreadyStartedError or if an error in the chain is a // ChildWorkflowExecutionAlreadyStartedError. func IsWorkflowExecutionAlreadyStartedError(err error) bool { - if _, ok := err.(*serviceerror.WorkflowExecutionAlreadyStarted); ok { - return ok + var alreadyStartedError *serviceerror.WorkflowExecutionAlreadyStarted + if errors.As(err, &alreadyStartedError) { + return true } var childError *ChildWorkflowExecutionAlreadyStartedError return errors.As(err, &childError) From a9c875dba973d7705d0f7d835bab4f7214c43dc6 Mon Sep 17 00:00:00 2001 From: gruzovator Date: Sat, 4 Apr 2026 19:43:59 +0300 Subject: [PATCH 2/3] fix: improve IsWorkflowExecutionAlreadyStartedError comment --- temporal/error.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/temporal/error.go b/temporal/error.go index 1e583fde0..794a12f4b 100644 --- a/temporal/error.go +++ b/temporal/error.go @@ -5,7 +5,6 @@ import ( enumspb "go.temporal.io/api/enums/v1" "go.temporal.io/api/serviceerror" - "go.temporal.io/sdk/internal" ) @@ -210,9 +209,8 @@ func IsApplicationError(err error) bool { return errors.As(err, &applicationError) } -// IsWorkflowExecutionAlreadyStartedError return if the err is a -// WorkflowExecutionAlreadyStartedError or if an error in the chain is a -// ChildWorkflowExecutionAlreadyStartedError. +// IsWorkflowExecutionAlreadyStartedError returns true if an error in the chain +// is a WorkflowExecutionAlreadyStartedError or ChildWorkflowExecutionAlreadyStartedError. func IsWorkflowExecutionAlreadyStartedError(err error) bool { var alreadyStartedError *serviceerror.WorkflowExecutionAlreadyStarted if errors.As(err, &alreadyStartedError) { From 7224225f6a1c2c0523a664bda277ea1e4a3f5557 Mon Sep 17 00:00:00 2001 From: gruzovator Date: Sat, 4 Apr 2026 19:48:46 +0300 Subject: [PATCH 3/3] fix: improve IsWorkflowExecutionAlreadyStartedError comment --- temporal/error.go | 1 + 1 file changed, 1 insertion(+) diff --git a/temporal/error.go b/temporal/error.go index 794a12f4b..b3aba9d0c 100644 --- a/temporal/error.go +++ b/temporal/error.go @@ -5,6 +5,7 @@ import ( enumspb "go.temporal.io/api/enums/v1" "go.temporal.io/api/serviceerror" + "go.temporal.io/sdk/internal" )