subflow

package
v2.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package subflow adapts Dagu child workflow execution to the runtime executor's child workflow interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

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

Local runs child workflows in the current process through the runtime agent.

func NewLocal

func NewLocal(dagRunMgr runtime.Manager, dagStore exec.DAGStore, opts ...LocalOption) *Local

NewLocal creates an in-process child workflow runner.

func (*Local) Cancel

Cancel requests cancellation for a running in-process child workflow.

func (*Local) Retry

Retry retries a child workflow step in the current process.

func (*Local) Run

Run executes a child workflow in the current process.

func (*Local) ShouldRun

func (r *Local) ShouldRun(_ context.Context, req executor.SubWorkflowRequest) bool

ShouldRun reports whether req can use the in-process local path.

type LocalOption

type LocalOption func(*Local)

LocalOption configures Local.

func WithLocalArtifactFinalizer

func WithLocalArtifactFinalizer(finalizer runtime.ArtifactFinalizer) LocalOption

WithLocalArtifactFinalizer sets the artifact finalizer used by child workflow agents.

func WithLocalDAGRunDirs

func WithLocalDAGRunDirs(logDir, artifactDir string) LocalOption

WithLocalDAGRunDirs sets the log and artifact directories used by child workflow agents.

func WithLocalDAGRunStore

func WithLocalDAGRunStore(store exec.DAGRunStore) LocalOption

WithLocalDAGRunStore sets the dag-run store used by child workflow agents.

func WithLocalLogWriterFactory

func WithLocalLogWriterFactory(factory exec.LogWriterFactory) LocalOption

WithLocalLogWriterFactory sets the log writer factory used by child workflow agents.

func WithLocalProfileStore

func WithLocalProfileStore(store profilepkg.Store) LocalOption

WithLocalProfileStore sets the runtime profile store used by child workflow agents.

func WithLocalQueueStore

func WithLocalQueueStore(store exec.QueueStore) LocalOption

WithLocalQueueStore sets the queue store used by child workflow agents.

func WithLocalRunStateStore

func WithLocalRunStateStore(store runstate.Store) LocalOption

WithLocalRunStateStore sets the run-state store used by child workflow agents.

func WithLocalSecretStore

func WithLocalSecretStore(store secretpkg.Store) LocalOption

WithLocalSecretStore sets the secret store used by child workflow agents.

func WithLocalServiceRegistry

func WithLocalServiceRegistry(registry exec.ServiceRegistry) LocalOption

WithLocalServiceRegistry sets the service registry used by child workflow agents.

func WithLocalStateStore

func WithLocalStateStore(store dagstate.Store) LocalOption

WithLocalStateStore sets the state store used by child workflow agents.

func WithLocalStatusPusher

func WithLocalStatusPusher(pusher runtime.StatusPusher) LocalOption

WithLocalStatusPusher sets the status pusher used by child workflow agents.

func WithLocalSubWorkflowRunnerFactory

func WithLocalSubWorkflowRunnerFactory(factory rtagent.SubWorkflowRunnerFactory) LocalOption

WithLocalSubWorkflowRunnerFactory sets the nested child workflow runner factory.

func WithLocalToolInstaller

func WithLocalToolInstaller(installer dagutools.Installer) LocalOption

WithLocalToolInstaller sets the installer used to make child DAG tools available.

func WithLocalWorkerID

func WithLocalWorkerID(workerID string) LocalOption

WithLocalWorkerID sets the worker ID reported by child workflow agents.

type Option

type Option func(*Runner)

Option configures Runner.

func WithCancellationTimeout

func WithCancellationTimeout(timeout time.Duration) Option

WithCancellationTimeout sets how long cancellation waits for a terminal status.

func WithLogInterval

func WithLogInterval(interval time.Duration) Option

WithLogInterval sets the waiting progress log interval.

func WithPollInterval

func WithPollInterval(interval time.Duration) Option

WithPollInterval sets the status polling interval.

type Router

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

Router selects the first child workflow runner that accepts a request.

func NewRouter

func NewRouter(runners ...executor.SubWorkflowRunner) *Router

NewRouter creates a child workflow runner that tries runners in order.

func (*Router) Cancel

Cancel routes cancellation to the runner that owns req.RunID. Unknown ownership falls back to best-effort cancellation across all runners.

func (*Router) Cleanup

func (r *Router) Cleanup(ctx context.Context) error

Cleanup releases resources held by child runners.

func (*Router) Retry

Retry retries req with the first matching runner.

func (*Router) Run

Run executes req with the first matching runner.

func (*Router) ShouldRun

func (r *Router) ShouldRun(ctx context.Context, req executor.SubWorkflowRequest) bool

ShouldRun reports whether any runner accepts req.

type Runner

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

Runner executes child workflows through Dagu's distributed coordinator.

func New

func New(dispatcher exec.Dispatcher, defaultMode config.ExecutionMode, opts ...Option) *Runner

New creates a coordinator-backed child workflow runner.

func (*Runner) Cancel

Cancel requests cancellation for a child workflow run.

func (*Runner) Cleanup

func (r *Runner) Cleanup(ctx context.Context) error

Cleanup releases resources held by the underlying dispatcher.

func (*Runner) Retry

Retry schedules a parent-managed retry for a child workflow step.

func (*Runner) Run

Run starts a child workflow and waits for its result.

func (*Runner) ShouldRun

func (r *Runner) ShouldRun(_ context.Context, req executor.SubWorkflowRequest) bool

ShouldRun reports whether req should use the distributed child workflow path.

Jump to

Keyboard shortcuts

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