{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kaitoi-io/json-schema/kaitoi-io-public-run-create-request-schema.json",
  "title": "PublicRunCreateRequest",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kaitoi-io-openapi.json#/components/schemas/PublicRunCreateRequest",
  "properties": {
    "projectId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Projectid",
      "description": "Project id to snapshot and execute."
    },
    "graph": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicInlineGraph"
        },
        {
          "type": "null"
        }
      ],
      "description": "Inline transient graph to snapshot and execute instead of a saved project."
    },
    "targetNodeIds": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Targetnodeids",
      "description": "Node ids to execute. Empty means the service may choose the saved-project default target. Inline graph runs must provide at least one target node id."
    },
    "externalId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalid"
    },
    "externalUserId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externaluserid",
      "description": "Developer end-user guard. Referenced files with externalUserId must match this value."
    },
    "externalWorkspaceId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalworkspaceid"
    },
    "inputOverrides": {
      "additionalProperties": {
        "additionalProperties": {
          "oneOf": [
            {
              "$ref": "#/$defs/PublicRunFileInput"
            },
            {
              "$ref": "#/$defs/PublicRunStringInput"
            },
            {
              "$ref": "#/$defs/PublicRunNumberInput"
            },
            {
              "$ref": "#/$defs/PublicRunBooleanInput"
            },
            {
              "$ref": "#/$defs/PublicRunJsonInput"
            },
            {
              "$ref": "#/$defs/PublicRunNullInput"
            }
          ]
        },
        "type": "object"
      },
      "type": "object",
      "title": "Inputoverrides",
      "description": "Non-persistent input overrides keyed by node id then input pin name."
    },
    "persistInputOverrides": {
      "type": "boolean",
      "title": "Persistinputoverrides",
      "description": "Reserved for a later persistence contract. V1 run overrides default to non-persistent.",
      "default": false
    }
  },
  "type": "object",
  "$defs": {
    "PublicInlineGraph": {
      "properties": {
        "nodes": {
          "items": {
            "$ref": "#/$defs/PublicInlineGraphNode"
          },
          "type": "array",
          "title": "Nodes"
        },
        "connections": {
          "items": {
            "$ref": "#/$defs/PublicInlineGraphConnection"
          },
          "type": "array",
          "title": "Connections"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "nodes"
      ],
      "title": "PublicInlineGraph"
    },
    "PublicInlineGraphConnection": {
      "properties": {
        "from": {
          "title": "From"
        },
        "to": {
          "title": "To"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "from",
        "to"
      ],
      "title": "PublicInlineGraphConnection"
    },
    "PublicInlineGraphNode": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "type": {
          "type": "string",
          "title": "Type"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "inputs": {
          "additionalProperties": true,
          "type": "object",
          "title": "Inputs"
        },
        "position": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicInlineGraphPosition"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "id",
        "type"
      ],
      "title": "PublicInlineGraphNode"
    },
    "PublicInlineGraphPosition": {
      "properties": {
        "x": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "X"
        },
        "y": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Y"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "x",
        "y"
      ],
      "title": "PublicInlineGraphPosition"
    },
    "PublicRunBooleanInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "boolean",
          "title": "Type"
        },
        "value": {
          "type": "boolean",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunBooleanInput"
    },
    "PublicRunFileInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "title": "Type",
          "description": "Input value is a REST API file reference."
        },
        "fileId": {
          "type": "string",
          "title": "Fileid",
          "description": "REST API file id returned by file upload completion."
        }
      },
      "type": "object",
      "required": [
        "type",
        "fileId"
      ],
      "title": "PublicRunFileInput"
    },
    "PublicRunJsonInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "json",
          "title": "Type"
        },
        "value": {
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunJsonInput"
    },
    "PublicRunNullInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "null",
          "title": "Type"
        },
        "value": {
          "type": "null",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "PublicRunNullInput"
    },
    "PublicRunNumberInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "number",
          "title": "Type"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunNumberInput"
    },
    "PublicRunStringInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "title": "Type"
        },
        "value": {
          "type": "string",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunStringInput"
    }
  }
}