{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ownerApp": {
      "type": "string"
    },
    "createTime": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "updateTime": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "createdBy": {
      "type": "string"
    },
    "updatedBy": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "description": {
      "type": "string"
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "tasks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "inputParameters": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "outputParameters": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema1"
      }
    },
    "failureWorkflow": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "schemaVersion": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "restartable": {
      "type": "boolean"
    },
    "workflowStatusListenerEnabled": {
      "type": "boolean"
    },
    "ownerEmail": {
      "type": "string",
      "format": "email",
      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "timeoutPolicy": {
      "type": "string",
      "enum": [
        "TIME_OUT_WF",
        "ALERT_ONLY"
      ]
    },
    "timeoutSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "variables": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema1"
      }
    },
    "inputTemplate": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema1"
      }
    }
  },
  "required": [
    "name",
    "version",
    "tasks",
    "inputParameters",
    "timeoutSeconds"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "taskReferenceName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "type": {
          "type": "string",
          "enum": [
            "SIMPLE",
            "DYNAMIC",
            "FORK_JOIN",
            "FORK_JOIN_DYNAMIC",
            "DECISION",
            "SWITCH",
            "JOIN",
            "DO_WHILE",
            "SUB_WORKFLOW",
            "START_WORKFLOW",
            "EVENT",
            "WAIT",
            "HUMAN",
            "USER_DEFINED",
            "HTTP",
            "LAMBDA",
            "INLINE",
            "EXCLUSIVE_JOIN",
            "TERMINATE",
            "KAFKA_PUBLISH",
            "JSON_JQ_TRANSFORM",
            "SET_VARIABLE",
            "CALL_MCP_TOOL",
            "GENERATE_AUDIO",
            "GENERATE_IMAGE",
            "GENERATE_PDF",
            "GENERATE_VIDEO",
            "LIST_MCP_TOOLS",
            "LLM_CHAT_COMPLETE",
            "LLM_GENERATE_EMBEDDINGS",
            "LLM_INDEX_TEXT",
            "LLM_SEARCH_INDEX",
            "TITUS",
            "USER_TASK"
          ]
        },
        "inputParameters": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema1"
          }
        },
        "startDelay": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "optional": {
          "type": "boolean"
        },
        "asyncComplete": {
          "type": "boolean"
        },
        "rateLimited": {
          "type": "boolean"
        },
        "retryCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "taskDefinition": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema1"
          }
        },
        "loopCondition": {
          "type": "string"
        },
        "loopOver": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "sink": {
          "type": "string"
        },
        "forkTasks": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "joinOn": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "defaultExclusiveJoinTask": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "dynamicForkTasksParam": {
          "type": "string"
        },
        "dynamicForkTasksInputParamName": {
          "type": "string"
        },
        "subWorkflowParam": {
          "type": "object",
          "properties": {
            "$ref": {
              "type": "string"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "version": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "taskToDomain": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            "workflowDefinition": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema1"
              }
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "decisionCases": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "defaultCase": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "evaluatorType": {
          "type": "string",
          "enum": [
            "value-param",
            "javascript",
            "graaljs"
          ]
        },
        "expression": {
          "type": "string"
        },
        "__alias": {
          "$ref": "#/$defs/__schema1"
        },
        "callbackFromWorker": {
          "type": "boolean"
        },
        "caseExpression": {
          "$ref": "#/$defs/__schema1"
        },
        "caseValueParam": {
          "type": "string"
        },
        "dependencies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema1"
          }
        },
        "description": {
          "type": "string"
        },
        "dynamicTaskNameParam": {
          "type": "string"
        },
        "joinMode": {
          "type": "string"
        },
        "permissive": {
          "type": "boolean"
        },
        "joinTaskRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "forkTaskRef": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "name",
        "taskReferenceName",
        "type"
      ],
      "additionalProperties": false
    },
    "__schema1": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema1"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema1"
          }
        }
      ]
    }
  },
  "$id": "https://schemas.infmonkeys.com/contracts/conductor-workflow-definition.schema.json",
  "title": "conductor-workflow-definition"
}
