Skip to content

Commit

Permalink
Access last run details (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j authored Jan 20, 2021
1 parent f1b6a72 commit 3e18a77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -1505,3 +1505,8 @@ func convertRetryPolicy(retryPolicy *RetryPolicy) *commonpb.RetryPolicy {
NonRetryableErrorTypes: retryPolicy.NonRetryableErrorTypes,
}
}

// GetLastCompletionResultFromWorkflowInfo returns value of last completion result.
func GetLastCompletionResultFromWorkflowInfo(info *WorkflowInfo) *commonpb.Payloads {
return info.lastCompletionResult
}
6 changes: 6 additions & 0 deletions internalbindings/internalbindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package internalbindings

import (
commonpb "go.temporal.io/api/common/v1"
failurepb "go.temporal.io/api/failure/v1"
"go.temporal.io/sdk/converter"
"go.temporal.io/sdk/internal"
Expand Down Expand Up @@ -87,3 +88,8 @@ func ConvertErrorToFailure(err error, dc converter.DataConverter) *failurepb.Fai
func ConvertFailureToError(failure *failurepb.Failure, dc converter.DataConverter) error {
return internal.ConvertFailureToError(failure, dc)
}

// GetLastCompletionResult returns last completion result from workflow.
func GetLastCompletionResult(env WorkflowEnvironment) *commonpb.Payloads {
return internal.GetLastCompletionResultFromWorkflowInfo(env.WorkflowInfo())
}

0 comments on commit 3e18a77

Please sign in to comment.