{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/1password/json-schema/1password-workflow-run-page-schema.json",
  "title": "WorkflowRunPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/1password-workflows-api-openapi.yml#/components/schemas/WorkflowRunPage",
  "type": "object",
  "properties": {
    "next": {
      "type": "string",
      "description": "The URL of the next page of results. Absent when there are no more results."
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowRun"
      },
      "description": "The page of results."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "FlowApp": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The application's unique ID."
        },
        "name": {
          "type": "string",
          "description": "The application's name."
        }
      },
      "additionalProperties": false
    },
    "FlowAppUser": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The application account's unique ID."
        },
        "appId": {
          "type": "string",
          "description": "The ID of the application the account belongs to."
        },
        "appName": {
          "type": "string",
          "description": "The name of the application the account belongs to."
        },
        "appInstanceName": {
          "type": "string",
          "description": "The instance name of the application, if it has one."
        },
        "userId": {
          "type": "string",
          "description": "The ID of the SaaS Manager user the account is matched to."
        },
        "userName": {
          "type": "string",
          "description": "The account's user name."
        },
        "userEmail": {
          "type": "string",
          "description": "The account's email address."
        },
        "primaryExternalId": {
          "type": "string",
          "description": "The account's primary external ID, as held by the application."
        },
        "primaryExternalEmail": {
          "type": "string",
          "description": "The account's primary external email address, as held by the application."
        }
      },
      "additionalProperties": false
    },
    "FlowItemScope": {
      "type": "object",
      "properties": {
        "person": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowPerson"
            }
          ],
          "description": "The single person the run operates on, if any."
        },
        "people": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowPerson"
          },
          "description": "The set of people the run operates on, if any."
        },
        "app": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowApp"
            }
          ],
          "description": "The single application the run operates on, if any."
        },
        "apps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowApp"
          },
          "description": "The set of applications the run operates on, if any."
        },
        "appUser": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowAppUser"
            }
          ],
          "description": "The single application account the run operates on, if any."
        },
        "appUsers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlowAppUser"
          },
          "description": "The set of application accounts the run operates on, if any."
        },
        "task": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowTask"
            }
          ],
          "description": "The task the run operates on, if any."
        },
        "variables": {
          "type": "object",
          "additionalProperties": {},
          "description": "The requested workflow variable values, keyed by variable ID. Only returned for variables named in the \"variables\" query parameter."
        }
      },
      "additionalProperties": false
    },
    "FlowPerson": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The person's unique ID."
        },
        "name": {
          "type": "string",
          "description": "The person's full name."
        },
        "firstName": {
          "type": "string",
          "description": "The person's first name."
        },
        "lastName": {
          "type": "string",
          "description": "The person's last name."
        },
        "email": {
          "type": "string",
          "description": "The person's email address."
        },
        "employeeId": {
          "type": "string",
          "description": "The person's employee ID."
        },
        "location": {
          "type": "string",
          "description": "The person's location."
        },
        "jobTitle": {
          "type": "string",
          "description": "The person's job title."
        },
        "team": {
          "type": "string",
          "description": "The person's team."
        },
        "startDate": {
          "type": "string",
          "description": "The person's start date.",
          "format": "date-time"
        },
        "leavingDate": {
          "type": "string",
          "description": "The person's leaving date.",
          "format": "date-time"
        },
        "lineManager": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonInfoFlow"
            }
          ],
          "description": "The person's line manager."
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {},
          "description": "Custom field values, keyed by the field's name."
        }
      },
      "additionalProperties": false
    },
    "FlowTask": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The task's unique ID."
        },
        "taskTypeId": {
          "type": "string",
          "description": "The ID of the task's type."
        },
        "appliesToType": {
          "type": "string",
          "description": "What the task applies to, e.g. \"Vendor\", \"Application\", \"User\", \"Nothing\"."
        },
        "appliesToItemId": {
          "type": "string",
          "description": "The ID of the item the task applies to."
        },
        "status": {
          "type": "string",
          "description": "The task's status."
        },
        "appliesToItemName": {
          "type": "string",
          "description": "The name of the item the task applies to."
        },
        "title": {
          "type": "string",
          "description": "The task's title."
        },
        "description": {
          "type": "string",
          "description": "The task's description."
        },
        "owner": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonInfoFlow"
            }
          ],
          "description": "The task's owner."
        },
        "assignedTo": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonInfoFlow"
            }
          ],
          "description": "The person the task is assigned to."
        },
        "dueDate": {
          "type": "string",
          "description": "The task's due date.",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "PersonInfoFlow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "personType": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonValueType"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "PersonValueType": {
      "enum": [
        "Contact",
        "User"
      ],
      "type": "string"
    },
    "StepCompletedResult": {
      "type": "object",
      "properties": {
        "dtm": {
          "type": "string",
          "description": "When the step completed (UTC).",
          "format": "date-time"
        },
        "nextStepIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the steps that run next."
        },
        "newContext": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowItemScope"
            }
          ],
          "description": "The run context after the step completed, if the step changed it."
        }
      },
      "additionalProperties": false
    },
    "StepFailedResult": {
      "type": "object",
      "properties": {
        "dtm": {
          "type": "string",
          "description": "When the step failed (UTC).",
          "format": "date-time"
        },
        "message": {
          "type": "string",
          "description": "The failure message."
        }
      },
      "additionalProperties": false
    },
    "StepWaitingAction": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The signal's name, e.g. \"Approve\" or \"Reject\"."
        },
        "href": {
          "type": "string",
          "description": "The URL to POST to in order to fire this signal and continue the run."
        }
      },
      "additionalProperties": false
    },
    "StepWaitingResult": {
      "type": "object",
      "properties": {
        "dtm": {
          "type": "string",
          "description": "When the step started waiting (UTC).",
          "format": "date-time"
        },
        "until": {
          "type": "string",
          "description": "If the step is waiting on a timer, when it will resume (UTC).",
          "format": "date-time"
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StepWaitingAction"
          },
          "description": "The signals that can be fired on this step to make the run continue."
        }
      },
      "additionalProperties": false
    },
    "UserInfoFlow": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WorkflowRun": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The run's unique ID."
        },
        "name": {
          "type": "string",
          "description": "The run's name."
        },
        "status": {
          "enum": [
            "InProgress",
            "Waiting",
            "Failed",
            "Completed",
            "Terminated"
          ],
          "type": "string",
          "description": "The run's status."
        },
        "createdBy": {
          "allOf": [
            {
              "$ref": "#/$defs/UserInfoFlow"
            }
          ],
          "description": "The user who created (started) the run."
        },
        "createdDtm": {
          "type": "string",
          "description": "When the run was created (UTC).",
          "format": "date-time"
        },
        "deleted": {
          "type": "boolean",
          "description": "Whether the run has been deleted. Deleted runs are excluded unless the filter references this field."
        },
        "lastModifiedDtm": {
          "type": "string",
          "description": "When the run was last modified (UTC).",
          "format": "date-time"
        },
        "context": {
          "allOf": [
            {
              "$ref": "#/$defs/FlowItemScope"
            }
          ],
          "description": "The context (the people, applications, accounts, task and variables) the run operates on."
        },
        "waitingUntilDtm": {
          "type": "string",
          "description": "If the run is waiting, the time it is waiting until (UTC).",
          "format": "date-time"
        },
        "trigger": {
          "allOf": [
            {
              "$ref": "#/$defs/WorkflowRunStep"
            }
          ],
          "description": "The trigger step's state for this run."
        },
        "steps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowRunStep"
          },
          "description": "The state of each step in the run."
        }
      },
      "additionalProperties": false
    },
    "WorkflowRunStep": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The step's unique ID."
        },
        "type": {
          "type": "string",
          "description": "The step type, e.g. \"SendEmail\", \"Wait\", \"SetAppStatus\"."
        },
        "name": {
          "type": "string",
          "description": "The step's name."
        },
        "status": {
          "enum": [
            "NotStarted",
            "InProgress",
            "Waiting",
            "Failed",
            "Completed",
            "Skipped",
            "SkippedWithError"
          ],
          "type": "string",
          "description": "The step's status."
        },
        "completed": {
          "allOf": [
            {
              "$ref": "#/$defs/StepCompletedResult"
            }
          ],
          "description": "Present when the step has completed; details of the result."
        },
        "waiting": {
          "allOf": [
            {
              "$ref": "#/$defs/StepWaitingResult"
            }
          ],
          "description": "Present when the step is waiting; details of what it is waiting for."
        },
        "failed": {
          "allOf": [
            {
              "$ref": "#/$defs/StepFailedResult"
            }
          ],
          "description": "Present when the step has failed; details of the failure."
        }
      },
      "additionalProperties": false
    }
  }
}