workflow

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package workflow implements workflow DAG validation, topological ordering, and the orchestrator that advances workflow state on task completion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllTasksCompleted

func AllTasksCompleted(instance *types.WorkflowInstance) bool

AllTasksCompleted returns true if every task in the workflow has completed.

func AnyTaskFailed

func AnyTaskFailed(instance *types.WorkflowInstance) bool

AnyTaskFailed returns true if any task in the workflow has failed.

func ReadyTasks

func ReadyTasks(instance *types.WorkflowInstance) []string

ReadyTasks returns the names of tasks in a workflow instance that are ready to be dispatched: all their dependencies are completed and the task itself is still pending.

func RootTasks

func RootTasks(def *types.WorkflowDefinition) []string

RootTasks returns the names of tasks with no dependencies.

func TopologicalOrder

func TopologicalOrder(def *types.WorkflowDefinition) ([]string, error)

TopologicalOrder returns the tasks in a valid execution order.

func ValidateDAG

func ValidateDAG(def *types.WorkflowDefinition) error

ValidateDAG checks that a workflow definition forms a valid DAG: - All task names are unique - All DependsOn references exist - No circular dependencies (Kahn's algorithm)

Types

This section is empty.

Jump to

Keyboard shortcuts

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