Package com.tnsai.coordination.workflow
Class DAGExecutor
java.lang.Object
com.tnsai.coordination.workflow.DAGExecutor
Executes workflow steps as a Directed Acyclic Graph (DAG).
Steps with no dependencies run in parallel; dependent steps wait for their prerequisites.
Example usage:
WorkflowResult result = DAGExecutor.builder()
.step("fetch-a", fetchAgentA)
.step("fetch-b", fetchAgentB)
.step("merge", mergeAgent, List.of("fetch-a", "fetch-b"))
.step("report", reportAgent, List.of("merge"))
.build()
.execute(new WorkflowContext("dag-1"));
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic DAGExecutor.Builderbuilder()execute(WorkflowContext context) Executes the DAG, running independent steps in parallel.executeAsync(WorkflowContext context) Executes the DAG asynchronously.
-
Method Details
-
execute
Executes the DAG, running independent steps in parallel. Steps wait for all their dependencies to complete before executing. -
executeAsync
Executes the DAG asynchronously. -
builder
-