{
  "name": "TjMakeBot OpenClaw Closed-loop Workflow",
  "version": "2.1.1",
  "description": "Hosted closed-loop workflow template for OpenClaw: create workflow -> approve review -> start training -> poll progress -> export artifact.",
  "inputs": {
    "projectId": "pj_openclaw_demo",
    "datasetUri": "s3://bucket/dataset.zip",
    "mode": "2d",
    "annotationObjectsJson": "[\"person\",\"car\",\"traffic-light\"]",
    "annotationInstructions": "Only label complete visible targets. Occluded targets should still be marked.",
    "model": "yolo11s",
    "epochs": "120",
    "batchSize": "16",
    "imageSize": "640",
    "optimizer": "adamw",
    "learningRate": "0.001",
    "mixedPrecision": "true",
    "exportFormat": "onnx",
    "callbackUrl": "https://openclaw.example/callback"
  },
  "nodes": [
    {
      "id": "createWorkflow",
      "type": "http",
      "name": "Create Workflow Session",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/openclaw-gateway/workflows",
        "json": {
          "projectId": "{{inputs.projectId}}",
          "datasetUri": "{{inputs.datasetUri}}",
          "mode": "{{inputs.mode}}",
          "annotationObjects": "{{inputs.annotationObjectsJson}}",
          "annotationInstructions": "{{inputs.annotationInstructions}}"
        }
      }
    },
    {
      "id": "approveReview",
      "type": "http",
      "name": "Approve Annotation Review",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/openclaw-gateway/workflows/{{nodes.createWorkflow.response.workflowId}}/review/approve",
        "json": {
          "notes": "Approved by OpenClaw closed-loop template"
        }
      }
    },
    {
      "id": "startTraining",
      "type": "http",
      "name": "Start Training",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/openclaw-gateway/workflows/{{nodes.createWorkflow.response.workflowId}}/train",
        "json": {
          "model": "{{inputs.model}}",
          "epochs": "{{inputs.epochs}}",
          "batchSize": "{{inputs.batchSize}}",
          "imageSize": "{{inputs.imageSize}}",
          "optimizer": "{{inputs.optimizer}}",
          "learningRate": "{{inputs.learningRate}}",
          "mixedPrecision": "{{inputs.mixedPrecision}}"
        }
      }
    },
    {
      "id": "pollProgress",
      "type": "http",
      "name": "Poll Workflow Progress",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/openclaw-gateway/workflows/{{nodes.createWorkflow.response.workflowId}}/progress"
      }
    },
    {
      "id": "exportArtifact",
      "type": "http",
      "name": "Export Artifact",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/openclaw-gateway/workflows/{{nodes.createWorkflow.response.workflowId}}/export",
        "json": {
          "format": "{{inputs.exportFormat}}",
          "callbackUrl": "{{inputs.callbackUrl}}"
        }
      }
    }
  ]
}
