{
  "code": "operations-analysis",
  "name": "运营分析示例",
  "description": "演示 module_method 整理输入、Agent 生成结构化分析报告并由 end 输出的完整流程。",
  "status": "draft",
  "startNodeId": "start",
  "inputSchema": [
    {
      "name": "period",
      "type": {
        "@type": "DataType",
        "type": "string",
        "nullable": false
      },
      "description": "分析周期"
    }
  ],
  "outputSchema": {
    "@type": "DataType",
    "type": "object",
    "properties": {
      "analysis": {
        "@type": "DataType",
        "type": "object"
      }
    },
    "required": ["analysis"],
    "nullable": false
  },
  "nodes": [
    {
      "type": "start",
      "id": "start",
      "name": "开始"
    },
    {
      "type": "module_method",
      "id": "collect_analysis_input",
      "name": "获取并整理分析输入",
      "service": "baijimu/example-operations/MODULE/operations-data",
      "method": "buildAnalysisInput",
      "params": {
        "period": "{{input.period}}"
      },
      "timeoutSecs": 30,
      "retryPolicy": {
        "maxAttempts": 3,
        "initialDelayMs": 1000,
        "maxDelayMs": 5000,
        "backoffMultiplier": 2
      },
      "outputPath": "analysisInput"
    },
    {
      "type": "agent",
      "id": "analyze_operations",
      "name": "生成分析、建议和报告",
      "agentResourceLocator": "baijimu/example-operations/AGENT/operations-analyst",
      "message": "请基于 {{context.analysisInput}} 完成分析，给出建议并生成可供后续节点消费的报告。",
      "result": {
        "path": "analysisReport",
        "type": {
          "@type": "DataType",
          "type": "object",
          "properties": {
            "summary": { "@type": "DataType", "type": "string" },
            "recommendations": {
              "@type": "DataType",
              "type": "array",
              "items": { "@type": "DataType", "type": "string" }
            },
            "report": { "@type": "DataType", "type": "string" }
          },
          "required": ["summary", "recommendations", "report"]
        }
      },
      "executionPolicy": {
        "completionTimeoutSecs": 600
      }
    },
    {
      "type": "end",
      "id": "end",
      "name": "结束",
      "output": {
        "analysis": "{{context.analysisReport}}"
      }
    }
  ],
  "edges": [
    { "from": "start", "to": "collect_analysis_input" },
    { "from": "collect_analysis_input", "to": "analyze_operations" },
    { "from": "analyze_operations", "to": "end" }
  ],
  "tags": ["example", "agent"]
}
