Skip to main content
neutral

Phase 3: Structured Execution Graphs

Status: Completed (2026-02-09)

Goal: Branching, parallelism, and routing via a DSL that compiles to Temporal workflows.

Scope:

  • Step DSL with conditional steps
  • Conditional routing
  • Parallel execution with join semantics
  • Subgraph composition

Implementation notes:

  • DSL and graph types live under internal/graph
  • Graph runner workflow: graph.GraphWorkflow
  • Conditions are registered in the worker via graph.RegisterCondition
  • Sample activity: graph.EchoActivity
  • Graph worker: cmd/graph-worker
  • Graph runner: cmd/graph-run
  • Graph tooling: cmd/graph-query, cmd/graph-approve, cmd/graph-edit-state

Tasks and subtasks:

  1. DSL design
    • Go-native builder with steps, routes, and parallel branches
    • Subgraph inclusion via Include and branch composition
  2. Compiler/executor
    • Graph execution engine in Temporal workflow
    • Step execution via activity calls
  3. Parallel execution
    • JoinAll, JoinAny, JoinN, JoinVote (vote uses boolean state["vote"])
    • Aggregation under state["parallel.<name>"]
  4. Routing
    • Route cases with conditions and default fallback (conditions are registered in worker)
  5. Tests
    • JoinAll / JoinN / Route tests in internal/graph/graph_test.go

Deliverables:

  • DSL + graph model
  • Workflow executor with join semantics
  • Test suite
  • Demo worker/runner

Dev environment checks:

  • Run unit tests
  • Start graph worker and run demo graph
  • Validate joins and routing via workflow state

Dependencies:

  • Phase 1 completion
  • Phase 2 not required