{
  "version": "3.16",
  "name": "VLClawSupervisorPrototype",
  "description": "A workflow-as-manager prototype: dispatches child workflows in parallel via WorkflowRun sync, waits for completion, aggregates their outputs, and writes a supervisor report.",
  "steps": [
    {
      "id": "Set_010_SpecPath",
      "target": "$specPath",
      "value": "=outputDir + \"/spec.txt\"",
      "next": "Set_020_ReviewPath"
    },
    {
      "id": "Set_020_ReviewPath",
      "target": "$reviewPath",
      "value": "=outputDir + \"/review.txt\"",
      "next": "Fork_030_Dispatch"
    },
    {
      "id": "Fork_030_Dispatch",
      "children": [
        "Tool_031_RunSpecWorker",
        "Tool_032_RunReviewWorker"
      ],
      "next": "Tool_040_ReadSpec"
    },
    {
      "id": "Tool_031_RunSpecWorker",
      "tool": "WorkflowRun",
      "input": {
        "mode": "sync",
        "workflow_path": "=\"examples/workflows/vlclaw-worker-spec.json\"",
        "params": {
          "goal": "=goal",
          "artifactPath": "=$specPath"
        }
      },
      "out": {
        "$specRun": "=_result"
      },
      "next": "RETURN"
    },
    {
      "id": "Tool_032_RunReviewWorker",
      "tool": "WorkflowRun",
      "input": {
        "mode": "sync",
        "workflow_path": "=\"examples/workflows/vlclaw-worker-review.json\"",
        "params": {
          "goal": "=goal",
          "artifactPath": "=$reviewPath"
        }
      },
      "out": {
        "$reviewRun": "=_result"
      },
      "next": "RETURN"
    },
    {
      "id": "Tool_040_ReadSpec",
      "tool": "ReadFile",
      "input": {
        "file_path": "=$specPath"
      },
      "out": {
        "$specText": "=_result"
      },
      "next": "Tool_050_ReadReview"
    },
    {
      "id": "Tool_050_ReadReview",
      "tool": "ReadFile",
      "input": {
        "file_path": "=$reviewPath"
      },
      "out": {
        "$reviewText": "=_result"
      },
      "next": "Set_060_Summary"
    },
    {
      "id": "Set_060_Summary",
      "target": "$summary",
      "value": "=\"goal=\" + goal + \"; spec=\" + $specRun.variables[\"$content\"] + \"; review=\" + $reviewRun.variables[\"$content\"]",
      "next": "Write_070_Report"
    },
    {
      "id": "Write_070_Report",
      "target": "=outputDir + \"/supervisor.txt\"",
      "value": "=$summary",
      "mode": "overwrite",
      "next": "Stop_End"
    },
    {
      "id": "Stop_End"
    }
  ]
}
