{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-workflow-update-schema.json",
  "title": "WorkflowUpdate",
  "description": "Sparse PATCH body (`store::workflows::WorkflowUpdate` + plaintext `credentials`). Absent fields are untouched. `is_active` is accepted but silently ignored by the handler.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/writ-agent.yaml#/components/schemas/WorkflowUpdate",
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "workflow_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "steps": {
      "description": "JSON value or JSON string."
    },
    "raw_replay": {
      "description": "JSON value or JSON string."
    },
    "form_data": {
      "description": "JSON value or JSON string."
    },
    "exit_condition": {
      "description": "JSON value or JSON string."
    },
    "input_rules": {
      "description": "JSON value or JSON string."
    },
    "api_functions": {
      "description": "JSON value or JSON string."
    },
    "streaming_config": {
      "description": "JSON value or JSON string."
    },
    "functions": {
      "description": "JSON value or JSON string."
    },
    "credentials_encrypted": {
      "type": [
        "string",
        "null"
      ]
    },
    "entry_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "timeout_ms": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "retry_count": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "headless": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "fast_mode": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "is_active": {
      "type": [
        "boolean",
        "integer",
        "null"
      ],
      "description": "Ignored — deactivation is retired; delete is the only removal."
    },
    "is_verified": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "schedule_enabled": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "schedule_interval_ms": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "description": "Floored to the 60s scheduler minimum when set."
    },
    "schedule_kind": {
      "type": [
        "string",
        "null"
      ]
    },
    "schedule_time": {
      "type": [
        "string",
        "null"
      ]
    },
    "schedule_days": {
      "description": "ISO weekday ints (weekly) — a JSON array (or JSON string)."
    },
    "schedule_tz": {
      "type": [
        "string",
        "null"
      ]
    },
    "session_persistence": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "session_ttl_seconds": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "login_url_patterns": {
      "description": "JSON value or JSON string."
    },
    "relogin_max_retries": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "default_persona_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "estimated_duration_ms": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "cloud_callable": {
      "type": [
        "boolean",
        "integer",
        "null"
      ]
    },
    "execution_target": {
      "type": [
        "string",
        "null"
      ],
      "description": "`local` | `cloud` | `\"\"` to clear back to Auto."
    },
    "credentials": {
      "type": [
        "object",
        "null"
      ],
      "description": "PLAINTEXT credential map, sealed handler-side (replaces the stored blob).",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}