workflows

package
v0.0.0-...-ebb33e4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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.

Using Temporal

When using temporal as the workflow, the task queue must be provided as an Option in the start request struct with the key: task_queue

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

This section is empty.

Functions

This section is empty.

Types

type Metadata

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

Metadata represents a set of workflow specific properties.

type RaiseEventRequest

type RaiseEventRequest struct {
	InstanceID string `json:"workflow_reference"`
	EventName  string `json:"event_name"`
	Input      []byte `json:"input"`
}

RaiseEventRequest is the object describing a Raise Event request.

type StartRequest

type StartRequest struct {
	Options      map[string]string `json:"workflow_options"`
	InstanceID   string            `json:"workflow_reference"`
	WorkflowName string            `json:"function_name"`
	Input        interface{}       `json:"input"`
}

StartRequest is the object describing a Start Workflow request.

type StateResponse

type StateResponse struct {
	WFInfo    WorkflowReference
	StartTime string            `json:"start_time"`
	Metadata  map[string]string `json:"metadata"`
}

type Workflow

type Workflow interface {
	Init(metadata Metadata) error
	Start(ctx context.Context, req *StartRequest) (*WorkflowReference, error)
	Terminate(ctx context.Context, req *WorkflowReference) error
	Get(ctx context.Context, req *WorkflowReference) (*StateResponse, error)
	RaiseEvent(ctx context.Context, req *RaiseEventRequest) error
	Pause(ctx context.Context, req *WorkflowReference) error
	Resume(ctx context.Context, req *WorkflowReference) error
	GetComponentMetadata() map[string]string
}

Workflow is an interface to perform operations on Workflow.

type WorkflowReference

type WorkflowReference struct {
	InstanceID string `json:"instance_id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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