{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/withverifa-com/json-schema/withverifa-com-workflow-detail-schema.json",
  "title": "WorkflowDetail",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/withverifa-com-openapi.yml#/components/schemas/WorkflowDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "version": {
      "type": "integer"
    },
    "step_count": {
      "type": "integer",
      "description": "Number of steps in the workflow."
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowStep"
      },
      "description": "Ordered list of workflow steps."
    },
    "is_default": {
      "type": "boolean"
    },
    "is_active": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "data_requirements": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "description": "Any type"
      },
      "description": "Data requirements configuration for this workflow. Keys: selfie (bool), document ({enabled, accepted_types} — set enabled to false for document-free selfie-only workflows; requires selfie true), user_info ({enabled, fields, required_fields, verify_phone, verify_email}), proof_of_address ({enabled, accepted_types} — accepted_types holds PoaDocumentType keys; leave it empty to accept everything the organization's proof-of-address policy allows)."
    },
    "format": {
      "$ref": "#/$defs/WorkflowDetailFormat",
      "description": "Workflow format — \"steps\" for legacy array format, \"graph\" for DAG format."
    },
    "graph": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "description": "Any type"
      },
      "description": "DAG graph representation of the workflow. Present when format is \"graph\". Contains \"nodes\" (dict of node objects) and \"entry\" (start node ID)."
    },
    "purpose": {
      "$ref": "#/$defs/WorkflowDetailPurpose",
      "description": "What the workflow is used for. Used by consortium matching to apply purpose-aware scoring — e.g., financial aid matches are scored higher than enrollment matches."
    },
    "compliance_level": {
      "$ref": "#/$defs/WorkflowDetailComplianceLevel",
      "description": "Compliance standard enforced on this workflow. \"ial2\" enforces NIST SP 800-63-3 identity proofing requirements."
    }
  },
  "required": [
    "id",
    "name",
    "version",
    "steps",
    "is_default",
    "is_active",
    "created_at"
  ],
  "$defs": {
    "WorkflowDetailComplianceLevel": {
      "type": "string",
      "enum": [
        "ial2"
      ],
      "description": "Compliance standard enforced on this workflow. \"ial2\" enforces NIST SP 800-63-3 identity proofing requirements.",
      "title": "WorkflowDetailComplianceLevel"
    },
    "WorkflowDetailFormat": {
      "type": "string",
      "enum": [
        "steps",
        "graph"
      ],
      "default": "steps",
      "description": "Workflow format — \"steps\" for legacy array format, \"graph\" for DAG format.",
      "title": "WorkflowDetailFormat"
    },
    "WorkflowDetailPurpose": {
      "type": "string",
      "enum": [
        "general_kyc",
        "enrollment_precheck",
        "financial_aid_precheck",
        "disbursement_reverification",
        "employee_onboarding",
        "age_verification",
        "online_proctoring",
        "account_recovery"
      ],
      "description": "What the workflow is used for. Used by consortium matching to apply purpose-aware scoring — e.g., financial aid matches are scored higher than enrollment matches.",
      "title": "WorkflowDetailPurpose"
    },
    "WorkflowStep": {
      "type": "object",
      "properties": {
        "policy": {
          "type": "string",
          "description": "Policy identifier for this step."
        },
        "label": {
          "type": "string",
          "description": "Human-readable step label."
        },
        "config": {
          "type": "object",
          "additionalProperties": {
            "description": "Any type"
          },
          "description": "Step-specific configuration parameters."
        },
        "on_fail": {
          "type": "string",
          "description": "Action when this step fails. One of `review`, `reject`, `continue`, or `goto:<policy>` to jump to another step (forward only).\n"
        },
        "on_error": {
          "type": "string",
          "description": "Deprecated. Errors are automatically retried and routed to review. This field is accepted for backward compatibility but ignored.\n",
          "deprecated": true
        },
        "on_pass": {
          "type": [
            "string",
            "null"
          ],
          "description": "Action when this step passes. Either `continue` (default — advance to next step) or `goto:<policy>` to skip ahead. Null means continue.\n"
        }
      },
      "required": [
        "policy",
        "label"
      ],
      "title": "WorkflowStep"
    }
  }
}