{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mobilerun-ai/json-schema/mobilerun-ai-update-flow-body-schema.json",
  "title": "UpdateFlowBody",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mobilerun-ai-openapi.json#/components/schemas/UpdateFlowBody",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "description": {
      "type": "string",
      "maxLength": 2048
    },
    "triggerId": {
      "type": "string",
      "format": "uuid"
    },
    "enabled": {
      "type": "boolean"
    },
    "lifecycleStatus": {
      "type": "string",
      "enum": [
        "enabled",
        "disabled"
      ],
      "description": "Set the visible agent lifecycle. Archive remains available only through DELETE."
    },
    "deviceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 256
    },
    "cooldownSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "cooldownScope": {
      "$ref": "#/$defs/CooldownScope"
    },
    "notifyWebhookId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "notifyOnSuccess": {
      "type": "boolean"
    },
    "notifyOnFailure": {
      "type": "boolean"
    },
    "ownerWake": {
      "$ref": "#/$defs/OwnerWake"
    },
    "healthMonitoringEnabled": {
      "type": "boolean"
    },
    "selfHealingEnabled": {
      "type": "boolean"
    },
    "selfHealingMaxAttempts": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "recordingEnabled": {
      "type": "boolean",
      "deprecated": true,
      "description": "Deprecated compatibility field. true maps to recordingPolicy.mode=\"flow\"; false maps to \"off\"."
    },
    "recordingPolicy": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/$defs/RecordingPolicyMode"
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false
    },
    "delivery": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "destination": {
          "type": "string",
          "enum": [
            "mobilerun",
            "one_drive",
            "google_drive"
          ]
        },
        "folder": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "description": "Absolute destination folder; not allowed when destination is mobilerun. May contain {{meta.<name>}} (for example {{meta.shortDate}} = YYMMDD, {{meta.fileTime}} = HH-mm, in the trigger timezone) and {{event.payload.<field>}} placeholders, resolved once per run so every artifact of that run lands in the same folder. Each substituted value must be a single safe folder name (no \"/\", \"\\\", \"..\", control characters); otherwise delivery fails with invalid_delivery_folder. With a placeholder folder, screenshots are delivered directly into the resolved folder; with a static folder they go into a per-run \"<flow>-<timestamp>-<id>-screenshots\" subfolder."
        },
        "recording": {
          "type": "object",
          "properties": {
            "filename": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          "required": [
            "filename"
          ],
          "additionalProperties": false
        },
        "screenshots": {
          "type": "object",
          "properties": {},
          "additionalProperties": false
        }
      },
      "required": [
        "destination"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "CooldownScope": {
      "type": "string",
      "enum": [
        "flow",
        "device"
      ]
    },
    "OwnerWake": {
      "type": "string",
      "enum": [
        "final",
        "off"
      ],
      "default": "final"
    },
    "RecordingPolicyMode": {
      "type": "string",
      "enum": [
        "off",
        "flow",
        "selected_steps"
      ]
    }
  }
}