DagNode import type {DagNode} from '@fuzdev/fuz_util/dag.js'; Minimum shape for a DAG node.
inheritance
id
type string
depends_on?
type Array<string>
Generic concurrent DAG executor.
Executes nodes in a dependency graph with configurable concurrency, failure handling, and skip semantics. Nodes without dependency edges run in parallel (up to max_concurrency). Dependencies are respected via per-node deferreds.
5 declarations
DagNode import type {DagNode} from '@fuzdev/fuz_util/dag.js'; Minimum shape for a DAG node.
idtype string
depends_on?type Array<string>
DagNodeResult import type {DagNodeResult} from '@fuzdev/fuz_util/dag.js'; Result for a single node.
idtype string
statustype 'completed' | 'failed' | 'skipped'
error?type string
duration_mstype number
DagOptions<T> import type {DagOptions} from '@fuzdev/fuz_util/dag.js'; Options for running a DAG.
DagOptions<T extends DagNode>TnodesNodes to execute.
type Array<T>
executeExecute a node. Throw on failure.
type (node: T) => Promise<void>
on_error?Called after a node fails. For observability — the error is already recorded.
type (node: T, error: Error) => Promise<void>
on_skip?Called when a node is skipped (pre-skip or dependency failure).
type (node: T, reason: string) => Promise<void>
should_skip?Return true to skip a node without executing. Dependents still proceed.
type (node: T) => boolean
max_concurrency?Maximum concurrent executions. Default: Infinity.
type number
stop_on_failure?Stop starting new nodes on first failure. Default: true.
type boolean
skip_validation?Skip internal graph validation (caller already validated).
type boolean
DagResult import type {DagResult} from '@fuzdev/fuz_util/dag.js'; Result of a DAG execution.
successWhether all executed nodes succeeded.
type boolean
resultsPer-node results.
type Map<string, DagNodeResult>
completedNumber of nodes that completed successfully.
type number
failedNumber of nodes that failed.
type number
skippedNumber of nodes that were skipped.
type number
duration_msTotal execution time in milliseconds.
type number
error?Error message if any nodes failed.
type string
<T extends DagNode>(options: DagOptions<T>): Promise<DagResult> import {run_dag} from '@fuzdev/fuz_util/dag.js'; Execute nodes in a dependency graph concurrently.
Independent nodes (no unmet dependencies) run in parallel up to
max_concurrency. When a node completes, its dependents become
eligible to start. Failure cascading and stop-on-failure are handled
per the options.
optionsDAG execution options
DagOptions<T>Promise<DagResult> aggregated result with per-node details
run_dag<T extends DagNode>T