Documentation
¶
Index ¶
- func CommandName(cmd any) (string, error)
- func InitCommand(name string) (any, error)
- type ActivityInfo
- type Cancel
- type CancelExternalWorkflow
- type CancelWorkflow
- type CompleteWorkflow
- type Context
- type ContinueAsNew
- type DestroyWorkflow
- type ExecuteActivity
- type ExecuteChildWorkflow
- type ExecuteLocalActivity
- type ExecuteLocalActivityOptions
- type GetChildWorkflowExecution
- type GetStackTrace
- type GetVersion
- type GetWorkerInfo
- type InvokeActivity
- type InvokeLocalActivity
- type InvokeQuery
- type InvokeSignal
- type InvokeUpdate
- type Message
- type NewTimer
- type Panic
- type SideEffect
- type SignalExternalWorkflow
- type StartWorkflow
- type TypedSearchAttribute
- type TypedSearchAttributeOperation
- type TypedSearchAttributeType
- type UndefinedResponse
- type UpdateCompleted
- type UpdateValidated
- type UpsertMemo
- type UpsertWorkflowSearchAttributes
- type UpsertWorkflowTypedSearchAttributes
- type WorkerInfo
- type WorkflowInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandName ¶
CommandName returns command name (only for the commands sent to the worker)
func InitCommand ¶
InitCommand reads command from binary payload
Types ¶
type ActivityInfo ¶
type ActivityInfo struct {
// Name describes public activity name.
Name string `json:"name"`
}
ActivityInfo describes single worker activity.
type Cancel ¶
type Cancel struct {
// CommandIDs to be canceled.
CommandIDs []uint64 `json:"ids"`
}
Cancel one or multiple internal promises (activities, local activities, timers, child workflows).
type CancelExternalWorkflow ¶
type CancelExternalWorkflow struct {
Namespace string `json:"namespace"`
WorkflowID string `json:"workflowID"`
RunID string `json:"runID"`
}
CancelExternalWorkflow canceler external workflow.
type CancelWorkflow ¶
type CancelWorkflow struct {
// RunID workflow run id.
RunID string `json:"runId"`
}
CancelWorkflow asks the worker to gracefully stop workflow, if possible (signal).
type CompleteWorkflow ¶
type CompleteWorkflow struct{}
CompleteWorkflow sent by the worker to complete workflow. Might include additional error as part of the payload.
type Context ¶
type Context struct {
// TaskQueue associates the message batch with the specific task queue in an underlying worker.
TaskQueue string `json:"taskQueue,omitempty"`
// TickTime associated current or historical time with message batch.
TickTime string `json:"tickTime,omitempty"`
// Replay indicates that the current message batch is historical.
Replay bool `json:"replay,omitempty"`
// History
HistoryLen int `json:"history_length,omitempty"`
// HistorySize returns the current byte size of history when called.
// This value may change throughout the life of the workflow.
HistorySize int `json:"history_size,omitempty"`
// RoadRunner run ID
RrID string `json:"rr_id"`
// GetContinueAsNewSuggested returns true if the server is configured to suggest 'continue as new',
// and it is suggested.
// This value may change throughout the life of the workflow.
ContinueAsNewSuggested bool `json:"continue_as_new_suggested"`
}
Context provides worker information about currently. Context can be empty for server-level commands.
type ContinueAsNew ¶
type ContinueAsNew struct {
// Result defines workflow execution result.
Name string `json:"name"`
// Options for continued as a new workflow.
Options struct {
TaskQueueName string
WorkflowRunTimeout time.Duration
WorkflowTaskTimeout time.Duration
} `json:"options"`
}
ContinueAsNew restarts workflow with new running instance.
type DestroyWorkflow ¶
type DestroyWorkflow struct {
// RunID workflow run id.
RunID string `json:"runId"`
}
DestroyWorkflow asks a worker to offload workflow from memory.
type ExecuteActivity ¶
type ExecuteActivity struct {
// Name defines activity name.
Name string `json:"name"`
// Options to run activity.
Options bindings.ExecuteActivityOptions `json:"options,omitempty"`
}
ExecuteActivity command by workflow worker.
func (ExecuteActivity) ActivityParams ¶
func (cmd ExecuteActivity) ActivityParams(env bindings.WorkflowEnvironment, payloads *commonpb.Payloads, header *commonpb.Header) bindings.ExecuteActivityParams
ActivityParams maps activity command to activity params.
type ExecuteChildWorkflow ¶
type ExecuteChildWorkflow struct {
// Name defines workflow name.
Name string `json:"name"`
// Options to run activity.
Options bindings.WorkflowOptions `json:"options,omitempty"`
}
ExecuteChildWorkflow executes child workflow.
func (ExecuteChildWorkflow) WorkflowParams ¶
func (cmd ExecuteChildWorkflow) WorkflowParams(env bindings.WorkflowEnvironment, payloads *commonpb.Payloads, header *commonpb.Header) bindings.ExecuteWorkflowParams
WorkflowParams maps workflow command to workflow params.
type ExecuteLocalActivity ¶
type ExecuteLocalActivity struct {
// Name defines activity name.
Name string `json:"name"`
// Options to run activity.
Options ExecuteLocalActivityOptions `json:"options,omitempty"`
}
ExecuteLocalActivity command by workflow worker.
func (ExecuteLocalActivity) LocalActivityParams ¶
func (cmd ExecuteLocalActivity) LocalActivityParams(env bindings.WorkflowEnvironment, fn any, payloads *commonpb.Payloads, header *commonpb.Header) bindings.ExecuteLocalActivityParams
LocalActivityParams maps activity command to activity params.
type ExecuteLocalActivityOptions ¶
type ExecuteLocalActivityOptions struct {
ScheduleToCloseTimeout time.Duration
StartToCloseTimeout time.Duration
RetryPolicy *commonpb.RetryPolicy
}
ExecuteLocalActivityOptions Since we use proto everywhere, we need to convert Activity options (proto) to non-proto LA options
type GetChildWorkflowExecution ¶
type GetChildWorkflowExecution struct {
// ID of child workflow command.
ID uint64 `json:"id"`
}
GetChildWorkflowExecution returns the WorkflowID and RunId of child workflow.
type GetStackTrace ¶
type GetStackTrace struct {
// RunID workflow run id.
RunID string `json:"runId"`
}
GetStackTrace asks worker to offload workflow from memory.
type GetVersion ¶
type GetVersion struct {
ChangeID string `json:"changeID"`
MinSupported int `json:"minSupported"`
MaxSupported int `json:"maxSupported"`
}
GetVersion requests version marker.
type GetWorkerInfo ¶
GetWorkerInfo reads worker information.
type InvokeActivity ¶
type InvokeActivity struct {
// Name defines activity name.
Name string `json:"name"`
// Info contains execution context.
Info activity.Info `json:"info"`
// HeartbeatDetails indicates that the payload also contains last heartbeat details.
HeartbeatDetails int `json:"heartbeatDetails,omitempty"`
}
InvokeActivity invokes activity.
type InvokeLocalActivity ¶
type InvokeLocalActivity struct {
// Name defines activity name.
Name string `json:"name"`
// Info contains execution context.
Info activity.Info `json:"info"`
}
InvokeLocalActivity invokes local activity.
type InvokeQuery ¶
type InvokeQuery struct {
// RunID workflow run id.
RunID string `json:"runId"`
// Name of the query.
Name string `json:"name"`
}
InvokeQuery invokes a query with a set of arguments.
type InvokeSignal ¶
type InvokeSignal struct {
// RunID workflow run id.
RunID string `json:"runId"`
// Name of the signal.
Name string `json:"name"`
}
InvokeSignal invokes signal with a set of arguments.
type InvokeUpdate ¶
type Message ¶
type Message struct {
// ID contains ID of the command, response or error.
ID uint64 `json:"id"`
// Command of the message in unmarshalled form. Pointer.
Command any `json:"command,omitempty"`
// Failure associated with command id.
Failure *failure.Failure `json:"failure,omitempty"`
// Payloads contain message-specific payloads in binary format.
Payloads *commonpb.Payloads `json:"payloads,omitempty"`
// Header
Header *commonpb.Header `json:"header,omitempty"`
}
Message used to exchange the send commands and receive responses from underlying workers.
func (*Message) UndefinedResponse ¶
type NewTimer ¶
type NewTimer struct {
// Milliseconds defines timer duration.
Milliseconds int `json:"ms"`
// Summary is a simple string identifying this timer. While it can be
// normal text, it is best to treat as a timer ID. This value will be
// visible in UI and CLI.
//
// NOTE: Experimental
Summary string `json:"summary"`
}
NewTimer starts a new timer.
func (NewTimer) ToDuration ¶
ToDuration converts timer command to time.Duration.
type Panic ¶
type Panic struct {
// Message to include in the error.
Message string `json:"message"`
}
Panic triggers panic in a workflow process.
type SignalExternalWorkflow ¶
type SignalExternalWorkflow struct {
Namespace string `json:"namespace"`
WorkflowID string `json:"workflowID"`
RunID string `json:"runID"`
Signal string `json:"signal"`
ChildWorkflowOnly bool `json:"childWorkflowOnly"`
}
SignalExternalWorkflow sends a signal to external workflow.
type StartWorkflow ¶
type StartWorkflow struct {
// Info to define workflow context.
Info *workflow.Info `json:"info"`
// LastCompletion contains offset of last completion results.
LastCompletion int `json:"lastCompletion,omitempty"`
// Typed search attributes
SearchAttributes map[string]*TypedSearchAttribute `json:"search_attributes,omitempty"`
}
StartWorkflow sends worker command to start workflow.
type TypedSearchAttribute ¶ added in v5.4.0
type TypedSearchAttribute struct {
Type TypedSearchAttributeType `json:"type"`
Operation TypedSearchAttributeOperation `json:"operation,omitempty"`
Value any `json:"value"`
}
type TypedSearchAttributeOperation ¶ added in v5.4.0
type TypedSearchAttributeOperation string
const ( TypedSearchAttributeOperationSet TypedSearchAttributeOperation = "set" TypedSearchAttributeOperationUnset TypedSearchAttributeOperation = "unset" )
type TypedSearchAttributeType ¶ added in v5.4.0
type TypedSearchAttributeType string
const ( BoolType TypedSearchAttributeType = "bool" FloatType TypedSearchAttributeType = "float64" IntType TypedSearchAttributeType = "int64" KeywordType TypedSearchAttributeType = "keyword" KeywordListType TypedSearchAttributeType = "keyword_list" StringType TypedSearchAttributeType = "string" DatetimeType TypedSearchAttributeType = "datetime" )
type UndefinedResponse ¶
type UndefinedResponse struct {
Message string `json:"message"`
}
UndefinedResponse indicates that we should panic the workflow
type UpdateCompleted ¶
type UpdateCompleted struct {
ID string `json:"id"`
}
UpdateCompleted sent by worker to complete update
type UpdateValidated ¶
type UpdateValidated struct {
ID string `json:"id"`
}
UpdateValidated sent by worker to validate update
type UpsertMemo ¶ added in v5.5.0
UpsertMemo updates workflow memo.
type UpsertWorkflowSearchAttributes ¶
type UpsertWorkflowSearchAttributes struct {
SearchAttributes map[string]any `json:"searchAttributes"`
}
UpsertWorkflowSearchAttributes allows upsert search attributes
type UpsertWorkflowTypedSearchAttributes ¶ added in v5.4.0
type UpsertWorkflowTypedSearchAttributes struct {
SearchAttributes map[string]*TypedSearchAttribute `json:"search_attributes"`
}
UpsertWorkflowTypedSearchAttributes allows upsert search attributes
type WorkerInfo ¶
type WorkerInfo struct {
// TaskQueue assigned to the worker.
TaskQueue string `json:"TaskQueue"`
// Options describe worker options.
Options worker.Options `json:"options,omitempty"`
// PhpSdkVersion is the underlying PHP-SDK version
PhpSdkVersion string `json:"PhpSdkVersion,omitempty"`
// Flags are internal worker flags.
Flags map[string]string `json:"Flags,omitempty"`
// Workflows provided by the worker.
Workflows []WorkflowInfo
// Activities provided by the worker.
Activities []ActivityInfo
}
WorkerInfo lists available task queues, workflows and activities.
type WorkflowInfo ¶
type WorkflowInfo struct {
// Name of the workflow.
Name string `json:"name"`
// Queries pre-defined for the workflow type.
Queries []string `json:"queries"`
// Signals pre-defined for the workflow type.
Signals []string `json:"signals"`
// VersioningBehavior for the workflow.
VersioningBehavior workflow.VersioningBehavior `json:"versioning_behavior,omitempty"`
}
WorkflowInfo describes a single worker workflow.