Documentation
¶
Overview ¶
Package client is used by external programs to communicate with Temporal service.
NOTE: DO NOT USE THIS API INSIDE OF ANY WORKFLOW CODE!!!
Index ¶
- Constants
- Variables
- func HistoryFromJSON(r io.Reader, options HistoryJSONOptions) (*historypb.History, error)
- func NewValue(data *commonpb.Payloads) converter.EncodedValue
- func NewValues(data *commonpb.Payloads) converter.EncodedValues
- func NewWorkflowServiceProxyServer(options WorkflowServiceProxyOptions) (workflowservice.WorkflowServiceServer, error)
- type ActivityExecutionDescription
- type ActivityExecutionInfo
- type ActivityHandle
- type AutoUpgradeVersioningOverride
- type BuildIDOpAddNewCompatibleVersiondeprecated
- type BuildIDOpAddNewIDInNewDefaultSetdeprecated
- type BuildIDOpPromoteIDWithinSetdeprecated
- type BuildIDOpPromoteSetdeprecated
- type BuildIDReachabilitydeprecated
- type BuildIDTaskReachability
- type CancelActivityOptions
- type CheckHealthRequest
- type CheckHealthResponse
- type Client
- func Dial(options Options) (Client, error)
- func DialContext(ctx context.Context, options Options) (Client, error)
- func NewClient(options Options) (Client, error)deprecated
- func NewClientFromExisting(existingClient Client, options Options) (Client, error)
- func NewClientFromExistingWithContext(ctx context.Context, existingClient Client, options Options) (Client, error)
- func NewLazyClient(options Options) (Client, error)
- type CompleteActivityByActivityIDOptions
- type CompleteActivityByIDOptions
- type CompleteActivityOptions
- type ConnectionOptions
- type CountActivitiesAggregationGroup
- type CountActivitiesOptions
- type CountActivitiesResult
- type Credentials
- type Deploymentdeprecated
- type DeploymentClientdeprecated
- type DeploymentDescribeOptionsdeprecated
- type DeploymentDescriptiondeprecated
- type DeploymentGetCurrentOptionsdeprecated
- type DeploymentGetCurrentResponsedeprecated
- type DeploymentGetReachabilityOptionsdeprecated
- type DeploymentInfodeprecated
- type DeploymentListEntrydeprecated
- type DeploymentListIteratordeprecated
- type DeploymentListOptionsdeprecated
- type DeploymentMetadataUpdatedeprecated
- type DeploymentReachabilitydeprecated
- type DeploymentReachabilityInfodeprecated
- type DeploymentSetCurrentOptionsdeprecated
- type DeploymentSetCurrentResponsedeprecated
- type DeploymentTaskQueueInfodeprecated
- type DescribeActivityOptions
- type DescribeTaskQueueEnhancedOptions
- type GetActivityHandleOptions
- type GetWorkerBuildIdCompatibilityOptionsdeprecated
- type GetWorkerTaskReachabilityOptionsdeprecated
- type GetWorkerVersioningOptionsdeprecated
- type GetWorkflowUpdateHandleOptions
- type HistoryEventIterator
- type HistoryJSONOptions
- type ListActivitiesOptions
- type ListActivitiesResult
- type MetricsCounter
- type MetricsGauge
- type MetricsHandler
- type MetricsTimer
- type NamespaceClient
- type Options
- type PinnedVersioningOverride
- type Plugin
- type PluginBase
- type PluginConfigureClientOptions
- type PluginNewClientOptions
- type QueryWorkflowWithOptionsRequest
- type QueryWorkflowWithOptionsResponse
- type RecordActivityHeartbeatByIDOptions
- type RecordActivityHeartbeatOptions
- type Schedule
- type ScheduleAction
- type ScheduleActionResult
- type ScheduleBackfill
- type ScheduleBackfillOptions
- type ScheduleCalendarSpec
- type ScheduleClient
- type ScheduleDescription
- type ScheduleHandle
- type ScheduleInfo
- type ScheduleIntervalSpec
- type ScheduleListEntry
- type ScheduleListIterator
- type ScheduleListOptions
- type ScheduleOptions
- type SchedulePauseOptions
- type SchedulePolicies
- type ScheduleRange
- type ScheduleSpec
- type ScheduleState
- type ScheduleTriggerOptions
- type ScheduleUnpauseOptions
- type ScheduleUpdate
- type ScheduleUpdateInput
- type ScheduleUpdateOptions
- type ScheduleWorkflowAction
- type ScheduleWorkflowExecution
- type StartActivityOptions
- type StartWorkflowOptions
- type TaskQueueDescription
- type TaskQueuePollerInfo
- type TaskQueueReachabilitydeprecated
- type TaskQueueStats
- type TaskQueueType
- type TaskQueueTypeInfo
- type TaskQueueVersionInfodeprecated
- type TaskQueueVersionSelection
- type TaskQueueVersioningInfo
- type TaskReachabilitydeprecated
- type TerminateActivityOptions
- type UpdateWithStartWorkflowOptions
- type UpdateWorkerBuildIdCompatibilityOptionsdeprecated
- type UpdateWorkerVersioningRulesOptionsdeprecated
- type UpdateWorkflowExecutionOptionsRequest
- type UpdateWorkflowOptions
- type VersioningAssignmentRuledeprecated
- type VersioningAssignmentRuleWithTimestampdeprecated
- type VersioningConflictTokendeprecated
- type VersioningOperationAddRedirectRuledeprecated
- type VersioningOperationCommitBuildIDdeprecated
- type VersioningOperationDeleteAssignmentRuledeprecated
- type VersioningOperationDeleteRedirectRuledeprecated
- type VersioningOperationInsertAssignmentRuledeprecated
- type VersioningOperationReplaceAssignmentRuledeprecated
- type VersioningOperationReplaceRedirectRuledeprecated
- type VersioningOverride
- type VersioningOverrideChange
- type VersioningRampByPercentagedeprecated
- type VersioningRedirectRuledeprecated
- type VersioningRedirectRuleWithTimestampdeprecated
- type WithStartWorkflowOperation
- type WorkerBuildIDVersionSetsdeprecated
- type WorkerDeploymentClient
- type WorkerDeploymentDeleteOptions
- type WorkerDeploymentDeleteResponse
- type WorkerDeploymentDeleteVersionOptions
- type WorkerDeploymentDeleteVersionResponse
- type WorkerDeploymentDescribeOptions
- type WorkerDeploymentDescribeResponse
- type WorkerDeploymentDescribeVersionOptions
- type WorkerDeploymentHandle
- type WorkerDeploymentInfo
- type WorkerDeploymentListEntry
- type WorkerDeploymentListIterator
- type WorkerDeploymentListOptions
- type WorkerDeploymentMetadataUpdate
- type WorkerDeploymentRoutingConfig
- type WorkerDeploymentSetCurrentVersionOptions
- type WorkerDeploymentSetCurrentVersionResponse
- type WorkerDeploymentSetManagerIdentityOptions
- type WorkerDeploymentSetManagerIdentityResponse
- type WorkerDeploymentSetRampingVersionOptions
- type WorkerDeploymentSetRampingVersionResponse
- type WorkerDeploymentTaskQueueInfo
- type WorkerDeploymentUpdateVersionMetadataOptions
- type WorkerDeploymentUpdateVersionMetadataResponse
- type WorkerDeploymentVersionDescription
- type WorkerDeploymentVersionDrainageInfo
- type WorkerDeploymentVersionDrainageStatus
- type WorkerDeploymentVersionInfo
- type WorkerDeploymentVersionSummary
- type WorkerTaskReachabilitydeprecated
- type WorkerVersionCapabilities
- type WorkerVersioningMode
- type WorkerVersioningRulesdeprecated
- type WorkflowExecutionDescription
- type WorkflowExecutionMetadata
- type WorkflowExecutionOptions
- type WorkflowExecutionOptionsChanges
- type WorkflowRun
- type WorkflowRunGetOptions
- type WorkflowServiceProxyOptions
- type WorkflowUpdateHandle
- type WorkflowUpdateServiceTimeoutOrCanceledError
- type WorkflowUpdateStage
Constants ¶
const ( // DeploymentReachabilityUnspecified - Reachability level not specified. // // Deprecated: Use [WorkerDeploymentVersionDrainageStatus] DeploymentReachabilityUnspecified = internal.DeploymentReachabilityUnspecified // DeploymentReachabilityReachable - The deployment is reachable by new // and/or open workflows. The deployment cannot be decommissioned safely. // // Deprecated: Use [WorkerDeploymentVersionDrainageStatus] DeploymentReachabilityReachable = internal.DeploymentReachabilityReachable // DeploymentReachabilityClosedWorkflows - The deployment is not reachable // by new or open workflows, but might be still needed by // Queries sent to closed workflows. The deployment can be decommissioned // safely if user does not query closed workflows. // // Deprecated: Use [WorkerDeploymentVersionDrainageStatus] DeploymentReachabilityClosedWorkflows = internal.DeploymentReachabilityClosedWorkflows // DeploymentReachabilityUnreachable - The deployment is not reachable by // any workflow because all the workflows who needed this // deployment are out of the retention period. The deployment can be // decommissioned safely. // // Deprecated: Use [WorkerDeploymentVersionDrainageStatus] DeploymentReachabilityUnreachable = internal.DeploymentReachabilityUnreachable )
const ( // WorkerDeploymentVersionDrainageStatusUnspecified - Drainage status not specified. // // NOTE: Experimental WorkerDeploymentVersionDrainageStatusUnspecified = internal.WorkerDeploymentVersionDrainageStatusUnspecified // WorkerDeploymentVersionDrainageStatusDraining - The Worker Deployment Version is not // used by new workflows, but it is still used by open pinned workflows. // This Version cannot be decommissioned safely. // // NOTE: Experimental WorkerDeploymentVersionDrainageStatusDraining = internal.WorkerDeploymentVersionDrainageStatusDraining // WorkerDeploymentVersionDrainageStatusDrained - The Worker Deployment Version is not // used by new or open workflows, but it might still be needed to execute // Queries sent to closed workflows. This Version can be decommissioned safely if the user // does not expect to query closed workflows. In some cases this requires waiting for some // time after it is drained to guarantee no pending queries. // // NOTE: Experimental WorkerDeploymentVersionDrainageStatusDrained = internal.WorkerDeploymentVersionDrainageStatusDrained )
const ( // WorkerVersioningModeUnspecified - Versioning mode not reported. // // NOTE: Experimental WorkerVersioningModeUnspecified = internal.WorkerVersioningModeUnspecified // WorkerVersioningModeUnversioned - Workers with this mode are not // distinguished from each other for task routing, even if they // have different versions. // // NOTE: Experimental WorkerVersioningModeUnversioned = internal.WorkerVersioningModeUnversioned // WorkerVersioningModeVersioned - Workers with this mode are part of a // Worker Deployment Version which is a combination of a deployment name // and a build id. // // Each Deployment Version is distinguished from other Versions for task // routing, and users can configure the Temporal Server to send tasks to a // particular Version. // // NOTE: Experimental WorkerVersioningModeVersioned = internal.WorkerVersioningModeVersioned )
const ( // TaskReachabilityUnspecified indicates the reachability was not specified TaskReachabilityUnspecified = internal.TaskReachabilityUnspecified // TaskReachabilityNewWorkflows indicates the Build Id might be used by new workflows TaskReachabilityNewWorkflows = internal.TaskReachabilityNewWorkflows // TaskReachabilityExistingWorkflows indicates the Build Id might be used by open workflows // and/or closed workflows. TaskReachabilityExistingWorkflows = internal.TaskReachabilityExistingWorkflows // TaskReachabilityOpenWorkflows indicates the Build Id might be used by open workflows. TaskReachabilityOpenWorkflows = internal.TaskReachabilityOpenWorkflows // TaskReachabilityClosedWorkflows indicates the Build Id might be used by closed workflows TaskReachabilityClosedWorkflows = internal.TaskReachabilityClosedWorkflows )
const ( // TaskQueueTypeUnspecified indicates the task queue type was not specified. TaskQueueTypeUnspecified = internal.TaskQueueTypeUnspecified // TaskQueueTypeWorkflow indicates the task queue is used for dispatching workflow tasks. TaskQueueTypeWorkflow = internal.TaskQueueTypeWorkflow // TaskQueueTypeActivity indicates the task queue is used for delivering activity tasks. TaskQueueTypeActivity = internal.TaskQueueTypeActivity // TaskQueueTypeNexus indicates the task queue is used for dispatching Nexus requests. TaskQueueTypeNexus = internal.TaskQueueTypeNexus )
const ( // BuildIDTaskReachabilityUnspecified indicates that task reachability was not reported. BuildIDTaskReachabilityUnspecified = internal.BuildIDTaskReachabilityUnspecified // BuildIDTaskReachabilityReachable indicates that this Build ID may be used by new workflows or activities // (based on versioning rules), or there are open workflows or backlogged activities assigned to it. BuildIDTaskReachabilityReachable = internal.BuildIDTaskReachabilityReachable // BuildIDTaskReachabilityClosedWorkflowsOnly specifies that this Build ID does not have open workflows // and is not reachable by new workflows, but MAY have closed workflows within the namespace retention period. // Not applicable to activity-only task queues. BuildIDTaskReachabilityClosedWorkflowsOnly = internal.BuildIDTaskReachabilityClosedWorkflowsOnly // BuildIDTaskReachabilityUnreachable indicates that this Build ID is not used for new executions, nor // it has been used by any existing execution within the retention period. BuildIDTaskReachabilityUnreachable = internal.BuildIDTaskReachabilityUnreachable )
const ( // WorkflowUpdateStageUnspecified indicates the wait stage was not specified WorkflowUpdateStageUnspecified = internal.WorkflowUpdateStageUnspecified // WorkflowUpdateStageAdmitted indicates the update is admitted WorkflowUpdateStageAdmitted = internal.WorkflowUpdateStageAdmitted // WorkflowUpdateStageAccepted indicates the update is accepted WorkflowUpdateStageAccepted = internal.WorkflowUpdateStageAccepted // WorkflowUpdateStageCompleted indicates the update is completed WorkflowUpdateStageCompleted = internal.WorkflowUpdateStageCompleted )
const ( // DefaultHostPort is the host:port which is used if not passed with options. DefaultHostPort = internal.LocalHostPort // DefaultNamespace is the namespace name which is used if not passed with options. DefaultNamespace = internal.DefaultNamespace // QueryTypeStackTrace is the build in query type for Client.QueryWorkflow() call. Use this query type to get the call // stack of the workflow. The result will be a string encoded in the converter.EncodedValue. QueryTypeStackTrace string = internal.QueryTypeStackTrace // QueryTypeOpenSessions is the build in query type for Client.QueryWorkflow() call. Use this query type to get all open // sessions in the workflow. The result will be a list of SessionInfo encoded in the converter.EncodedValue. QueryTypeOpenSessions string = internal.QueryTypeOpenSessions // UnversionedBuildID is a stand-in for a Build Id for unversioned Workers. // WARNING: Worker versioning is currently experimental UnversionedBuildID string = internal.UnversionedBuildID )
Variables ¶
var MetricsNopHandler = metrics.NopHandler
MetricsNopHandler is a noop handler that does nothing with the metrics.
Functions ¶
func HistoryFromJSON ¶ added in v1.16.0
HistoryFromJSON deserializes history from a reader of JSON bytes. This does not close the reader if it is closeable.
func NewValue ¶
func NewValue(data *commonpb.Payloads) converter.EncodedValue
NewValue creates a new converter.EncodedValue which can be used to decode binary data returned by Temporal. For example: User had Activity.RecordHeartbeat(ctx, "my-heartbeat") and then got response from calling client.Client.DescribeWorkflowExecution. The response contains binary field PendingActivityInfo.HeartbeatDetails, which can be decoded by using:
var result string // This need to be same type as the one passed to RecordHeartbeat NewValue(data).Get(&result)
func NewValues ¶
func NewValues(data *commonpb.Payloads) converter.EncodedValues
NewValues creates a new converter.EncodedValues which can be used to decode binary data returned by Temporal. For example: User has Activity.RecordHeartbeat(ctx, "my-heartbeat", 123) and then got a response from calling client.Client.DescribeWorkflowExecution. The response contains the binary field PendingActivityInfo.HeartbeatDetails, which can be decoded by using:
var result1 string var result2 int // These need to be same type as those arguments passed to RecordHeartbeat NewValues(data).Get(&result1, &result2)
func NewWorkflowServiceProxyServer ¶ added in v1.14.0
func NewWorkflowServiceProxyServer(options WorkflowServiceProxyOptions) (workflowservice.WorkflowServiceServer, error)
NewWorkflowServiceProxyServer creates a WorkflowServiceServer suitable for registering with a GRPC Server. Requests will be forwarded to the passed in WorkflowService Client. GRPC interceptors can be added on the Server or Client to adjust requests and responses.
Types ¶
type ActivityExecutionDescription ¶ added in v1.40.0
type ActivityExecutionDescription = internal.ClientActivityExecutionDescription
ActivityExecutionDescription contains detailed information about an activity execution. This is returned by ClientActivityHandle.Describe.
NOTE: Experimental
type ActivityExecutionInfo ¶ added in v1.40.0
type ActivityExecutionInfo = internal.ClientActivityExecutionInfo
ActivityExecutionInfo contains information about an activity execution. This is returned by ListActivities and embedded in ClientActivityExecutionDescription.
NOTE: Experimental
type ActivityHandle ¶ added in v1.40.0
type ActivityHandle = internal.ClientActivityHandle
ActivityHandle represents a running or completed standalone activity execution. It can be used to get the result, describe, cancel, or terminate the activity.
NOTE: Experimental
type AutoUpgradeVersioningOverride ¶ added in v1.35.0
type AutoUpgradeVersioningOverride = internal.AutoUpgradeVersioningOverride
AutoUpgradeVersioningOverride means the workflow will auto-upgrade to the current deployment version on the next workflow task.
NOTE: Experimental
type BuildIDOpAddNewCompatibleVersion
deprecated
added in
v1.23.0
type BuildIDOpAddNewCompatibleVersion = internal.BuildIDOpAddNewCompatibleVersion
BuildIDOpAddNewCompatibleVersion is an operation for UpdateWorkerBuildIdCompatibilityOptions to add a new BuildID to an existing compatible set.
Deprecated: Replaced by the new worker versioning api.
type BuildIDOpAddNewIDInNewDefaultSet
deprecated
added in
v1.23.0
type BuildIDOpAddNewIDInNewDefaultSet = internal.BuildIDOpAddNewIDInNewDefaultSet
BuildIDOpAddNewIDInNewDefaultSet is an operation for UpdateWorkerBuildIdCompatibilityOptions to add a new BuildID in a new default set.
Deprecated: Replaced by the new worker versioning api.
type BuildIDOpPromoteIDWithinSet
deprecated
added in
v1.23.0
type BuildIDOpPromoteIDWithinSet = internal.BuildIDOpPromoteIDWithinSet
BuildIDOpPromoteIDWithinSet is an operation for UpdateWorkerBuildIdCompatibilityOptions to promote a BuildID within a set to be the default.
Deprecated: Replaced by the new worker versioning api.
type BuildIDOpPromoteSet
deprecated
added in
v1.23.0
type BuildIDOpPromoteSet = internal.BuildIDOpPromoteSet
BuildIDOpPromoteSet is an operation for UpdateWorkerBuildIdCompatibilityOptions to promote a set to be the default set by targeting an existing BuildID.
Deprecated: Replaced by the new worker versioning api.
type BuildIDReachability
deprecated
added in
v1.25.0
type BuildIDReachability = internal.BuildIDReachability
BuildIDReachability describes the reachability of a buildID
Deprecated: Replaced by the new worker versioning api.
type BuildIDTaskReachability ¶ added in v1.27.0
type BuildIDTaskReachability = internal.BuildIDTaskReachability
BuildIDTaskReachability specifies which category of tasks may reach a versioned worker of a certain Build ID.
NOTE: future activities who inherit their workflow's Build ID but not its task queue will not be accounted for reachability as server cannot know if they'll happen as they do not use assignment rules of their task queue. Same goes for Child Workflows or Continue-As-New Workflows who inherit the parent/previous workflow's Build ID but not its task queue. In those cases, make sure to query reachability for the parent/previous workflow's task queue as well. WARNING: Worker versioning is currently experimental
type CancelActivityOptions ¶ added in v1.40.0
type CancelActivityOptions = internal.ClientCancelActivityOptions
CancelActivityOptions contains options for ClientActivityHandle.Cancel call.
NOTE: Experimental
type CheckHealthRequest ¶ added in v1.15.0
type CheckHealthRequest = internal.CheckHealthRequest
CheckHealthRequest is a request for Client.CheckHealth.
type CheckHealthResponse ¶ added in v1.15.0
type CheckHealthResponse = internal.CheckHealthResponse
CheckHealthResponse is a response for Client.CheckHealth.
type Client ¶
type Client interface {
// ExecuteWorkflow starts a workflow execution and returns a WorkflowRun instance or error
//
// This can be used to start a workflow using a function reference or workflow type name.
// Either by
// ExecuteWorkflow(ctx, options, "workflowTypeName", arg1, arg2, arg3)
// or
// ExecuteWorkflow(ctx, options, workflowExecuteFn, arg1, arg2, arg3)
// The errors it can return:
// - serviceerror.NamespaceNotFound, if namespace does not exist
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.WorkflowExecutionAlreadyStarted, when WorkflowExecutionErrorWhenAlreadyStarted is specified
//
// WorkflowRun has 3 methods:
// - GetWorkflowID() string: which return the started workflow ID
// - GetRunID() string: which return the first started workflow run ID (please see below)
// - Get(ctx context.Context, valuePtr interface{}) error: which will fill the workflow
// execution result to valuePtr, if workflow execution is a success, or return corresponding
// error. This is a blocking API.
//
// NOTE: If the started workflow returns ContinueAsNewError during the workflow execution, the
// returned result of GetRunID() will be the started workflow run ID, not the new run ID caused by ContinueAsNewError.
// However, Get(ctx context.Context, valuePtr interface{}) will return result from the run which did not return ContinueAsNewError.
// Say ExecuteWorkflow started a workflow, in its first run, has run ID "run ID 1", and returned ContinueAsNewError,
// the second run has run ID "run ID 2" and return some result other than ContinueAsNewError:
// GetRunID() will always return "run ID 1" and Get(ctx context.Context, valuePtr interface{}) will return the result of second run.
//
// NOTE: DO NOT USE THIS API INSIDE A WORKFLOW, USE workflow.ExecuteChildWorkflow instead
ExecuteWorkflow(ctx context.Context, options StartWorkflowOptions, workflow interface{}, args ...interface{}) (WorkflowRun, error)
// GetWorkflow retrieves a workflow execution and return a WorkflowRun instance (described above)
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the last running execution of that workflow ID.
//
// WorkflowRun has 2 methods:
// - GetRunID() string: which return the first started workflow run ID (please see below)
// - Get(ctx context.Context, valuePtr interface{}) error: which will fill the workflow
// execution result to valuePtr, if workflow execution is a success, or return corresponding
// error. This is a blocking API.
// If workflow not found, the Get() will return serviceerror.NotFound.
//
// NOTE: if the started workflow return ContinueAsNewError during the workflow execution, the
// return result of GetRunID() will be the started workflow run ID, not the new run ID caused by ContinueAsNewError,
// however, Get(ctx context.Context, valuePtr interface{}) will return result from the run which did not return ContinueAsNewError.
// Say ExecuteWorkflow started a workflow, in its first run, has run ID "run ID 1", and returned ContinueAsNewError,
// the second run has run ID "run ID 2" and return some result other than ContinueAsNewError:
// GetRunID() will always return "run ID 1" and Get(ctx context.Context, valuePtr interface{}) will return the result of second run.
GetWorkflow(ctx context.Context, workflowID string, runID string) WorkflowRun
// SignalWorkflow sends a signals to a running workflow.
// - workflow ID of the workflow.
// - runID can be default(empty string). If set to empty string, then it will pick the running execution of that workflow ID.
// - signalName name to identify the signal.
// The errors it can return:
// - serviceerror.NotFound
// - serviceerror.Internal
// - serviceerror.Unavailable
SignalWorkflow(ctx context.Context, workflowID string, runID string, signalName string, arg interface{}) error
// SignalWithStartWorkflow sends a signal to a running workflow.
// If the workflow is not running or not found, it starts the workflow and then sends the signal in transaction.
// - workflowID, signalName, signalArg are the same as SignalWorkflow's parameters
// - options, workflow, workflowArgs are the same as StartWorkflow's parameters
// - the workflowID parameter is used instead of options.ID. If the latter is present, it must match the workflowID.
//
// Note: options.WorkflowIDReusePolicy defaults to AllowDuplicate in this API.
//
// The errors it can return:
// - serviceerror.NotFound
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{},
options StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (WorkflowRun, error)
// NewWithStartWorkflowOperation returns a WithStartWorkflowOperation for use with UpdateWithStartWorkflow.
// See [client.Client.UpdateWithStartWorkflow].
NewWithStartWorkflowOperation(options StartWorkflowOptions, workflow interface{}, args ...interface{}) WithStartWorkflowOperation
// CancelWorkflow request cancellation of a workflow in execution. Cancellation request closes the channel
// returned by the workflow.Context.Done() of the workflow that is target of the request.
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the currently running execution of that workflow ID.
// The errors it can return:
// - serviceerror.NotFound
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
CancelWorkflow(ctx context.Context, workflowID string, runID string) error
// TerminateWorkflow terminates a workflow execution. Terminate stops a workflow execution immediately without
// letting the workflow to perform any cleanup
// workflowID is required, other parameters are optional.
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the running execution of that workflow ID.
// The errors it can return:
// - serviceerror.NotFound
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details ...interface{}) error
// GetWorkflowHistory gets history events of a particular workflow
// - workflow ID of the workflow.
// - runID can be default(empty string). if empty string then it will pick the last running execution of that workflow ID.
// - whether use long poll for tracking new events: when the workflow is running, there can be new events generated during iteration
// of HistoryEventIterator, if isLongPoll == true, then iterator will do long poll, tracking new history event, i.e. the iteration
// will not be finished until workflow is finished; if isLongPoll == false, then iterator will only return current history events.
// - whether return all history events or just the last event, which contains the workflow execution end result
// Example:-
// To iterate all events,
// iter := GetWorkflowHistory(ctx, workflowID, runID, isLongPoll, filterType)
// events := []*shared.HistoryEvent{}
// for iter.HasNext() {
// event, err := iter.Next()
// if err != nil {
// return err
// }
// events = append(events, event)
// }
GetWorkflowHistory(ctx context.Context, workflowID string, runID string, isLongPoll bool, filterType enumspb.HistoryEventFilterType) HistoryEventIterator
// CompleteActivity reports activity completed.
// An activity's implementation can return activity.ErrResultPending to indicate it will be completed asynchronously.
// In that case, this CompleteActivity() method should be called when the activity is completed with the
// actual result and error. If err is nil, activity task completed event will be reported; if err is CanceledError,
// activity task canceled event will be reported; otherwise, activity task failed event will be reported.
// An activity implementation should use GetActivityInfo(ctx).TaskToken function to get task token to use for completion.
// Example:-
// To complete with a result.
// CompleteActivity(token, "Done", nil)
// To fail the activity with an error.
// CompleteActivity(token, nil, temporal.NewApplicationError("reason", details)
// The activity can fail with below errors ApplicationError, TimeoutError, CanceledError.
//
// If using a context-aware converter (DataConverterWithSerializationContext or
// FailureConverterWithSerializationContext), consider using
// CompleteActivityWithOptions to provide full activity metadata
// (ActivityType, WorkflowType, TaskQueue) to your codec.
CompleteActivity(ctx context.Context, taskToken []byte, result interface{}, err error) error
// CompleteActivityWithOptions reports activity completed with full context options.
// Similar to CompleteActivity but accepts a struct with optional ActivitySerializationContext
// fields (ActivityType, WorkflowType, TaskQueue, etc.) for custom codec support.
CompleteActivityWithOptions(ctx context.Context, opts CompleteActivityOptions) error
// CompleteActivityByID reports activity completed.
// Similar to CompleteActivity, but may save the user from keeping taskToken info.
// This method works only for workflow activities. workflowID and runID must be set to the workflow ID and workflow run ID
// of the workflow that started the activity. To complete a standalone activity (not started by workflow),
// use CompleteActivityByActivityID.
//
// An activity's implementation can return activity.ErrResultPending to indicate it will be completed asynchronously.
// In that case, this CompleteActivityByID() method should be called when the activity is completed with the
// actual result and error. If err is nil, activity task completed event will be reported; if err is CanceledError,
// activity task canceled event will be reported; otherwise, activity task failed event will be reported.
// An activity implementation should use activityID provided in ActivityOption to use for completion.
// namespace, workflowID and activityID are required, runID is optional.
// The errors it can return:
// - ApplicationError
// - TimeoutError
// - CanceledError
//
// If using a context-aware converter (DataConverterWithSerializationContext or
// FailureConverterWithSerializationContext), consider using
// CompleteActivityByIDWithOptions to provide full activity metadata
// (ActivityType, WorkflowType, TaskQueue) to your codec.
CompleteActivityByID(ctx context.Context, namespace, workflowID, runID, activityID string, result interface{}, err error) error
// CompleteActivityByIDWithOptions reports activity completed with full context options.
// Similar to CompleteActivityByID but accepts a struct with optional ActivitySerializationContext
// fields (ActivityType, WorkflowType, TaskQueue) for custom codec support.
CompleteActivityByIDWithOptions(ctx context.Context, opts CompleteActivityByIDOptions) error
// CompleteActivityByActivityID reports activity completed.
// Similar to CompleteActivity, but may save the user from keeping taskToken info.
// This method works only for standalone activities. To complete a workflow activity, use CompleteActivityByID.
//
// An activity's implementation can return activity.ErrResultPending to indicate it will be completed asynchronously.
// In that case, this CompleteActivityByActivityID() method should be called when the activity is completed with the
// actual result and error. If err is nil, activity task completed event will be reported; if err is CanceledError,
// activity task canceled event will be reported; otherwise, activity task failed event will be reported.
// An activity implementation should use activityID provided in ActivityOption to use for completion.
// namespace and activityID are required, activityRunID is optional.
// The errors it can return:
// - ApplicationError
// - TimeoutError
// - CanceledError
//
// If using a context-aware converter (DataConverterWithSerializationContext or
// FailureConverterWithSerializationContext), consider using
// CompleteActivityByActivityIDWithOptions to provide full activity metadata
// (ActivityType, WorkflowType, TaskQueue) to your codec.
CompleteActivityByActivityID(ctx context.Context, namespace, activityID, activityRunID string, result interface{}, err error) error
// CompleteActivityByActivityIDWithOptions reports standalone activity completed with full context options.
// Similar to CompleteActivityByActivityID but accepts a struct with optional
// ActivitySerializationContext fields for custom codec support.
CompleteActivityByActivityIDWithOptions(ctx context.Context, opts CompleteActivityByActivityIDOptions) error
// RecordActivityHeartbeat records heartbeat for an activity.
// taskToken - is the value of the binary "TaskToken" field of the "ActivityInfo" struct retrieved inside the activity.
// details - is the progress you want to record along with heart beat for this activity. If the activity is canceled,
// the error returned will be a CanceledError. If the activity is paused by the server, the error returned will be a
// ErrActivityPaused. If the activity is reset by the server, the error returned will be a ErrActivityReset.
// Otherwise the errors it can return:
// - serviceerror.NotFound
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// If using a context-aware converter (DataConverterWithSerializationContext or
// FailureConverterWithSerializationContext), consider using
// RecordActivityHeartbeatWithOptions to provide full activity metadata
// (ActivityType, WorkflowType, TaskQueue) to your codec.
RecordActivityHeartbeat(ctx context.Context, taskToken []byte, details ...interface{}) error
// RecordActivityHeartbeatWithOptions records heartbeat with full context options.
// Similar to RecordActivityHeartbeat but accepts a struct with optional
// ActivitySerializationContext fields for custom codec support.
RecordActivityHeartbeatWithOptions(ctx context.Context, opts RecordActivityHeartbeatOptions) error
// RecordActivityHeartbeatByID records heartbeat for an activity.
// details - is the progress you want to record along with heart beat for this activity. If the activity is canceled,
// the error returned will be a CanceledError. If the activity is paused by the server, the error returned will be a
// ErrActivityPaused. If the activity is reset by the server, the error returned will be a ErrActivityReset.
// The errors it can return:
// - serviceerror.NotFound
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// If using a context-aware converter (DataConverterWithSerializationContext or
// FailureConverterWithSerializationContext), consider using
// RecordActivityHeartbeatByIDWithOptions to provide full activity metadata
// (ActivityType, WorkflowType, TaskQueue) to your codec.
RecordActivityHeartbeatByID(ctx context.Context, namespace, workflowID, runID, activityID string, details ...interface{}) error
// RecordActivityHeartbeatByIDWithOptions records heartbeat with full context options.
// Similar to RecordActivityHeartbeatByID but accepts a struct with optional
// ActivitySerializationContext fields for custom codec support.
RecordActivityHeartbeatByIDWithOptions(ctx context.Context, opts RecordActivityHeartbeatByIDOptions) error
// ListClosedWorkflow gets closed workflow executions based on request filters.
// Retrieved workflow executions are sorted by close time in descending order.
//
// NOTE: heavy usage of this API may cause huge persistence pressure.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NamespaceNotFound
ListClosedWorkflow(ctx context.Context, request *workflowservice.ListClosedWorkflowExecutionsRequest) (*workflowservice.ListClosedWorkflowExecutionsResponse, error)
// ListOpenWorkflow gets open workflow executions based on request filters.
// Retrieved workflow executions are sorted by start time in descending order.
//
// NOTE: heavy usage of this API may cause huge persistence pressure.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NamespaceNotFound
ListOpenWorkflow(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)
// ListWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause, examples:
// - "(WorkflowId = 'wid1' or (WorkflowType = 'type2' and WorkflowId = 'wid2'))".
// - "CloseTime between '2019-08-27T15:04:05+00:00' and '2019-08-28T15:04:05+00:00'".
// - to list only open workflow use "CloseTime is null"
// For supported operations on different server versions see https://docs.temporal.io/visibility.
// Retrieved workflow executions are sorted by StartTime in descending order when list open workflow,
// and sorted by CloseTime in descending order for other queries.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)
// ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal
// cluster or target namespace is not configured for visibility archival or read is not enabled. The query is basically the SQL WHERE clause.
// However, different visibility archivers have different limitations on the query. Please check the documentation of the visibility archiver used
// by your namespace to see what kind of queries are accept and whether retrieved workflow executions are ordered or not.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)
// ScanWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// For supported operations on different server versions see https://docs.temporal.io/visibility.
// ScanWorkflow should be used when retrieving large amount of workflows and order is not needed.
// It will use more resources than ListWorkflow, but will be several times faster
// when retrieving millions of workflows.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// Deprecated: Use ListWorkflow instead.
ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error) //lint:ignore SA1019 the server API was deprecated.
// CountWorkflow gets number of workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// For supported operations on different server versions see https://docs.temporal.io/visibility.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)
// GetSearchAttributes returns valid search attributes keys and value types.
// The search attributes can be used in query of List/Scan/Count APIs. Adding new search attributes requires temporal server
// to update dynamic config ValidSearchAttributes.
//
// NOTE: This API is not supported on Temporal Cloud.
GetSearchAttributes(ctx context.Context) (*workflowservice.GetSearchAttributesResponse, error)
// QueryWorkflow queries a given workflow's last execution and returns the query result synchronously. Parameter workflowID
// and queryType are required, other parameters are optional. The workflowID and runID (optional) identify the
// target workflow execution that this query will be send to. If runID is not specified (empty string), server will
// use the currently running execution of that workflowID. The queryType specifies the type of query you want to
// run. By default, temporal supports "__stack_trace" as a standard query type, which will return string value
// representing the call stack of the target workflow. The target workflow could also setup different query handler
// to handle custom query types.
// See comments at workflow.SetQueryHandler(ctx Context, queryType string, handler interface{}) for more details
// on how to setup query handler within the target workflow.
// - workflowID is required.
// - runID can be default(empty string). if empty string then it will pick the running execution of that workflow ID.
// - queryType is the type of the query.
// - args... are the optional query parameters.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
// - serviceerror.QueryFailed
QueryWorkflow(ctx context.Context, workflowID string, runID string, queryType string, args ...interface{}) (converter.EncodedValue, error)
// QueryWorkflowWithOptions queries a given workflow execution and returns the query result synchronously.
// See QueryWorkflowWithOptionsRequest and QueryWorkflowWithOptionsResponse for more information.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
// - serviceerror.QueryFailed
QueryWorkflowWithOptions(ctx context.Context, request *QueryWorkflowWithOptionsRequest) (*QueryWorkflowWithOptionsResponse, error)
// DescribeWorkflowExecution returns information about the specified workflow execution.
// - runID can be default(empty string). if empty string then it will pick the last running execution of that workflow ID.
//
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
DescribeWorkflowExecution(ctx context.Context, workflowID, runID string) (*workflowservice.DescribeWorkflowExecutionResponse, error)
// DescribeWorkflow returns information about the specified workflow execution.
// - runID can be default(empty string). if empty string then it will pick the last running execution of that workflow ID.
//
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
DescribeWorkflow(ctx context.Context, workflowID, runID string) (*WorkflowExecutionDescription, error)
// DescribeTaskQueue returns information about the target taskqueue, right now this API returns the
// pollers which polled this taskqueue in last few minutes.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
DescribeTaskQueue(ctx context.Context, taskqueue string, taskqueueType enumspb.TaskQueueType) (*workflowservice.DescribeTaskQueueResponse, error)
// DescribeTaskQueueEnhanced returns information about the target task queue, broken down by Build Id:
// - List of pollers
// - Workflow Reachability status
// - Backlog info for Workflow and/or Activity tasks
// When not supported by the server, it returns an empty [TaskQueueDescription] if there is no information
// about the task queue, or an error when the response identifies an unsupported server.
// Note that using a sticky queue as target is not supported.
// Also, workflow reachability status is eventually consistent, and it could take a few minutes to update.
// WARNING: Worker versioning is currently experimental, and requires server 1.24+
DescribeTaskQueueEnhanced(ctx context.Context, options DescribeTaskQueueEnhancedOptions) (TaskQueueDescription, error)
// ResetWorkflowExecution resets an existing workflow execution to WorkflowTaskFinishEventId(exclusive).
// And it will immediately terminating the current execution instance.
// RequestId is used to deduplicate requests. It will be autogenerated if not set.
ResetWorkflowExecution(ctx context.Context, request *workflowservice.ResetWorkflowExecutionRequest) (*workflowservice.ResetWorkflowExecutionResponse, error)
// UpdateWorkerBuildIdCompatibility
// Allows you to update the worker-build-id based version sets for a particular task queue. This is used in
// conjunction with workers who specify their build id and thus opt into the feature.
//
// Deprecated: Use [client.Client.UpdateWorkerVersioningRules] with the versioning api.
UpdateWorkerBuildIdCompatibility(ctx context.Context, options *UpdateWorkerBuildIdCompatibilityOptions) error
// GetWorkerBuildIdCompatibility
// Returns the worker-build-id based version sets for a particular task queue.
//
// Deprecated: Use [client.Client.GetWorkerVersioningRules] with the versioning api.
GetWorkerBuildIdCompatibility(ctx context.Context, options *GetWorkerBuildIdCompatibilityOptions) (*WorkerBuildIDVersionSets, error)
// GetWorkerTaskReachability
// Returns which versions are is still in use by open or closed workflows
//
// Deprecated: Use [DescribeTaskQueueEnhanced] with the versioning api.
GetWorkerTaskReachability(ctx context.Context, options *GetWorkerTaskReachabilityOptions) (*WorkerTaskReachability, error)
// UpdateWorkerVersioningRules
// Allows updating the worker-build-id based assignment and redirect rules for a given task queue. This is used in
// conjunction with workers who specify their build id and thus opt into the feature.
// The errors it can return:
// - serviceerror.FailedPrecondition when the conflict token is invalid
//
// Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
//
// WARNING: Worker versioning is currently experimental, and requires server 1.24+
UpdateWorkerVersioningRules(ctx context.Context, options UpdateWorkerVersioningRulesOptions) (*WorkerVersioningRules, error)
// GetWorkerVersioningRules
// Returns the worker-build-id assignment and redirect rules for a task queue.
//
// Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
//
// WARNING: Worker versioning is currently experimental, and requires server 1.24+
GetWorkerVersioningRules(ctx context.Context, options GetWorkerVersioningOptions) (*WorkerVersioningRules, error)
// CheckHealth performs a server health check using the gRPC health check
// API. If the check fails, an error is returned.
CheckHealth(ctx context.Context, request *CheckHealthRequest) (*CheckHealthResponse, error)
// UpdateWorkflow issues an update request to the specified workflow and
// returns a handle to the update. The call will block until the update
// has reached the WaitForStage in the options. Note that this means
// that the call will not return successfully until the update has been
// delivered to a worker. Errors returned from the update handler or its
// validator will be exposed through the return value of
// WorkflowUpdateHandle.Get(). Errors that occur before the update is
// delivered to the workflow (e.g. if the required workflow ID field is
// missing from the UpdateWorkflowOptions) are returned directly from
// this function call.
//
// The errors it can return:
// - WorkflowUpdateServiceTimeoutOrCanceledError
UpdateWorkflow(ctx context.Context, options UpdateWorkflowOptions) (WorkflowUpdateHandle, error)
// UpdateWorkflowExecutionOptions partially overrides the [WorkflowExecutionOptions] of an existing workflow execution
// and returns the new [WorkflowExecutionOptions] after applying the changes.
// It is intended for building tools that can selectively apply ad-hoc workflow configuration changes.
// Use [DescribeWorkflowExecution] to get similar information without modifying options.
//
// NOTE: Experimental
UpdateWorkflowExecutionOptions(ctx context.Context, options UpdateWorkflowExecutionOptionsRequest) (WorkflowExecutionOptions, error)
// UpdateWithStartWorkflow issues an update-with-start request. A
// WorkflowIDConflictPolicy must be set in the options. If the specified
// workflow execution is not running, then a new workflow execution is
// started and the update is sent in the first workflow task.
// Alternatively if the specified workflow execution is running then, if
// the WorkflowIDConflictPolicy is USE_EXISTING, the update is issued
// against the specified workflow, and if the WorkflowIDConflictPolicy
// is FAIL, an error is returned. The call will block until the update
// has reached the WaitForStage in the options. Note that this means
// that the call will not return successfully until the update has been
// delivered to a worker.
UpdateWithStartWorkflow(ctx context.Context, options UpdateWithStartWorkflowOptions) (WorkflowUpdateHandle, error)
// GetWorkflowUpdateHandle creates a handle to the referenced update
// which can be polled for an outcome. Note that runID is optional and
// if not specified the most recent runID will be used.
GetWorkflowUpdateHandle(ref GetWorkflowUpdateHandleOptions) WorkflowUpdateHandle
// ExecuteActivity starts a standalone activity execution and returns an ActivityHandle.
// The user can use this to start using a function or activity type name.
// Either by
// ExecuteActivity(ctx, options, "activityTypeName", arg1, arg2, arg3)
// or
// ExecuteActivity(ctx, options, activityFn, arg1, arg2, arg3)
//
// Returns an ActivityExecutionAlreadyStarted error if an activity with the same ID already exists
// in this namespace, unless permitted by the specified ID conflict policy.
//
// NOTE: Standalone activities are not associated with a workflow execution.
// They are scheduled directly on a task queue and executed by a worker.
//
// NOTE: Experimental
ExecuteActivity(ctx context.Context, options StartActivityOptions, activity any, args ...any) (ActivityHandle, error)
// GetActivityHandle creates a handle to the referenced activity.
//
// NOTE: Experimental
GetActivityHandle(options GetActivityHandleOptions) ActivityHandle
// ListActivities lists activity executions based on query.
//
// Currently, all errors are returned in the iterator and not the base level error.
//
// NOTE: Experimental
ListActivities(ctx context.Context, options ListActivitiesOptions) (ListActivitiesResult, error)
// CountActivities counts activity executions based on query. The result
// includes the total count and optionally grouped counts if the query includes
// a GROUP BY clause.
//
// NOTE: Experimental
CountActivities(ctx context.Context, options CountActivitiesOptions) (*CountActivitiesResult, error)
// WorkflowService provides access to the underlying gRPC service. This should only be used for advanced use cases
// that cannot be accomplished via other Client methods. Unlike calls to other Client methods, calls directly to the
// service are not configured with internal semantics such as automatic retries.
WorkflowService() workflowservice.WorkflowServiceClient
// OperatorService creates a new operator service client with the same gRPC connection as this client.
OperatorService() operatorservice.OperatorServiceClient
// Schedule creates a new shedule client with the same gRPC connection as this client.
ScheduleClient() ScheduleClient
// DeploymentClient create a new deployment client with the same gRPC connection as this client.
//
// Deprecated: use [WorkerDeploymentClient]
DeploymentClient() DeploymentClient
// WorkerDeploymentClient create a new worker deployment client with the same gRPC connections as this client.
//
// NOTE: Experimental
WorkerDeploymentClient() WorkerDeploymentClient
// Close client and clean up underlying resources.
//
// If this client was created via NewClientFromExisting or this client has
// been used in that call, Close() on may not necessarily close the
// underlying connection. Only the final close of all existing clients will
// close the underlying connection.
Close()
}
Client is the client for starting and getting information about a workflow executions as well as completing activities asynchronously.
func Dial ¶ added in v1.15.0
Dial creates an instance of a workflow client. This will attempt to connect to the server eagerly and will return an error if the server is not available.
func DialContext ¶ added in v1.26.1
DialContext creates an instance of a workflow client. This will attempt to connect to the server eagerly and will return an error if the server is not available. Connection will respect provided context deadlines and cancellations.
func NewClientFromExisting ¶ added in v1.17.0
NewClientFromExisting creates a new client using the same connection as the existing client. This means all options.ConnectionOptions are ignored and options.HostPort is ignored. The existing client must have been created from this package and cannot be wrapped. Currently, this always attempts an eager connection even if the existing client was created with NewLazyClient and has not made any calls yet.
Close() on the resulting client may not necessarily close the underlying connection if there are any other clients using the connection. All clients associated with the existing client must call Close() and only the last one actually performs the connection close.
func NewClientFromExistingWithContext ¶ added in v1.26.1
func NewClientFromExistingWithContext(ctx context.Context, existingClient Client, options Options) (Client, error)
NewClientFromExistingWithContext creates a new client using the same connection as the existing client. This means all options.ConnectionOptions are ignored and options.HostPort is ignored. The existing client must have been created from this package and cannot be wrapped. Currently, this always attempts an eager connection even if the existing client was created with NewLazyClient and has not made any calls yet.
Close() on the resulting client may not necessarily close the underlying connection if there are any other clients using the connection. All clients associated with the existing client must call Close() and only the last one actually performs the connection close.
func NewLazyClient ¶ added in v1.15.0
NewLazyClient creates an instance of a workflow client. Unlike Dial, this will not eagerly connect to the server.
type CompleteActivityByActivityIDOptions ¶ added in v1.42.0
type CompleteActivityByActivityIDOptions = internal.CompleteActivityByActivityIDOptions
CompleteActivityByActivityIDOptions provides options for CompleteActivityByActivityIDWithOptions.
type CompleteActivityByIDOptions ¶ added in v1.42.0
type CompleteActivityByIDOptions = internal.CompleteActivityByIDOptions
CompleteActivityByIDOptions provides options for CompleteActivityByIDWithOptions.
type CompleteActivityOptions ¶ added in v1.42.0
type CompleteActivityOptions = internal.CompleteActivityOptions
CompleteActivityOptions provides options for CompleteActivityWithOptions.
type ConnectionOptions ¶
type ConnectionOptions = internal.ConnectionOptions
ConnectionOptions are optional parameters that can be specified in ClientOptions
type CountActivitiesAggregationGroup ¶ added in v1.40.0
type CountActivitiesAggregationGroup = internal.ClientCountActivitiesAggregationGroup
CountActivitiesAggregationGroup contains groups of activities if CountActivityExecutions is grouped by a field. The list might not be complete, and the counts of each group is approximate.
NOTE: Experimental
type CountActivitiesOptions ¶ added in v1.40.0
type CountActivitiesOptions = internal.ClientCountActivitiesOptions
CountActivitiesOptions contains input for CountActivities call.
NOTE: Experimental
type CountActivitiesResult ¶ added in v1.40.0
type CountActivitiesResult = internal.ClientCountActivitiesResult
CountActivitiesResult contains the result of the CountActivities call.
NOTE: Experimental
type Credentials ¶ added in v1.26.0
type Credentials = internal.Credentials
Credentials are optional credentials that can be specified in ClientOptions.
func NewAPIKeyDynamicCredentials ¶ added in v1.26.0
func NewAPIKeyDynamicCredentials(apiKeyCallback func(context.Context) (string, error)) Credentials
NewAPIKeyDynamicCredentials creates credentials powered by a callback that is invoked on each request. The callback accepts the context that is given by the calling user and can return a key or an error. When error is non-nil, the client call is failed with that error. When string is non-empty, it is used as the API key. When string is empty, nothing is set/overridden.
This is the equivalent of providing a headers provider that returns the "Authorization" header with "Bearer " + the given function result. If the resulting string is non-empty, it will overwrite any "Authorization" header that may be on the context or from existing header provider.
Note, TLS is auto-enabled when API key is provided and TLS is not explicitly set/disabled.
func NewAPIKeyStaticCredentials ¶ added in v1.26.0
func NewAPIKeyStaticCredentials(apiKey string) Credentials
NewAPIKeyStaticCredentials creates credentials that can be provided to ClientOptions to use a fixed API key.
This is the equivalent of providing a headers provider that sets the "Authorization" header with "Bearer " + the given key. This will overwrite any "Authorization" header that may be on the context or from existing header provider.
Note, this uses a fixed header value for authentication. Many users that want to rotate this value without reconnecting should use NewAPIKeyDynamicCredentials.
Note, TLS is auto-enabled when API key is provided and TLS is not explicitly set/disabled.
func NewMTLSCredentials ¶ added in v1.26.0
func NewMTLSCredentials(certificate tls.Certificate) Credentials
NewMTLSCredentials creates credentials that use TLS with the client certificate as the given one. If the client options do not already enable TLS, this enables it. If the client options' TLS configuration is present and already has a client certificate, client creation will fail when applying these credentials.
type Deployment
deprecated
added in
v1.32.0
type Deployment = internal.Deployment
Deployment identifies a set of workers. This identifier combines the deployment series name with their Build ID.
Deprecated: Use the new Worker Deployment API
type DeploymentClient
deprecated
added in
v1.32.0
type DeploymentClient = internal.DeploymentClient
DeploymentClient is the server interface to manage deployments.
Deprecated: Use WorkerDeploymentClient
type DeploymentDescribeOptions
deprecated
added in
v1.32.0
type DeploymentDescribeOptions = internal.DeploymentDescribeOptions
DeploymentDescribeOptions provides options for [DeploymentClient.Describe].
Deprecated: Use WorkerDeploymentDescribeOptions
type DeploymentDescription
deprecated
added in
v1.32.0
type DeploymentDescription = internal.DeploymentDescription
DeploymentDescription is the response type for [DeploymentClient.Describe].
Deprecated: Use WorkerDeploymentDescribeResponse
type DeploymentGetCurrentOptions
deprecated
added in
v1.32.0
type DeploymentGetCurrentOptions = internal.DeploymentGetCurrentOptions
DeploymentGetCurrentOptions provides options for [DeploymentClient.GetCurrent].
Deprecated: Use WorkerDeploymentDescribeOptions
type DeploymentGetCurrentResponse
deprecated
added in
v1.32.0
type DeploymentGetCurrentResponse = internal.DeploymentGetCurrentResponse
DeploymentGetCurrentResponse is the response type for [DeploymentClient.GetCurrent].
Deprecated: Use WorkerDeploymentDescribeResponse
type DeploymentGetReachabilityOptions
deprecated
added in
v1.32.0
type DeploymentGetReachabilityOptions = internal.DeploymentGetReachabilityOptions
DeploymentGetReachabilityOptions provides options for [DeploymentClient.GetReachability].
Deprecated: Use WorkerDeploymentDescribeResponse
type DeploymentInfo
deprecated
added in
v1.32.0
type DeploymentInfo = internal.DeploymentInfo
DeploymentInfo holds information associated with workers in this deployment. Workers can poll multiple task queues in a single deployment, which are listed in this message.
Deprecated: Use WorkerDeploymentInfo
type DeploymentListEntry
deprecated
added in
v1.32.0
type DeploymentListEntry = internal.DeploymentListEntry
DeploymentListEntry is a subset of fields from DeploymentInfo.
Deprecated: Use WorkerDeploymentListEntry
type DeploymentListIterator
deprecated
added in
v1.32.0
type DeploymentListIterator = internal.DeploymentListIterator
DeploymentListIterator is an iterator for deployments.
Deprecated: Use WorkerDeploymentListIterator
type DeploymentListOptions
deprecated
added in
v1.32.0
type DeploymentListOptions = internal.DeploymentListOptions
DeploymentListOptions are the parameters for configuring listing deployments.
Deprecated: Use WorkerDeploymentListOptions
type DeploymentMetadataUpdate
deprecated
added in
v1.32.0
type DeploymentMetadataUpdate = internal.DeploymentMetadataUpdate
DeploymentMetadataUpdate modifies user-defined metadata entries that describe a deployment.
Deprecated: Use WorkerDeploymentMetadataUpdate
type DeploymentReachability
deprecated
added in
v1.32.0
type DeploymentReachability = internal.DeploymentReachability
DeploymentReachability specifies which category of tasks may reach a worker associated with a deployment, simplifying safe decommission.
Deprecated: Use WorkerDeploymentVersionDrainageStatus
type DeploymentReachabilityInfo
deprecated
added in
v1.32.0
type DeploymentReachabilityInfo = internal.DeploymentReachabilityInfo
DeploymentReachabilityInfo extends DeploymentInfo with reachability information.
Deprecated: Use WorkerDeploymentVersionDrainageInfo
type DeploymentSetCurrentOptions
deprecated
added in
v1.32.0
type DeploymentSetCurrentOptions = internal.DeploymentSetCurrentOptions
DeploymentSetCurrentOptions provides options for [DeploymentClient.SetCurrent].
Deprecated: Use WorkerDeploymentSetCurrentVersionOptions
type DeploymentSetCurrentResponse
deprecated
added in
v1.32.0
type DeploymentSetCurrentResponse = internal.DeploymentSetCurrentResponse
DeploymentSetCurrentResponse is the response type for [DeploymentClient.SetCurrent].
Deprecated: Use WorkerDeploymentSetCurrentVersionResponse
type DeploymentTaskQueueInfo
deprecated
added in
v1.32.0
type DeploymentTaskQueueInfo = internal.DeploymentTaskQueueInfo
DeploymentTaskQueueInfo describes properties of the Task Queues involved in a deployment.
Deprecated: Use WorkerDeploymentTaskQueueInfo
type DescribeActivityOptions ¶ added in v1.40.0
type DescribeActivityOptions = internal.ClientDescribeActivityOptions
DescribeActivityOptions contains options for ClientActivityHandle.Describe call. For future compatibility, currently unused.
NOTE: Experimental
type DescribeTaskQueueEnhancedOptions ¶ added in v1.27.0
type DescribeTaskQueueEnhancedOptions = internal.DescribeTaskQueueEnhancedOptions
DescribeTaskQueueEnhancedOptions is the input to client.Client.DescribeTaskQueueEnhanced.
type GetActivityHandleOptions ¶ added in v1.40.0
type GetActivityHandleOptions = internal.ClientGetActivityHandleOptions
GetActivityHandleOptions contains input for GetActivityHandle call. ActivityID and RunID are required.
NOTE: Experimental
type GetWorkerBuildIdCompatibilityOptions
deprecated
added in
v1.22.0
type GetWorkerBuildIdCompatibilityOptions = internal.GetWorkerBuildIdCompatibilityOptions
GetWorkerBuildIdCompatibilityOptions is the input to Client.GetWorkerBuildIdCompatibility.
Deprecated: Use GetWorkerVersioningOptions with the new worker versioning api.
type GetWorkerTaskReachabilityOptions
deprecated
added in
v1.25.0
type GetWorkerTaskReachabilityOptions = internal.GetWorkerTaskReachabilityOptions
GetWorkerTaskReachabilityOptions is the input to Client.GetWorkerTaskReachability.
Deprecated: Use DescribeTaskQueueEnhancedOptions with the new worker versioning api.
type GetWorkerVersioningOptions
deprecated
added in
v1.27.0
type GetWorkerVersioningOptions = internal.GetWorkerVersioningOptions //lint:ignore SA1019 transitioning to Worker Deployments
GetWorkerVersioningOptions is the input to client.Client.GetWorkerVersioningRules.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type GetWorkflowUpdateHandleOptions ¶ added in v1.22.2
type GetWorkflowUpdateHandleOptions = internal.GetWorkflowUpdateHandleOptions
GetWorkflowUpdateHandleOptions encapsulates the parameters needed to unambiguously refer to a Workflow Update
type HistoryEventIterator ¶
type HistoryEventIterator = internal.HistoryEventIterator
HistoryEventIterator is a iterator which can return history events.
type HistoryJSONOptions ¶ added in v1.16.0
type HistoryJSONOptions struct {
// LastEventID, if set, will only load history up to this ID (inclusive).
LastEventID int64
}
HistoryJSONOptions are options for HistoryFromJSON.
type ListActivitiesOptions ¶ added in v1.40.0
type ListActivitiesOptions = internal.ClientListActivitiesOptions
ListActivitiesOptions contains input for ListActivities call.
NOTE: Experimental
type ListActivitiesResult ¶ added in v1.40.0
type ListActivitiesResult = internal.ClientListActivitiesResult
ListActivitiesResult contains the result of the ListActivities call.
NOTE: Experimental
type MetricsCounter ¶ added in v1.12.0
MetricsCounter is an ever-increasing counter.
type MetricsGauge ¶ added in v1.12.0
MetricsGauge can be set to any float.
type MetricsHandler ¶ added in v1.12.0
MetricsHandler is a handler for metrics emitted by the SDK. This interface is intentionally limited to only what the SDK needs to emit metrics and is not built to be a general purpose metrics abstraction for all uses.
A common implementation is at go.temporal.io/sdk/contrib/tally.NewMetricsHandler. The MetricsNopHandler is a noop handler. A handler may implement "Unwrap() client.MetricsHandler" if it wraps a handler.
type MetricsTimer ¶ added in v1.12.0
MetricsTimer records time durations.
type NamespaceClient ¶
type NamespaceClient interface {
// Register a namespace with temporal server
// The errors it can throw:
// - NamespaceAlreadyExistsError
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
Register(ctx context.Context, request *workflowservice.RegisterNamespaceRequest) error
// Describe a namespace. The namespace has 3 part of information
// NamespaceInfo - Which has Name, Status, Description, Owner Email
// NamespaceConfiguration - Configuration like Workflow Execution Retention Period In Days, Whether to emit metrics.
// ReplicationConfiguration - replication config like clusters and active cluster name
// The errors it can throw:
// - serviceerror.NamespaceNotFound
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
Describe(ctx context.Context, name string) (*workflowservice.DescribeNamespaceResponse, error)
// Update a namespace.
// The errors it can throw:
// - serviceerror.NamespaceNotFound
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
Update(ctx context.Context, request *workflowservice.UpdateNamespaceRequest) error
// Close client and clean up underlying resources.
Close()
}
NamespaceClient is the client for managing operations on the namespace. CLI, tools, ... can use this layer to manager operations on namespace.
func NewNamespaceClient ¶
func NewNamespaceClient(options Options) (NamespaceClient, error)
NewNamespaceClient creates an instance of a namespace client, to manage lifecycle of namespaces. This will not attempt to connect to the server eagerly and therefore may not fail for an unreachable server until a call is made.
type Options ¶
type Options = internal.ClientOptions
Options are optional parameters for Client creation.
type PinnedVersioningOverride ¶ added in v1.35.0
type PinnedVersioningOverride = internal.PinnedVersioningOverride
PinnedVersioningOverride means the workflow will be pinned to a specific deployment version.
NOTE: Experimental
type Plugin ¶ added in v1.39.0
type Plugin = internal.ClientPlugin
Plugin is a plugin that can configure client options and surround client creation/connection. Many plugin implementers may prefer the simpler go.temporal.io/sdk/temporal.SimplePlugin instead.
All client plugins must embed go.temporal.io/sdk/client.PluginBase. All plugins must implement Name().
All client plugins that also implement go.temporal.io/sdk/worker.Plugin are automatically configured on workers made from the client.
NOTE: Experimental
type PluginBase ¶ added in v1.39.0
type PluginBase = internal.ClientPluginBase
PluginBase must be embedded into client plugin implementations.
NOTE: Experimental
type PluginConfigureClientOptions ¶ added in v1.39.0
type PluginConfigureClientOptions = internal.ClientPluginConfigureClientOptions
PluginConfigureClientOptions are options for ConfigureClient on a client plugin.
NOTE: Experimental
type PluginNewClientOptions ¶ added in v1.39.0
type PluginNewClientOptions = internal.ClientPluginNewClientOptions
PluginNewClientOptions are options for NewClient on a client plugin.
NOTE: Experimental
type QueryWorkflowWithOptionsRequest ¶
type QueryWorkflowWithOptionsRequest = internal.QueryWorkflowWithOptionsRequest
QueryWorkflowWithOptionsRequest defines the request to QueryWorkflowWithOptions.
type QueryWorkflowWithOptionsResponse ¶
type QueryWorkflowWithOptionsResponse = internal.QueryWorkflowWithOptionsResponse
QueryWorkflowWithOptionsResponse defines the response to QueryWorkflowWithOptions.
type RecordActivityHeartbeatByIDOptions ¶ added in v1.42.0
type RecordActivityHeartbeatByIDOptions = internal.RecordActivityHeartbeatByIDOptions
RecordActivityHeartbeatByIDOptions provides options for RecordActivityHeartbeatByIDWithOptions.
type RecordActivityHeartbeatOptions ¶ added in v1.42.0
type RecordActivityHeartbeatOptions = internal.RecordActivityHeartbeatOptions
RecordActivityHeartbeatOptions provides options for RecordActivityHeartbeatWithOptions.
type ScheduleAction ¶ added in v1.18.0
type ScheduleAction = internal.ScheduleAction
ScheduleAction is the interface for all actions a schedule can take.
type ScheduleActionResult ¶ added in v1.18.0
type ScheduleActionResult = internal.ScheduleActionResult
ScheduleActionResult describes when a schedule action took place.
type ScheduleBackfill ¶ added in v1.18.0
type ScheduleBackfill = internal.ScheduleBackfill
ScheduleBackfill desribes a time periods and policy and takes Actions as if that time passed by right now, all at once.
type ScheduleBackfillOptions ¶ added in v1.18.0
type ScheduleBackfillOptions = internal.ScheduleBackfillOptions
ScheduleBackfillOptions configure the parameters for backfilling a schedule.
type ScheduleCalendarSpec ¶ added in v1.18.0
type ScheduleCalendarSpec = internal.ScheduleCalendarSpec
ScheduleCalendarSpec is an event specification relative to the calendar.
type ScheduleClient ¶ added in v1.18.0
type ScheduleClient = internal.ScheduleClient
ScheduleClient is the interface with the server to create and get handles to schedules.
type ScheduleDescription ¶ added in v1.18.0
type ScheduleDescription = internal.ScheduleDescription
ScheduleDescription describes the current Schedule details from ScheduleHandle.Describe.
type ScheduleHandle ¶ added in v1.18.0
type ScheduleHandle = internal.ScheduleHandle
ScheduleHandle represents a created schedule.
type ScheduleInfo ¶ added in v1.30.0
type ScheduleInfo = internal.ScheduleInfo
ScheduleInfo describes other information about a schedule.
type ScheduleIntervalSpec ¶ added in v1.18.0
type ScheduleIntervalSpec = internal.ScheduleIntervalSpec
ScheduleIntervalSpec describes periods a schedules action should occur.
type ScheduleListEntry ¶ added in v1.18.0
type ScheduleListEntry = internal.ScheduleListEntry
ScheduleListEntry is a result from ScheduleListEntry.
type ScheduleListIterator ¶ added in v1.18.0
type ScheduleListIterator = internal.ScheduleListIterator
ScheduleListIterator is a iterator which can return created schedules.
type ScheduleListOptions ¶ added in v1.18.0
type ScheduleListOptions = internal.ScheduleListOptions
ScheduleListOptions are configuration parameters for listing schedules.
type ScheduleOptions ¶ added in v1.18.0
type ScheduleOptions = internal.ScheduleOptions
ScheduleOptions configuration parameters for creating a schedule.
type SchedulePauseOptions ¶ added in v1.18.0
type SchedulePauseOptions = internal.SchedulePauseOptions
SchedulePauseOptions configure the parameters for pausing a schedule.
type SchedulePolicies ¶ added in v1.24.0
type SchedulePolicies = internal.SchedulePolicies
SchedulePolicies describes the current polcies of a schedule.
type ScheduleRange ¶ added in v1.18.0
type ScheduleRange = internal.ScheduleRange
ScheduleRange represents a set of integer values.
type ScheduleSpec ¶ added in v1.18.0
type ScheduleSpec = internal.ScheduleSpec
ScheduleSpec describes when a schedules action should occur.
type ScheduleState ¶ added in v1.24.0
type ScheduleState = internal.ScheduleState
ScheduleState describes the current state of a schedule.
type ScheduleTriggerOptions ¶ added in v1.18.0
type ScheduleTriggerOptions = internal.ScheduleTriggerOptions
ScheduleTriggerOptions configure the parameters for triggering a schedule.
type ScheduleUnpauseOptions ¶ added in v1.18.0
type ScheduleUnpauseOptions = internal.ScheduleUnpauseOptions
ScheduleUnpauseOptions configure the parameters for unpausing a schedule.
type ScheduleUpdate ¶ added in v1.18.0
type ScheduleUpdate = internal.ScheduleUpdate
ScheduleUpdate describes the desired new schedule from ScheduleHandle.Update.
type ScheduleUpdateInput ¶ added in v1.18.0
type ScheduleUpdateInput = internal.ScheduleUpdateInput
ScheduleUpdateInput describes the current state of the schedule to be updated.
type ScheduleUpdateOptions ¶ added in v1.18.0
type ScheduleUpdateOptions = internal.ScheduleUpdateOptions
ScheduleUpdateOptions are configuration parameters for updating a schedule.
type ScheduleWorkflowAction ¶ added in v1.18.0
type ScheduleWorkflowAction = internal.ScheduleWorkflowAction
ScheduleWorkflowAction is the implementation of ScheduleAction to start a workflow.
type ScheduleWorkflowExecution ¶ added in v1.18.0
type ScheduleWorkflowExecution = internal.ScheduleWorkflowExecution
ScheduleWorkflowExecution contains details on a workflows execution stared by a schedule.
type StartActivityOptions ¶ added in v1.40.0
type StartActivityOptions = internal.ClientStartActivityOptions
StartActivityOptions contains configuration parameters for starting an activity execution from the client. ID and TaskQueue are required. At least one of ScheduleToCloseTimeout or StartToCloseTimeout is required. Other parameters are optional.
NOTE: Experimental
type StartWorkflowOptions ¶
type StartWorkflowOptions = internal.StartWorkflowOptions
StartWorkflowOptions configuration parameters for starting a workflow execution.
type TaskQueueDescription ¶ added in v1.27.0
type TaskQueueDescription = internal.TaskQueueDescription
TaskQueueDescription is the response to client.Client.DescribeTaskQueueEnhanced.
type TaskQueuePollerInfo ¶ added in v1.27.0
type TaskQueuePollerInfo = internal.TaskQueuePollerInfo
TaskQueuePollerInfo provides information about a worker/client polling a task queue. It is used by TaskQueueTypeInfo.
type TaskQueueReachability
deprecated
added in
v1.25.0
type TaskQueueReachability = internal.TaskQueueReachability
TaskQueueReachability Describes how the Build ID may be reachable from the task queue.
Deprecated: Replaced by the new worker versioning api.
type TaskQueueStats ¶ added in v1.29.0
type TaskQueueStats = internal.TaskQueueStats
TaskQueueStats contains statistics about task queue backlog and activity.
For workflow task queue type, this result is partial because tasks sent to sticky queues are not included. Read comments above each metric to understand the impact of sticky queue exclusion on that metric accuracy.
type TaskQueueType ¶ added in v1.27.0
type TaskQueueType = internal.TaskQueueType
TaskQueueType specifies which category of tasks are associated with a queue. WARNING: Worker versioning is currently experimental
type TaskQueueTypeInfo ¶ added in v1.27.0
type TaskQueueTypeInfo = internal.TaskQueueTypeInfo
TaskQueueTypeInfo specifies task queue information per task type and Build ID. It is included in TaskQueueVersionInfo.
type TaskQueueVersionInfo
deprecated
added in
v1.27.0
type TaskQueueVersionInfo = internal.TaskQueueVersionInfo
TaskQueueVersionInfo includes task queue information per Build ID. It is part of TaskQueueDescription.
Deprecated: Use TaskQueueVersioningInfo
type TaskQueueVersionSelection ¶ added in v1.27.0
type TaskQueueVersionSelection = internal.TaskQueueVersionSelection
TaskQueueVersionSelection is a task queue filter based on versioning. It is an optional component of DescribeTaskQueueEnhancedOptions. WARNING: Worker versioning is currently experimental.
type TaskQueueVersioningInfo ¶ added in v1.33.0
type TaskQueueVersioningInfo = internal.TaskQueueVersioningInfo
TaskQueueVersioningInfo provides worker deployment configuration for this task queue. It is part of [Client.TaskQueueDescription].
NOTE: Experimental
type TaskReachability
deprecated
added in
v1.25.0
type TaskReachability = internal.TaskReachability
TaskReachability specifies which category of tasks may reach a worker on a versioned task queue. Used both in a reachability query and its response.
Deprecated: Use BuildIDTaskReachability
type TerminateActivityOptions ¶ added in v1.40.0
type TerminateActivityOptions = internal.ClientTerminateActivityOptions
TerminateActivityOptions contains options for ClientActivityHandle.Terminate call.
NOTE: Experimental
type UpdateWithStartWorkflowOptions ¶ added in v1.31.0
type UpdateWithStartWorkflowOptions = internal.UpdateWithStartWorkflowOptions
UpdateWithStartWorkflowOptions encapsulates the parameters used by UpdateWithStartWorkflow. See client.Client.UpdateWithStartWorkflow and client.Client.NewWithStartWorkflowOperation.
type UpdateWorkerBuildIdCompatibilityOptions
deprecated
added in
v1.22.0
type UpdateWorkerBuildIdCompatibilityOptions = internal.UpdateWorkerBuildIdCompatibilityOptions
UpdateWorkerBuildIdCompatibilityOptions is the input to Client.UpdateWorkerBuildIdCompatibility.
Deprecated: Use UpdateWorkerVersioningRulesOptions with the new worker versioning api.
type UpdateWorkerVersioningRulesOptions
deprecated
added in
v1.27.0
type UpdateWorkerVersioningRulesOptions = internal.UpdateWorkerVersioningRulesOptions //lint:ignore SA1019 transitioning to Worker Deployments
UpdateWorkerVersioningRulesOptions is the input to client.Client.UpdateWorkerVersioningRules.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type UpdateWorkflowExecutionOptionsRequest ¶ added in v1.32.0
type UpdateWorkflowExecutionOptionsRequest = internal.UpdateWorkflowExecutionOptionsRequest
UpdateWorkflowExecutionOptionsRequest is a request for client.Client.UpdateWorkflowExecutionOptions.
NOTE: Experimental
type UpdateWorkflowOptions ¶ added in v1.27.0
type UpdateWorkflowOptions = internal.UpdateWorkflowOptions
UpdateWorkflowOptions encapsulates the parameters for sending an update to a workflow execution.
type VersioningAssignmentRule
deprecated
added in
v1.27.0
type VersioningAssignmentRule = internal.VersioningAssignmentRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningAssignmentRule is a BuildID assigment rule for a task queue. Assignment rules only affect new workflows.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningAssignmentRuleWithTimestamp
deprecated
added in
v1.27.0
type VersioningAssignmentRuleWithTimestamp = internal.VersioningAssignmentRuleWithTimestamp //lint:ignore SA1019 transitioning to Worker Deployments
VersioningAssignmentRuleWithTimestamp contains an assignment rule annotated by the server with its creation time.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningConflictToken
deprecated
added in
v1.27.0
type VersioningConflictToken = internal.VersioningConflictToken //lint:ignore SA1019 transitioning to Worker Deployments
VersioningConflictToken is a conflict token to serialize calls to client.Client.UpdateWorkerVersioningRules. An update with an old token fails with `serviceerror.FailedPrecondition`. The current token can be obtained with client.Client.GetWorkerVersioningRules, or returned by a successful client.Client.UpdateWorkerVersioningRules.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationAddRedirectRule
deprecated
added in
v1.27.0
type VersioningOperationAddRedirectRule = internal.VersioningOperationAddRedirectRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationAddRedirectRule is an operation for UpdateWorkerVersioningRulesOptions that adds the rule to the list of redirect rules for this Task Queue. There can be at most one redirect rule for each distinct Source BuildID.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationCommitBuildID
deprecated
added in
v1.27.0
type VersioningOperationCommitBuildID = internal.VersioningOperationCommitBuildID //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationCommitBuildID is an operation for UpdateWorkerVersioningRulesOptions that completes the rollout of a BuildID and cleanup unnecessary rules possibly created during a gradual rollout. Specifically, this command will make the following changes atomically:
- Adds an assignment rule (with full ramp) for the target Build ID at the end of the list.
- Removes all previously added assignment rules to the given target Build ID (if any).
- Removes any fully-ramped assignment rule for other Build IDs.
To prevent committing invalid Build IDs, we reject the request if no pollers have been seen recently for this Build ID. Use the `force` option to disable this validation.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationDeleteAssignmentRule
deprecated
added in
v1.27.0
type VersioningOperationDeleteAssignmentRule = internal.VersioningOperationDeleteAssignmentRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationDeleteAssignmentRule is an operation for UpdateWorkerVersioningRulesOptions that deletes the assignment rule at a given index. By default presence of one unconditional rule, i.e., no hint filter or ramp, is enforced, otherwise the delete operation will be rejected. Set `force` to true to bypass this validation.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationDeleteRedirectRule
deprecated
added in
v1.27.0
type VersioningOperationDeleteRedirectRule = internal.VersioningOperationDeleteRedirectRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationDeleteRedirectRule is an operation for UpdateWorkerVersioningRulesOptions that deletes the routing rule with the given source Build ID.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationInsertAssignmentRule
deprecated
added in
v1.27.0
type VersioningOperationInsertAssignmentRule = internal.VersioningOperationInsertAssignmentRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationInsertAssignmentRule is an operation for UpdateWorkerVersioningRulesOptions that inserts the rule to the list of assignment rules for this Task Queue. The rules are evaluated in order, starting from index 0. The first applicable rule will be applied and the rest will be ignored. By default, the new rule is inserted at the beginning of the list (index 0). If the given index is too larger the rule will be inserted at the end of the list.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationReplaceAssignmentRule
deprecated
added in
v1.27.0
type VersioningOperationReplaceAssignmentRule = internal.VersioningOperationReplaceAssignmentRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationReplaceAssignmentRule is an operation for UpdateWorkerVersioningRulesOptions that replaces the assignment rule at a given index. By default presence of one unconditional rule, i.e., no hint filter or ramp, is enforced, otherwise the delete operation will be rejected. Set `force` to true to bypass this validation.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOperationReplaceRedirectRule
deprecated
added in
v1.27.0
type VersioningOperationReplaceRedirectRule = internal.VersioningOperationReplaceRedirectRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningOperationReplaceRedirectRule is an operation for UpdateWorkerVersioningRulesOptions that replaces the routing rule with the given source BuildID.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningOverride ¶ added in v1.32.0
type VersioningOverride = internal.VersioningOverride
VersioningOverride is a property in WorkflowExecutionOptions that changes the versioning configuration of a specific workflow execution.
If set, it takes precedence over the Versioning Behavior provided with workflow type registration, or default worker options.
NOTE: Experimental
type VersioningOverrideChange ¶ added in v1.35.0
type VersioningOverrideChange = internal.VersioningOverrideChange
VersioningOverrideChange sets or removes a versioning override when used with WorkflowExecutionOptionsChanges.
NOTE: Experimental
type VersioningRampByPercentage
deprecated
added in
v1.27.0
type VersioningRampByPercentage = internal.VersioningRampByPercentage //lint:ignore SA1019 transitioning to Worker Deployments
VersioningRampByPercentage is a VersionRamp that sends a proportion of the traffic to the target Build ID.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningRedirectRule
deprecated
added in
v1.27.0
type VersioningRedirectRule = internal.VersioningRedirectRule //lint:ignore SA1019 transitioning to Worker Deployments
VersioningRedirectRule is a BuildID redirect rule for a task queue. It changes the behavior of currently running workflows and new ones.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type VersioningRedirectRuleWithTimestamp
deprecated
added in
v1.27.0
type VersioningRedirectRuleWithTimestamp = internal.VersioningRedirectRuleWithTimestamp //lint:ignore SA1019 transitioning to Worker Deployments
VersioningRedirectRuleWithTimestamp contains a redirect rule annotated by the server with its creation time.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type WithStartWorkflowOperation ¶ added in v1.29.0
type WithStartWorkflowOperation = internal.WithStartWorkflowOperation
WithStartWorkflowOperation defines how to start a workflow when using UpdateWithStartWorkflow. See client.Client.NewWithStartWorkflowOperation and client.Client.UpdateWithStartWorkflow.
type WorkerBuildIDVersionSets
deprecated
added in
v1.22.0
type WorkerBuildIDVersionSets = internal.WorkerBuildIDVersionSets
WorkerBuildIDVersionSets is the response for Client.GetWorkerBuildIdCompatibility.
Deprecated: Replaced by the new worker versioning api.
type WorkerDeploymentClient ¶ added in v1.33.0
type WorkerDeploymentClient = internal.WorkerDeploymentClient
WorkerDeploymentClient is the client that manages Worker Deployments.
NOTE: Experimental
type WorkerDeploymentDeleteOptions ¶ added in v1.33.0
type WorkerDeploymentDeleteOptions = internal.WorkerDeploymentDeleteOptions
WorkerDeploymentDeleteOptions provides options for [WorkerDeploymentClient.Delete].
NOTE: Experimental
type WorkerDeploymentDeleteResponse ¶ added in v1.33.0
type WorkerDeploymentDeleteResponse = internal.WorkerDeploymentDeleteResponse
WorkerDeploymentDeleteResponse is the response for [WorkerDeploymentClient.Delete].
NOTE: Experimental
type WorkerDeploymentDeleteVersionOptions ¶ added in v1.33.0
type WorkerDeploymentDeleteVersionOptions = internal.WorkerDeploymentDeleteVersionOptions
WorkerDeploymentDeleteVersionOptions provides options for [WorkerDeploymentHandle.DeleteVersion].
NOTE: Experimental
type WorkerDeploymentDeleteVersionResponse ¶ added in v1.33.0
type WorkerDeploymentDeleteVersionResponse = internal.WorkerDeploymentDeleteVersionResponse
WorkerDeploymentDeleteVersionResponse is the response for [WorkerDeploymentHandle.DeleteVersion].
NOTE: Experimental
type WorkerDeploymentDescribeOptions ¶ added in v1.33.0
type WorkerDeploymentDescribeOptions = internal.WorkerDeploymentDescribeOptions
WorkerDeploymentDescribeOptions provides options for [WorkerDeploymentHandle.Describe].
NOTE: Experimental
type WorkerDeploymentDescribeResponse ¶ added in v1.33.0
type WorkerDeploymentDescribeResponse = internal.WorkerDeploymentDescribeResponse
WorkerDeploymentDescribeResponse is the response type for [WorkerDeploymentHandle.Describe].
NOTE: Experimental
type WorkerDeploymentDescribeVersionOptions ¶ added in v1.33.0
type WorkerDeploymentDescribeVersionOptions = internal.WorkerDeploymentDescribeVersionOptions
WorkerDeploymentDescribeVersionOptions provides options for [WorkerDeploymentHandle.DescribeVersion].
NOTE: Experimental
type WorkerDeploymentHandle ¶ added in v1.33.0
type WorkerDeploymentHandle = internal.WorkerDeploymentHandle
WorkerDeploymentHandle is a handle to a Worker Deployment.
NOTE: Experimental
type WorkerDeploymentInfo ¶ added in v1.33.0
type WorkerDeploymentInfo = internal.WorkerDeploymentInfo
WorkerDeploymentInfo provides information about a Worker Deployment.
NOTE: Experimental
type WorkerDeploymentListEntry ¶ added in v1.33.0
type WorkerDeploymentListEntry = internal.WorkerDeploymentListEntry
WorkerDeploymentListEntry is a subset of fields from WorkerDeploymentInfo.
NOTE: Experimental
type WorkerDeploymentListIterator ¶ added in v1.33.0
type WorkerDeploymentListIterator = internal.WorkerDeploymentListIterator
WorkerDeploymentListIterator is an iterator for deployments.
NOTE: Experimental
type WorkerDeploymentListOptions ¶ added in v1.33.0
type WorkerDeploymentListOptions = internal.WorkerDeploymentListOptions
WorkerDeploymentListOptions are the parameters for configuring listing Worker Deployments.
NOTE: Experimental
type WorkerDeploymentMetadataUpdate ¶ added in v1.33.0
type WorkerDeploymentMetadataUpdate = internal.WorkerDeploymentMetadataUpdate
WorkerDeploymentMetadataUpdate modifies user-defined metadata entries that describe a Version.
NOTE: Experimental
type WorkerDeploymentRoutingConfig ¶ added in v1.33.0
type WorkerDeploymentRoutingConfig = internal.WorkerDeploymentRoutingConfig
WorkerDeploymentRoutingConfig describes when new or existing Workflow Tasks are executed with this Worker Deployment.
NOTE: Experimental
type WorkerDeploymentSetCurrentVersionOptions ¶ added in v1.33.0
type WorkerDeploymentSetCurrentVersionOptions = internal.WorkerDeploymentSetCurrentVersionOptions
WorkerDeploymentSetCurrentVersionOptions provides options for [WorkerDeploymentHandle.SetCurrentVersion].
NOTE: Experimental
type WorkerDeploymentSetCurrentVersionResponse ¶ added in v1.33.0
type WorkerDeploymentSetCurrentVersionResponse = internal.WorkerDeploymentSetCurrentVersionResponse
WorkerDeploymentSetCurrentVersionResponse is the response for [WorkerDeploymentHandle.SetCurrentVersion].
NOTE: Experimental
type WorkerDeploymentSetManagerIdentityOptions ¶ added in v1.37.0
type WorkerDeploymentSetManagerIdentityOptions = internal.WorkerDeploymentSetManagerIdentityOptions
WorkerDeploymentSetManagerIdentityOptions provides options for [WorkerDeploymentHandle.SetManagerIdentity].
NOTE: Experimental
type WorkerDeploymentSetManagerIdentityResponse ¶ added in v1.37.0
type WorkerDeploymentSetManagerIdentityResponse = internal.WorkerDeploymentSetManagerIdentityResponse
WorkerDeploymentSetManagerIdentityResponse is the response for [WorkerDeploymentHandle.SetManagerIdentity].
NOTE: Experimental
type WorkerDeploymentSetRampingVersionOptions ¶ added in v1.33.0
type WorkerDeploymentSetRampingVersionOptions = internal.WorkerDeploymentSetRampingVersionOptions
WorkerDeploymentSetRampingVersionOptions provides options for [WorkerDeploymentHandle.SetRampingVersion].
NOTE: Experimental
type WorkerDeploymentSetRampingVersionResponse ¶ added in v1.33.0
type WorkerDeploymentSetRampingVersionResponse = internal.WorkerDeploymentSetRampingVersionResponse
WorkerDeploymentSetRampingVersionResponse is the response for [WorkerDeploymentHandle.SetRampingVersion].
NOTE: Experimental
type WorkerDeploymentTaskQueueInfo ¶ added in v1.33.0
type WorkerDeploymentTaskQueueInfo = internal.WorkerDeploymentTaskQueueInfo
WorkerDeploymentTaskQueueInfo describes properties of the Task Queues involved in a Deployment Version.
NOTE: Experimental
type WorkerDeploymentUpdateVersionMetadataOptions ¶ added in v1.33.0
type WorkerDeploymentUpdateVersionMetadataOptions = internal.WorkerDeploymentUpdateVersionMetadataOptions
WorkerDeploymentUpdateVersionMetadataOptions provides options for [WorkerDeploymentHandle.UpdateVersionMetadata].
NOTE: Experimental
type WorkerDeploymentUpdateVersionMetadataResponse ¶ added in v1.33.0
type WorkerDeploymentUpdateVersionMetadataResponse = internal.WorkerDeploymentUpdateVersionMetadataResponse
WorkerDeploymentUpdateVersionMetadataResponse is the response for [WorkerDeploymentHandle.UpdateVersionMetadata].
NOTE: Experimental
type WorkerDeploymentVersionDescription ¶ added in v1.33.0
type WorkerDeploymentVersionDescription = internal.WorkerDeploymentVersionDescription
WorkerDeploymentVersionDescription is the response for [WorkerDeploymentHandle.DescribeVersion].
NOTE: Experimental
type WorkerDeploymentVersionDrainageInfo ¶ added in v1.33.0
type WorkerDeploymentVersionDrainageInfo = internal.WorkerDeploymentVersionDrainageInfo
WorkerDeploymentVersionDrainageInfo describes drainage properties of a Deployment Version. This enables users to safely decide when they can decommission a Version.
NOTE: Experimental
type WorkerDeploymentVersionDrainageStatus ¶ added in v1.33.0
type WorkerDeploymentVersionDrainageStatus = internal.WorkerDeploymentVersionDrainageStatus
WorkerDeploymentVersionDrainageStatus specifies the drainage status for a Worker Deployment Version enabling users to decide when they can safely decommission this Version.
NOTE: Experimental
type WorkerDeploymentVersionInfo ¶ added in v1.33.0
type WorkerDeploymentVersionInfo = internal.WorkerDeploymentVersionInfo
WorkerDeploymentVersionInfo provides information about a Worker Deployment Version.
NOTE: Experimental
type WorkerDeploymentVersionSummary ¶ added in v1.33.0
type WorkerDeploymentVersionSummary = internal.WorkerDeploymentVersionSummary
WorkerDeploymentVersionSummary provides a brief description of a Version.
NOTE: Experimental
type WorkerTaskReachability
deprecated
added in
v1.25.0
type WorkerTaskReachability = internal.WorkerTaskReachability
WorkerTaskReachability is the response for Client.GetWorkerTaskReachability.
Deprecated: Replaced by the new worker versioning api.
type WorkerVersionCapabilities ¶ added in v1.27.0
type WorkerVersionCapabilities = internal.WorkerVersionCapabilities
WorkerVersionCapabilities includes a worker's build identifier and whether it is choosing to use the versioning feature. It is an optional component of TaskQueuePollerInfo. WARNING: Worker versioning is currently experimental.
type WorkerVersioningMode ¶ added in v1.33.0
type WorkerVersioningMode = internal.WorkerVersioningMode
WorkerVersioningMode specifies whether the workflows processed by this worker use the worker's Version. The Temporal Server will use this worker's choice when dispatching tasks to it.
NOTE: Experimental
type WorkerVersioningRules
deprecated
added in
v1.27.0
type WorkerVersioningRules = internal.WorkerVersioningRules //lint:ignore SA1019 transitioning to Worker Deployments
WorkerVersioningRules is the response for client.Client.GetWorkerVersioningRules.
Deprecated: Build-id based versioning is deprecated in favor of worker deployment based versioning and will be removed soon.
WARNING: Worker versioning is currently experimental.
type WorkflowExecutionDescription ¶ added in v1.35.0
type WorkflowExecutionDescription = internal.WorkflowExecutionDescription
WorkflowExecutionDescription defines the response to DescribeWorkflow.
type WorkflowExecutionMetadata ¶ added in v1.35.0
type WorkflowExecutionMetadata = internal.WorkflowExecutionMetadata
WorkflowExecutionMetadata defines common workflow information across multiple calls.
type WorkflowExecutionOptions ¶ added in v1.32.0
type WorkflowExecutionOptions = internal.WorkflowExecutionOptions
WorkflowExecutionOptions contains a set of properties of an existing workflow that can be overriden using client.Client.UpdateWorkflowExecutionOptions.
NOTE: Experimental
type WorkflowExecutionOptionsChanges ¶ added in v1.32.0
type WorkflowExecutionOptionsChanges = internal.WorkflowExecutionOptionsChanges
WorkflowExecutionOptionsChanges describes changes to WorkflowExecutionOptions in the client.Client.UpdateWorkflowExecutionOptions API.
NOTE: Experimental
type WorkflowRun ¶
type WorkflowRun = internal.WorkflowRun
WorkflowRun represents a started non child workflow.
type WorkflowRunGetOptions ¶ added in v1.15.0
type WorkflowRunGetOptions = internal.WorkflowRunGetOptions
WorkflowRunGetOptions are options for WorkflowRun.GetWithOptions.
type WorkflowServiceProxyOptions ¶ added in v1.14.0
type WorkflowServiceProxyOptions struct {
Client workflowservice.WorkflowServiceClient
// DisableHeaderForwarding disables the forwarding of headers from the incoming request to the outgoing request.
DisableHeaderForwarding bool
}
WorkflowServiceProxyOptions provides options for configuring a WorkflowServiceProxyServer. Client is a WorkflowServiceClient used to forward requests received by the server to the Temporal Frontend.
type WorkflowUpdateHandle ¶ added in v1.20.0
type WorkflowUpdateHandle = internal.WorkflowUpdateHandle
WorkflowUpdateHandle represents a running or completed workflow execution update and gives the holder access to the outcome of the same.
type WorkflowUpdateServiceTimeoutOrCanceledError ¶ added in v1.28.0
type WorkflowUpdateServiceTimeoutOrCanceledError = internal.WorkflowUpdateServiceTimeoutOrCanceledError
WorkflowUpdateServiceTimeoutOrCanceledError is an error that occurs when an update call times out or is cancelled.
Note, this is not related to any general concept of timing out or cancelling a running update, this is only related to the client call itself.
func NewWorkflowUpdateServiceTimeoutOrCanceledError ¶ added in v1.28.0
func NewWorkflowUpdateServiceTimeoutOrCanceledError(err error) *WorkflowUpdateServiceTimeoutOrCanceledError
NewWorkflowUpdateServiceTimeoutOrCanceledError creates a new WorkflowUpdateServiceTimeoutOrCanceledError.
type WorkflowUpdateStage ¶ added in v1.27.0
type WorkflowUpdateStage = internal.WorkflowUpdateStage
WorkflowUpdateStage indicates the stage of an update request.