workflows

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

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

PauseRequest is the struct describing a pause workflow request.

type PurgeRequest

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

PurgeRequest is the object describing a Purge request.

type RaiseEventRequest

type RaiseEventRequest struct {
	InstanceID string                  `json:"instanceID"`
	EventName  string                  `json:"name"`
	EventData  *wrapperspb.StringValue `json:"data"`
}

RaiseEventRequest is the struct describing a raise workflow event request.

type ResumeRequest

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 *wrapperspb.StringValue `json:"workflowInput"`
}

StartRequest is the struct describing a start workflow request.

type StartResponse

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

type StateResponse

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

type TerminateRequest

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
	io.Closer
}

Workflow is an interface to perform operations on Workflow.

type WorkflowState

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