{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mobster.dev/schema/webhooks/run.started.json",
  "title": "A task started",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "runId",
    "startedAt",
    "workflow",
    "text"
  ],
  "properties": {
    "type": {
      "const": "run.started",
      "description": "The event, as the Mobster-Event header names it."
    },
    "runId": {
      "type": "string",
      "description": "The task's id."
    },
    "startedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "UTC, ISO 8601. Null when unknown."
    },
    "workflow": {
      "anyOf": [
        {
          "type": "object",
          "description": "The workflow the task ran from. Null for a task you started yourself.",
          "additionalProperties": false,
          "required": [
            "id",
            "name",
            "blanks"
          ],
          "properties": {
            "id": {
              "type": [
                "string",
                "null"
              ],
              "description": "The workflow's id."
            },
            "name": {
              "type": "string",
              "description": "The workflow's name."
            },
            "blanks": {
              "type": "object",
              "description": "Each blank's value, by the blank's name."
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "text": {
      "type": "string",
      "description": "One line for chat tools: Mobster: …, or Mobster › <workflow>: …"
    }
  }
}
