{
  "$defs": {
    "ControlDestination": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id for the source node",
          "title": "Id"
        }
      },
      "title": "ControlDestination",
      "type": "object"
    },
    "ControlEdge": {
      "properties": {
        "$type": {
          "const": "ControlEdge",
          "default": "ControlEdge",
          "title": "$Type",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A brief description about workflow or a its respective node",
          "title": "Description"
        },
        "destinations": {
          "description": "Destinations of the node",
          "items": {
            "$ref": "#/$defs/ControlDestination"
          },
          "title": "Destinations",
          "type": "array"
        },
        "id": {
          "description": "The unique identifier",
          "title": "Id",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/ControlSource",
          "description": "Source of the node"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The title about workflow or a its respective node",
          "title": "Title"
        }
      },
      "required": [
        "id",
        "source",
        "destinations"
      ],
      "title": "ControlEdge",
      "type": "object"
    },
    "ControlSource": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id for the source node",
          "title": "Id"
        }
      },
      "title": "ControlSource",
      "type": "object"
    },
    "DataDestination": {
      "properties": {
        "dataslot": {
          "description": "The input data slot name on the source node",
          "title": "Dataslot",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id for the source node",
          "title": "Id"
        }
      },
      "required": [
        "dataslot"
      ],
      "title": "DataDestination",
      "type": "object"
    },
    "DataEdge": {
      "properties": {
        "$type": {
          "const": "DataEdge",
          "default": "DataEdge",
          "title": "$Type",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A brief description about workflow or a its respective node",
          "title": "Description"
        },
        "destinations": {
          "description": "Destinations of the node",
          "items": {
            "$ref": "#/$defs/DataDestination"
          },
          "title": "Destinations",
          "type": "array"
        },
        "id": {
          "description": "The unique identifier",
          "title": "Id",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/DataSource",
          "description": "Source of the node"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The title about workflow or a its respective node",
          "title": "Title"
        }
      },
      "required": [
        "id",
        "source",
        "destinations"
      ],
      "title": "DataEdge",
      "type": "object"
    },
    "DataSource": {
      "properties": {
        "dataslot": {
          "description": "The output data slot name on the source node",
          "title": "Dataslot",
          "type": "string"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id for the source node",
          "title": "Id"
        }
      },
      "required": [
        "dataslot"
      ],
      "title": "DataSource",
      "type": "object"
    },
    "Retry": {
      "properties": {
        "delay": {
          "default": 10,
          "description": "Delay in seconds between retry attempts",
          "title": "Delay",
          "type": "integer"
        },
        "maxAttempts": {
          "default": 1,
          "description": "The maximum number of retry attempts",
          "title": "Maxattempts",
          "type": "integer"
        }
      },
      "title": "Retry",
      "type": "object"
    },
    "VariableDefinition": {
      "additionalProperties": false,
      "properties": {
        "comment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "User comment",
          "title": "Comment"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "",
          "description": "Variable name intended for humans",
          "title": "Display Name"
        },
        "name": {
          "description": "Variable name",
          "title": "Name",
          "type": "string"
        },
        "value": {
          "description": "Value of the variable",
          "title": "Value"
        },
        "variable_type": {
          "$ref": "#/$defs/VariableTypes",
          "description": "The type of this variable, 'string', 'number', 'boolean'"
        }
      },
      "required": [
        "name",
        "value",
        "variable_type"
      ],
      "title": "VariableDefinition",
      "type": "object"
    },
    "VariableTypes": {
      "enum": [
        "string",
        "number",
        "boolean"
      ],
      "title": "VariableTypes",
      "type": "string"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A brief description about workflow or a its respective node",
      "title": "Description"
    },
    "edges": {
      "description": "A list of edges connecting the nodes",
      "items": {
        "discriminator": {
          "mapping": {
            "ControlEdge": "#/$defs/ControlEdge",
            "DataEdge": "#/$defs/DataEdge"
          },
          "propertyName": "$type"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/DataEdge"
          },
          {
            "$ref": "#/$defs/ControlEdge"
          }
        ]
      },
      "title": "Edges",
      "type": "array"
    },
    "id": {
      "description": "The unique identifier",
      "title": "Id",
      "type": "string"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "The metadata of the workflow",
      "title": "Metadata",
      "type": "object"
    },
    "nodes": {
      "description": "A list of nodes in the workflow",
      "items": {
        "discriminator": {
          "mapping": {},
          "propertyName": "type_"
        },
        "oneOf": []
      },
      "title": "Nodes",
      "type": "array"
    },
    "retry": {
      "$ref": "#/$defs/Retry",
      "description": "The retry mechanism for the workflow"
    },
    "tags": {
      "description": "Tags associated with the workflow",
      "items": {
        "type": "string"
      },
      "title": "Tags",
      "type": "array"
    },
    "timeout": {
      "anyOf": [
        {
          "format": "duration",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The global timeout for the entire workflow",
      "title": "Timeout"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The title about workflow or a its respective node",
      "title": "Title"
    },
    "variables": {
      "description": "Variables associated with the workflow with default values",
      "items": {
        "$ref": "#/$defs/VariableDefinition"
      },
      "title": "Variables",
      "type": "array"
    },
    "version": {
      "description": "The version of the workflow",
      "title": "Version",
      "type": "string"
    }
  },
  "required": [
    "id",
    "version",
    "retry",
    "tags",
    "nodes",
    "edges"
  ],
  "title": "Workflow",
  "type": "object"
}
