{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/fusio/main/json-schema/fusio-backend-cronjob-schema.json",
  "title": "Backend_Cronjob",
  "description": "This object represents a cronjob which can invoke an action at a specific interval",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fusio-cronjob-api-openapi.yml#/components/schemas/Backend_Cronjob",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier for the object",
      "type": "integer"
    },
    "name": {
      "description": "Unique name of the object",
      "type": "string"
    },
    "cron": {
      "description": "The cron expression i.e. */5 * * * * for every 5 minutes",
      "type": "string"
    },
    "action": {
      "description": "The target action which gets invoked",
      "type": "string"
    },
    "executeDate": {
      "description": "The last execution date",
      "type": "string",
      "format": "date-time"
    },
    "exitCode": {
      "description": "The last exit code",
      "type": "integer"
    },
    "metadata": {
      "$ref": "#/$defs/Common_Metadata"
    },
    "errors": {
      "description": "Contains an array of errors in case the cronjob has failed",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Backend_CronjobError"
      }
    }
  },
  "$defs": {
    "Backend_CronjobError": {
      "description": "Represents an error which occurred on cronjob execution",
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "trace": {
          "type": "string"
        },
        "file": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        }
      }
    },
    "Common_Metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}