workflows

package
v1.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 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.

Documentation

Overview

Package workflows defines the workflows a process is carried out by, each a sequence of the tasks in the tasks packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registrar

type Registrar interface {
	RegisterWorkflow(wf workflow.Workflow, opts ...registry.RegisterOption) error
	RegisterActivity(a workflow.Activity, opts ...registry.RegisterOption) error
}

Registrar is where the workflows and the activities they run are registered: worker.WorkflowOrchestrator in the server, a test registry elsewhere.

type Workflows

type Workflows struct {
	// contains filtered or unexported fields
}

Workflows holds the workflows of a process and the tasks they run.

func New

func New(data *data.Tasks, batch *batch.Tasks, monitoring *monitoring.Tasks,
	dataStagingTasks *processrepo.DataStagingTaskRepository,
	jobSubmissionTasks *processrepo.JobSubmissionTaskRepository,
	jobMonitoringTasks *processrepo.JobMonitoringTaskRepository,
	processStatus *processrepo.StatusRepository,
	processWorkflows *processrepo.WorkflowRepository,
) *Workflows

New returns the workflows over the given tasks and the repositories they are planned from.

func (*Workflows) CompleteProcess

func (a *Workflows) CompleteProcess(ctx context.Context, executionContext *execution.Context, processID string) (*execution.Context, error)

CompleteProcess is the last activity of the completion workflow: it marks the process complete once its outputs are staged.

func (*Workflows) HandleBatchJobCompletion

func (w *Workflows) HandleBatchJobCompletion(ctx workflow.Context, processID string) error

HandleBatchJobCompletion runs once the scheduler reports a job finished: it checks the job's outcome, stages its outputs back and marks the process complete.

func (*Workflows) HandleBatchJobSubmission

func (w *Workflows) HandleBatchJobSubmission(ctx workflow.Context, processID string) error

HandleBatchJobSubmission stages a process's inputs onto its cluster and submits the job. This is an async call and will not block the caller.

func (*Workflows) RecordWorkflowStatus

func (w *Workflows) RecordWorkflowStatus(ctx context.Context, processID, workflowID string,
	workflowType model.ProcessWorkflowType, status model.ProcessWorkflowStatusType) error

RecordWorkflowStatus is the activity behind recordStatus. The write is an activity rather than workflow code so that a replay reads its result from history instead of writing again.

func (*Workflows) Register

func (w *Workflows) Register(r Registrar) error

Register registers every workflow and activity with r. A workflow or activity is registered under its function name, which is also how a running instance refers to it, so renaming one strands the instances already in the backend.

Jump to

Keyboard shortcuts

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