workflows

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 9

README

Workflows

A workflow is custom application logic that consists of a set of tasks and or state transitions.

Implementing a new Workflow

A compliant workflow needs to implement the Workflow interface included in the workflow.go file.

Associated Information

The following link to the workflow proposal will provide more information on this feature area: https://github.com/dapr/dapr/issues/4576

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("this component doesn't implement the current API operation")

Functions

This section is empty.

Types

type GetRequest added in v1.11.0

type GetRequest struct {
	InstanceID string `json:"instanceID"`
}

GetRequest is the struct describing a get workflow state request.

type Metadata

type Metadata struct {
	metadata.Base `json:",inline"`
}

Metadata represents a set of workflow specific properties.

type PauseRequest added in v1.11.0

type PauseRequest struct {
	InstanceID string `json:"instanceID"`
}

PauseRequest is the struct describing a pause workflow request.

type PurgeRequest added in v1.11.0

type PurgeRequest struct {
	InstanceID string `json:"instanceID"`
	Recursive  bool   `json:"recursive"`
}

PurgeRequest is the object describing a Purge request.

type RaiseEventRequest added in v1.11.0

type RaiseEventRequest struct {
	InstanceID string `json:"instanceID"`
	EventName  string `json:"name"`
	EventData  []byte `json:"data"`
}

RaiseEventRequest is the struct describing a raise workflow event request.

type ResumeRequest added in v1.11.0

type ResumeRequest struct {
	InstanceID string `json:"instanceID"`
}

ResumeRequest is the struct describing a resume workflow request.

type StartRequest

type StartRequest struct {
	InstanceID    string            `json:"instanceID"`
	Options       map[string]string `json:"options"`
	WorkflowName  string            `json:"workflowName"`
	WorkflowInput []byte            `json:"workflowInput"`
}

StartRequest is the struct describing a start workflow request.

type StartResponse added in v1.11.0

type StartResponse struct {
	InstanceID string `json:"instanceID"`
}

type StateResponse

type StateResponse struct {
	Workflow *WorkflowState `json:"workflow"`
}

type TerminateRequest added in v1.11.0

type TerminateRequest struct {
	InstanceID string `json:"instanceID"`
	Recursive  bool   `json:"recursive"`
}

TerminateRequest is the struct describing a terminate workflow request.

type Workflow

type Workflow interface {
	Init(metadata Metadata) error
	Start(ctx context.Context, req *StartRequest) (*StartResponse, error)
	Terminate(ctx context.Context, req *TerminateRequest) error
	Get(ctx context.Context, req *GetRequest) (*StateResponse, error)
	RaiseEvent(ctx context.Context, req *RaiseEventRequest) error
	Purge(ctx context.Context, req *PurgeRequest) error
	Pause(ctx context.Context, req *PauseRequest) error
	Resume(ctx context.Context, req *ResumeRequest) error
}

Workflow is an interface to perform operations on Workflow.

type WorkflowState added in v1.11.0

type WorkflowState struct {
	InstanceID    string            `json:"instanceID"`
	WorkflowName  string            `json:"workflowName"`
	CreatedAt     time.Time         `json:"startedAt"`
	LastUpdatedAt time.Time         `json:"lastUpdatedAt"`
	RuntimeStatus string            `json:"runtimeStatus"`
	Properties    map[string]string `json:"properties"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL