graph

suspend fun KmpWorker.graph(graphId: String, block: TaskGraphBuilder.() -> Unit)

Builds and executes a TaskGraph (DAG) using a fluent DSL.

Independent nodes run in parallel; dependent nodes wait for all upstream dependencies to complete before starting.

kmpWorker.graph("pipeline") {
val fetch = task("fetch-data")
val process = task("process")
val validate = task("validate")
val upload = task("upload")

fetch then process // process depends on fetch
fetch then validate // validate runs parallel with process
process then upload // upload waits for BOTH
validate then upload
}