{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/edgaze-ai/json-schema/edgaze-ai-workflow-detail-schema.json",
  "title": "WorkflowDetail",
  "description": "Full workflow detail with input schema and version visibility.",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/edgaze-ai-openapi.json#/components/schemas/WorkflowDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "ownerHandle": {
      "type": [
        "string",
        "null"
      ]
    },
    "edgazeCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "runModel": {
      "$ref": "#/$defs/RunModel"
    },
    "displayedRunPriceUsd": {
      "description": "Estimated run price shown to the buyer. The final price is confirmed when the run starts and may differ slightly from older catalog data. USD amount as a JSON number with up to six decimal places. Preserve the documented precision and do not round intermediate calculations to two decimal places.",
      "type": [
        "number",
        "null"
      ]
    },
    "pricingExplanation": {
      "description": "Human-readable note on how this listing is priced. Present whenever `displayedRunPriceUsd` is a positive estimate; explains that settlement uses the live quote at run start.",
      "type": [
        "string",
        "null"
      ]
    },
    "userAccess": {
      "$ref": "#/$defs/UserAccess"
    },
    "accessLabel": {
      "type": "string"
    },
    "apiRunnableNow": {
      "type": "boolean"
    },
    "apiAccessAllowed": {
      "type": "boolean"
    },
    "purchaseUrl": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "description": "Web checkout page for this workflow, or `null` when it has no public listing. Purchasing is not available through the API; send a buyer here when `userAccess` is `purchase_required`."
    },
    "credentialMode": {
      "$ref": "#/$defs/CredentialMode"
    },
    "requiredProviders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RequiredProvider"
      }
    },
    "versionId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "versionLabel": {
      "type": [
        "string",
        "null"
      ]
    },
    "pinnedVersionId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "description": "Version the caller is pinned to via a prior purchase, or `null` when they follow the active version."
    },
    "activeVersionId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "description": "Current active version published by the workflow owner."
    },
    "updateAvailable": {
      "type": "boolean",
      "description": "True when the caller is pinned to an older version than the active one. Same workflow id can execute different immutable graphs."
    },
    "inputCount": {
      "type": "integer",
      "minimum": 0
    },
    "inputSchema": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowInputField"
      }
    },
    "responseShape": {
      "$ref": "#/$defs/WorkflowRunResponseShape"
    },
    "exampleRequest": {
      "$ref": "#/$defs/WorkflowExampleRunRequest"
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "ownerHandle",
    "edgazeCode",
    "runModel",
    "displayedRunPriceUsd",
    "pricingExplanation",
    "userAccess",
    "accessLabel",
    "apiRunnableNow",
    "apiAccessAllowed",
    "purchaseUrl",
    "credentialMode",
    "requiredProviders",
    "versionId",
    "versionLabel",
    "pinnedVersionId",
    "activeVersionId",
    "updateAvailable",
    "inputCount",
    "inputSchema",
    "responseShape",
    "exampleRequest"
  ],
  "additionalProperties": false,
  "$defs": {
    "CredentialMode": {
      "type": "string",
      "enum": [
        "edgaze_hosted",
        "byok"
      ],
      "description": "Whether the workflow runs on Edgaze-hosted credentials or the caller's own keys."
    },
    "RequiredProvider": {
      "type": "string",
      "enum": [
        "openai",
        "anthropic",
        "google",
        "azure_openai",
        "vertex",
        "openrouter"
      ],
      "description": "External model provider a BYOK workflow expects the caller to configure."
    },
    "RunModel": {
      "type": "string",
      "enum": [
        "free",
        "per_run"
      ],
      "description": "Pricing model for a workflow listing."
    },
    "UserAccess": {
      "type": "string",
      "enum": [
        "owned",
        "purchased",
        "wallet",
        "purchase_required"
      ],
      "description": "How the authenticated key holder can currently pay to run this workflow: `owned` (the caller is the creator), `purchased` (a prior purchase covers it), or `wallet` (it will be billed to wallet balance at run time). `purchase_required` marks legacy unlock listings that cannot be run or bought through the API — `apiRunnableNow` is false and POST /runs returns 403 `forbidden`. Purchasing is a web-only checkout flow; send the buyer to `purchaseUrl` on the workflow detail response."
    },
    "WorkflowExampleRunRequest": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "const": "POST"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "body": {
          "type": "object",
          "properties": {
            "workflow": {
              "type": "string",
              "minLength": 1,
              "format": "uuid"
            },
            "inputs": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "idempotencyKey": {
              "type": "string"
            }
          },
          "required": [
            "workflow",
            "inputs"
          ],
          "additionalProperties": {}
        }
      },
      "required": [
        "method",
        "url",
        "body"
      ],
      "additionalProperties": false,
      "description": "Ready-to-copy example POST /runs payload for this workflow."
    },
    "WorkflowInputField": {
      "type": "object",
      "properties": {
        "nodeId": {
          "type": "string",
          "description": "Stable key for this field. Use it as the `inputs` key when calling POST /runs — `name` is a display label and is not guaranteed unique."
        },
        "specId": {
          "description": "Identifier of the node kind that produced this field. Informational.",
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Display label for the field."
        },
        "description": {
          "description": "Helper text explaining the field.",
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/WorkflowInputType"
        },
        "required": {
          "description": "When true, POST /runs rejects the run if this key is absent.",
          "type": "boolean"
        },
        "placeholder": {
          "description": "Suggested placeholder text.",
          "type": "string"
        },
        "defaultValue": {
          "description": "Pre-filled value to use when the caller supplies nothing.",
          "type": "string"
        },
        "options": {
          "description": "Allowed choices. Present only when `type` is `dropdown`.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowInputOption"
          }
        }
      },
      "required": [
        "nodeId",
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "Single input field from the workflow's published input schema."
    },
    "WorkflowInputOption": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "Human-readable choice shown to a person."
        },
        "value": {
          "type": "string",
          "description": "Value to send in `inputs` when this choice is picked."
        }
      },
      "required": [
        "label",
        "value"
      ],
      "additionalProperties": false,
      "description": "One selectable choice for a `dropdown` input."
    },
    "WorkflowInputType": {
      "type": "string",
      "enum": [
        "text",
        "password",
        "number",
        "textarea",
        "url",
        "file",
        "json",
        "dropdown"
      ],
      "description": "Control type for an input field. `dropdown` is the only type that populates `options`. `password` fields are per-run credentials: encrypted at rest and deleted when the run ends. `file` and `json` expect a JSON-encoded value."
    },
    "WorkflowRunResponseShape": {
      "type": "object",
      "properties": {
        "run": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "format": "uuid"
            },
            "status": {
              "type": "string"
            },
            "statusUrl": {
              "type": "string",
              "format": "uri"
            },
            "eventsUrl": {
              "type": "string",
              "format": "uri"
            },
            "streamUrl": {
              "type": "string",
              "format": "uri"
            }
          },
          "required": [
            "id",
            "status",
            "statusUrl",
            "eventsUrl",
            "streamUrl"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "run"
      ],
      "additionalProperties": false,
      "description": "Documentation-only shape showing what POST /runs returns for this workflow."
    }
  }
}