Skip to main content

Module executor

Module executor 

Source
Expand description

Workflow execution engine.

§Parallel Fan-out / Fan-in

WorkflowExecutor::execute automatically discovers independent groups of tasks — tasks whose dependencies are all satisfied at the same time — and launches them concurrently. When all tasks in a fan-out group complete the join point (fan-in) tasks are unblocked. This happens naturally through the dependency-tracking loop; no explicit graph analysis is required.

§Scheduling correctness

A task whose dependencies are not yet satisfied is retried on the next pass, never dropped: the scheduler repeatedly rescans the set of not-yet-dispatched tasks (a fixpoint loop) until every task has either run to completion, been synthetically completed from a checkpoint, or been skipped. WorkflowState::Completed is returned only when that fixpoint is reached with an empty failure set. A real task failure, or a dependency that can never be satisfied because an upstream task failed or was skipped, is reported as WorkflowState::Failed (or a scheduling WorkflowError if no task can ever become ready again) — never silently downgraded to a fabricated success.

§Pause / Resume

Call WorkflowExecutor::pause to signal the executor to stop launching new tasks after the current wave completes. The checkpoint is serialised to a JSON string containing the completed task IDs and execution context variables. Pass that string to WorkflowExecutor::resume_from_checkpoint to reconstruct the state and continue.

Structs§

DefaultTaskExecutor
Default task executor implementation.
ExecutionCheckpoint
Serializable checkpoint for pause/resume of workflow execution.
ExecutionContext
Execution context shared across task executions.
ExecutionResult
Workflow execution result.
StatusUpdate
A buffered status update pending persistence.
WorkflowExecutor
Workflow executor.

Enums§

WorkflowControl
High-level control signal for a running WorkflowExecutor.

Traits§

TaskExecutor
Task executor trait.

Functions§

parse_condition
Parse and evaluate a single condition expression against the execution context.