{
  "openapi": "3.1.0",
  "info": {
    "title": "Flocks Published Workflow API",
    "version": "fa86a422",
    "description": "仅发布后的工作流执行与健康接口；服务地址由发布方提供。"
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "publishedWorkflowHealth",
        "security": [],
        "responses": {
          "200": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "mcp_ready": {
                      "type": "boolean"
                    },
                    "mcp_error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "workflow_id": {
                      "type": "string"
                    },
                    "release_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "mcp_ready",
                    "mcp_error",
                    "workflow_id",
                    "release_id"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "mcp_ready": {
                      "type": "boolean"
                    },
                    "mcp_error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "workflow_id": {
                      "type": "string"
                    },
                    "release_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "mcp_ready",
                    "mcp_error",
                    "workflow_id",
                    "release_id"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/invoke": {
      "post": {
        "operationId": "invokePublishedWorkflow",
        "security": [
          {
            "WorkflowApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "inputs": {
                    "additionalProperties": true,
                    "type": "object",
                    "title": "Inputs"
                  },
                  "request_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Request Id"
                  },
                  "timeout_s": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "title": "Timeout S"
                  },
                  "trace": {
                    "type": "boolean",
                    "title": "Trace",
                    "default": false
                  },
                  "ensure_requirements": {
                    "type": "boolean",
                    "title": "Ensure Requirements",
                    "default": false
                  }
                },
                "type": "object",
                "title": "InvokeRequest",
                "description": "Request payload for workflow invoke."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "workflow_id": {
                      "type": "string"
                    },
                    "release_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "run_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "outputs": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duration_ms": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "request_id",
                    "workflow_id",
                    "release_id",
                    "status",
                    "run_id",
                    "outputs",
                    "error",
                    "duration_ms"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "WorkflowApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
