openapi: 3.0.0
servers:
  - url: 'https://api.devbank.apiture.com/workflow'
info:
  title: Workflow
  description: |
    The workflow API allows definition and execution of workflows. A _workflow_ is a set of tasks in a
    dependency graph, with state and business rules which connect and constrain the execution of the workflow
    tasks. Each workflow maintains some state. Each task in the workflow has entry criteria, input variables,
    and output variables. A task may be a composite task, built from another workflow. (This allows for reuse of
    such subflows.)


    Each task and workflow has the following data:

     * `domain`, `name`, `label`, `description` (descriptive information)
     * A set of `values` (a map of name/value pairs) based on a `schema`
     * A `state` field, one of `definition`, `pending`, `blocked`, `running`, `paused`, `failed`,
       `completed`, `canceled`. The default state is `running` (or
      `blocked` if no tasks are runnable)
     * A `done` field is `true` if the state is one of those last three states.
     * A list of `bindings` which connect workflow state `values` or the outputs
       of previous tasks to the inputs of dependent tasks.


    Some changes to the `state` of a workflow item is managed by the service. Clients can change some states via
    links in a task instance or workflow instance, via a `PUT` (operations `updateWorkflowValues`,
    `updateWorkflowValue`, `updateTaskValues` and `updateTaskValue`).


    A workflow orchestrates a set of tasks and contains additional data:

     * `dependencies`, which maps each task to a set of 0 or more
       dependent tasks that trigger the task when they are `completed`.
     * Entry criteria for each dependent task may also include a business
       `rule` which must evaluate to `true`. The rules can access the
       input values on the task as well as the workflow's values.
       The default business rule tests that any dependent task is `completed`.

    Tasks in a workflow which have no predecessor tasks and whose entry criteria
    rule evaluate to `true` may be run immediately.


    Workflows are _static_: once a workflow has been created, tasks cannot be
    added or removed from the workflow and the task dependency graph may not be
    changed.

    ## Workflow execution

    Several operations change the execution state of workflow or task instances.
    Use the `startWorkflow`, `pauseWorkflow`, `cancelWorkflow`,
    `failWorkflow` operations to start a workflow, pause it, cancel
    it, or set it to a failed state. (Use `startWorkflow` to resume a paused workflow.)
    The `startTask`, `pauseTask`, `cancelTask`,
    `failTask` operations do the same for task instances.
    These operations are provided via links named `apiture:start`, `apiture:pause`, `apiture:cancel`,
    and `apiture:fail` in the `workflow` and `task` schemas, if the operations
    are available.


    A workflow is `done` when the `state` of all its tasks are `done`, _or_ if
    the workflow has one or more _terminal_ tasks that are `done`, or if the workflow
    is in a `failed` state. If a terminal
    task completes, causing the workflow to complete, any remaining tasks are `canceled`.
    This allows business rules and flow to define the completion criteria, for
    example, three of four tasks completed instead all four.


    ## Workflow and Task Definitions

    Workflow _definitions_ are workflows with a `state` of `definition`; the
    tasks in a workflow definition are also tasks with `state` equal to
    `definition`. Definitions act as workflow templates: one creates new
    workflow instances by specifying an existing workflow definition. This also
    creates new task instances from each task definition. The workflow and all
    tasks' `state` is set to `blocked` with the exception of tasks that do not
    have dependent tasks (`initial` is `true`).


    Workflow definitions may have cycles. That is, some tasks may be entered
    again, effectively restarting those tasks.

    ## Workflow revisions

    Workflow definitions and task definitions also retain a _revision history_, available in the definition's
    `revisions` collection. New revisions are created via a `POST` operation to a definition's `revisions`
    collection (see the `createWorkflowDefinitionRevision` and `createTaskDefinitionRevision` operations).
    Revisions are immutable copies of the resource which preserve or record the definition's data at the point
    in time that the revision was created. This allows preserving specific behavior of a workflow when after
    changing the definition.


    For example, a specific revision of a workflow definition (using the revision URI,
    `/workflowDefinitions/{workflowDefinitionId}/revisions/{revisionId}`) may be associated with other resources
    (such as banking products) so that the specific revision can be instantiated as a new workflow, rather than
    instantiating the currently active, revisionless definition found at
    `/workflowDefinitions/{workflowDefinitionId}`.


    Revisions also support auditing: the immutable revision is a record of which
    workflow was used and its initial state. A workflow definition may reference
    either a specific revision of the embedded task definitions, or
    _revisionless_ task definitions; this determines which task definition (a
    specific revision or the most recent revision) is used for all the tasks in
    that workflow when that definition is used to create a new workflow
    instance. A reference to a revisionless task definition URL matches the URL
    pattern `/workflow/taskDefinitions/{taskDefinitionId}`; a task definition
    revision instance has a URL pattern
    `/workflow/taskDefinitions/{taskDefinitionId}/revisions/{revisionId}` where
    revisionId is an [RFC 3339](https://tools.ietf.org/html/rfc3339) format
    timestamp:  `YYYY-MM-DDThh:mm:ss.sssZ`.


    ## Error handling


    If a workflow task fails, the service sets its `state` to `failed`. If the task has an `errorTask` defined,
    the workflow starts that task; it is included in the `/runningTasks`. The error task may be an interactive
    or hidden task. This allows the workflow to restart a sequence of tasks, for example, to let the user retry
    an operation that may fail. (The error task should be `restartable`.) The workflow may also define an
    `errorTask` which the workflow starts if the failed task does not define its own `errorTask`. If the error
    task is a terminal state, the workflow sets it's `state` to `failed`. The `errorTask` for a workflow or a
    workflow task is initialized from the same property of the workflow definition or a workflow task
    definition.

    # Error Types

    Error responses in this API may have one of the `type` values described below.
    See [Errors](https://developer.apiture.com/docs/concepts/errors) for more information
    on error responses and error types.



    <h2 class='errorType' id="err-cannotModifyRevision">cannotModifyRevision</h2>

    **Description**: Modifying revisioned resources is not allowed. <br>
    **Remediation**: Revisioned resources are immutable, check to ensure that the supplied id does not belong to a revision.


    <h2 class='errorType' id="err-invalidTaskDefinitionId">invalidTaskDefinitionId</h2>

    **Description**: No task definitions were found for the specified taskDefinitionId. <br>
    **Remediation**: Check to make sure that the supplied taskDefinitionId corresponds to an apiture task definition resource.


    <h2 class='errorType' id="err-invalidTaskDefinitionRevisionId">invalidTaskDefinitionRevisionId</h2>

    **Description**: No task definition revisions were found for the specified task definition revisionId. <br>
    **Remediation**: Check to make sure that the supplied revisionId corresponds to an apiture task definition revision resource.


    <h2 class='errorType' id="err-invalidTaskId">invalidTaskId</h2>

    **Description**: No tasks were found for the specified taskId. <br>
    **Remediation**: Check to make sure that the supplied taskId corresponds to an apiture task resource.


    <h2 class='errorType' id="err-invalidWorkflowDefinitionId">invalidWorkflowDefinitionId</h2>

    **Description**: No workflow definitions were found for the specified workflowDefinitionId. <br>
    **Remediation**: Check to make sure that the supplied workflowDefinitionId corresponds to an apiture workflow definition resource.


    <h2 class='errorType' id="err-invalidWorkflowDefinitionRevisionId">invalidWorkflowDefinitionRevisionId</h2>

    **Description**: No workflow definition revisions were found for the specified workflow definition revisionId. <br>
    **Remediation**: Check to make sure that the supplied revisionId corresponds to an apiture workflow definition revision resource.


    <h2 class='errorType' id="err-invalidWorkflowId">invalidWorkflowId</h2>

    **Description**: No workflows were found for the specified workflowId. <br>
    **Remediation**: Check to make sure that the supplied workflowId corresponds to an apiture workflow resource.


    <h2 class='errorType' id="err-malformedRequestBody">malformedRequestBody</h2>

    **Description**: The body of the request is invalid. <br>
    **Remediation**: Check to make sure that the body of the patch request is valid JSON.


    <h2 class='errorType' id="err-nameDomainInUse">nameDomainInUse</h2>

    **Description**: The combination of name and domain must be unique across workflow definitions and task definitions. <br>
    **Remediation**: Check for existing workflow definitions or task definitions using the requested name, domain combination.


    <h2 class='errorType' id="err-taskDefinitionInUse">taskDefinitionInUse</h2>

    **Description**: Task definitions cannot be deleted if they are in use in a workflow definition. <br>
    **Remediation**: Check the existing workflow definitions to see if the requested task definition is being used.


    <h2 class='errorType' id="err-updateFailed">updateFailed</h2>

    **Description**: The update to the database object failed. <br>
    **Remediation**: Check to make sure that the object being updated has valid properties.


    <h2 class='errorType' id="err-workflowDefinitionInUse">workflowDefinitionInUse</h2>

    **Description**: Workflow definitions cannot be deleted if they are in use by other workflow or task definitions. <br>
    **Remediation**: Check the existing workflow definitions to see if the requested workflow definition is a revision.
  version: 0.21.0
  contact:
    name: Apiture
    url: 'https://developer.apiture.com'
    email: api@apiture.com
  termsOfService: 'https://developer.apiture.com/docs/Apiture-Open-API-License-Agreement.pdf'
tags:
  - name: Workflow Definition
    description: Workflow Definitions
  - name: Workflow
    description: Workflows
  - name: Task Definition
    description: Workflow Task Definitions
  - name: Task
    description: Workflow Tasks
  - name: API
    description: Endpoints which describe this API
paths:
  /tasks:
    get:
      summary: Return a collection of tasks
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of tasks. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getTasks
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task
      x-apiture-traits:
        sortBy:
          - state
          - name
          - domain
          - type
          - label
        itemSchema: Task
        filters:
          state:
            filter:
              - eq
              - ne
              - in
          name:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          domain:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          type:
            filter:
              - eq
              - ne
              - in
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first task item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of task representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `state`<br>&bullet; `name`<br>&bullet;
            `domain`<br>&bullet; `type`<br>&bullet; `label`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `state` using functions `eq`,  `ne`,  `in`<br>&bullet;  Property `name` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `domain` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `type` using
            functions `eq`,  `ne`,  `in`<br>&bullet;  Property `label` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using functions `eq`,  `in`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/stateQueryParam'
        - $ref: '#/components/parameters/nameQueryParam'
        - $ref: '#/components/parameters/domainQueryParam'
        - $ref: '#/components/parameters/typeQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/tasks'
            application/json:
              schema:
                $ref: '#/components/schemas/tasks'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new task
      description: 'Create a new task in the tasks collection. '
      operationId: createTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - name: definition
          required: false
          in: query
          description: >-
            A server-supplied value which identifies the task definition instance from which this new task will be created. The request body is
            ignored when this parameter is used.
          schema:
            type: string
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '400':
          $ref: '#/components/responses/400'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createTask'
          application/json:
            schema:
              $ref: '#/components/schemas/createTask'
        description: The data necessary to create a new task.
        required: true
  '/tasks/{taskId}':
    get:
      summary: Fetch a representation of this task
      description: 'Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this task resource.'
      operationId: getTask
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404Task'
    put:
      summary: Update this task
      description: Perform a complete replacement of this task.
      operationId: updateTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404Task'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/task'
          application/json:
            schema:
              $ref: '#/components/schemas/task'
        required: true
    delete:
      summary: Delete this task resource
      description: Delete this task resource and any resources that are owned by it.
      operationId: deleteTask
      security:
        - apiKey: []
          accessToken:
            - data/delete
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/taskIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '412':
          $ref: '#/components/responses/412'
  '/tasks/{taskId}/values':
    get:
      summary: Fetch the runtime values associated with this task
      description: |-
        Fetch the runtime values associated with this task. This provides
        convenient access to the map of `values` of the task, including the
        inputs and outputs.


        Use the `PUT /tasks/{taskId}/values` operation
        to update the values, or to update a specific value, use `PUT
        /tasks/{taskId}/values/{valueName}`.
      operationId: getTaskValues
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/404Task'
        '412':
          $ref: '#/components/responses/412'
    put:
      summary: Update the runtime values associated with this task
      description: |-
        Update the runtime values associated with this task. This provides
        convenient access to the map of `values` of the task, including the
        inputs and outputs. This map only contains values defined in the task's
        `schema`.  The request body must include _all_ values obtained from the
        `GET` operation, and the values must conform to the task's schema. This
        operation is idempotent.


        To update a specific value, use `PUT
        /tasks/{taskId}/values/{valueName}` (operation `updateTaskValue`).
      operationId: updateTaskValues
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404Task'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/attributes'
          application/json:
            schema:
              $ref: '#/components/schemas/attributes'
        required: true
  '/tasks/{taskId}/values/{valueName}':
    get:
      summary: Fetch a single runtime value associated with this task
      description: |-
        Fetch a single runtime value associated with this task. This provides
        convenient access to the map of `values` of the task, including the
        inputs and outputs.  This map does **not** include the tasks and their
        values, or values from nested workflows; it only contains values defined
        in the task's `schema`.


        To update a specific value, use `PUT
        /tasks/{taskId}/values/{valueName}` (operation `updateTaskValue`).
      operationId: getTaskValue
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
        - $ref: '#/components/parameters/valueNamePathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/404Task'
    put:
      summary: Update the runtime values associated with this task
      description: |-
        Update a single runtime value associated with this task. This provides
        convenient access to individual `values` of the task as defined in the
        task's `schema`. The request body must conform to  the task's schema
        for the named `{valueName}`. This operation is idempotent.


        To update a specific value, use `PUT /workflows/{workflowId}/values/{valueName}`.
      operationId: updateTaskValue
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskIdPathParam'
        - $ref: '#/components/parameters/valueNamePathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/attributes'
          application/json:
            schema:
              $ref: '#/components/schemas/attributes'
        required: true
  /runningTasks:
    post:
      summary: 'Start, restart, or resume a workflow task'
      description: >-
        Change the `state` of a workflow to `running`. This is allowed if the state is `paused`. If the task is restartable, this is also allowed if
        the state is `failed`, `completed`, or `canceled`. There is no request body on this operation; the task is passed as a query parameter,
        `?task=`. This operation is invoked from the `apiture:start` link on a task; the link is present if the operation is allowed. This operation
        may also affect the state of the workflow in which the task instance resides.           This operation is not allowed on a task definition.
      operationId: startTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
  /pausedTasks:
    post:
      summary: Pause a workflow task
      description: >-
        Change the `state` of a workflow to `paused`. This is allowed if the state is `running`.  There is no request body on this operation; the task
        is passed as a query parameter, `?task=`. This operation is invoked from the `apiture:pause` link on a task; the link is present if the
        operation is allowed. This operation may also affect the state of the workflow in which the task instance resides.


        This operation is not allowed on a task definition.
      operationId: pauseTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
  /canceledTasks:
    post:
      summary: Cancel a workflow task
      description: >-
        Change the `state` of a workflow to `canceled`. This is allowed if the state is `running` or `paused`. There is no request body on this
        operation; the task is passed as a query parameter, `?task=`. This operation is invoked from the `apiture:cancel` link on a task; the link is
        present if the operation is allowed. This operation may also affect the state of the workflow in which the task instance resides.


        This operation is not allowed on a task definition.
      operationId: cancelTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
  /failedTasks:
    post:
      summary: Stop a workflow task and mark it as failed
      description: >-
        Change the `state` of a workflow to `failed`. This is allowed if the state is `running` or `paused`. There is no request body on this
        operation; the task is passed as a query parameter, `?task=`. This operation is invoked from the `apiture:fail` link on a task; the link is
        present if the operation is allowed. This operation may also affect the state of the workflow in which the task instance resides.


        This operation is not allowed on a task definition.
      operationId: failTask
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task
      parameters:
        - $ref: '#/components/parameters/taskQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
  /taskDefinitions:
    get:
      summary: Return a collection of task definitions
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of task definitions. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getTaskDefinitions
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task Definition
      x-apiture-traits:
        sortBy:
          - state
          - name
          - domain
          - type
          - label
        itemSchema: Task Definition
        filters:
          state:
            filter:
              - eq
              - ne
              - in
          name:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          domain:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          type:
            filter:
              - eq
              - ne
              - in
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first task definition item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of task definition representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `state`<br>&bullet; `name`<br>&bullet;
            `domain`<br>&bullet; `type`<br>&bullet; `label`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `state` using functions `eq`,  `ne`,  `in`<br>&bullet;  Property `name` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `domain` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `type` using
            functions `eq`,  `ne`,  `in`<br>&bullet;  Property `label` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using functions `eq`,  `in`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/stateQueryParam'
        - $ref: '#/components/parameters/nameQueryParam'
        - $ref: '#/components/parameters/domainQueryParam'
        - $ref: '#/components/parameters/typeQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/tasks'
            application/json:
              schema:
                $ref: '#/components/schemas/tasks'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new task definition
      description: Create a new task definition in the task definitions collection. The `state` of the new task will be set to `definition`.
      operationId: createTaskDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task Definition
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)

            * [`nameDomainInUse`](#err-nameDomainInUse)
          x-apiture-errors:
            - malformedRequestBody
            - nameDomainInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createTask'
          application/json:
            schema:
              $ref: '#/components/schemas/createTask'
        description: The data necessary to create a new task definition.
        required: true
  '/taskDefinitions/{taskDefinitionId}':
    get:
      summary: Fetch a representation of this task definition
      description: >-
        Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this task definition resource. This resource is referred to
        as the `revisionless` task definition, in contrast to the explicit revision at `/taskDefinitions/{taskDefinitionId}/revisions/{revisionId}`.
      operationId: getTaskDefinition
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404TaskDefinition'
    put:
      summary: Update this task definition
      description: Perform a complete replacement of this task definition.
      operationId: updateTaskDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)

            * [`nameDomainInUse`](#err-nameDomainInUse)
          x-apiture-errors:
            - malformedRequestBody
            - nameDomainInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          $ref: '#/components/responses/404TaskDefinition'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/task'
          application/json:
            schema:
              $ref: '#/components/schemas/task'
        required: true
    patch:
      summary: Update this task definition
      description: >-
        Perform a partial update of this task definition. Fields which are omitted are not updated. Nested `_embedded` and `_links` are ignored if
        included.
      operationId: patchTaskDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                If supplied, the `ETag` (entity tag) response header should be in an `If-Match` request header of *`PUT`* or *`PATCH`* operations that
                update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)

            * [`cannotModifyRevision`](#err-cannotModifyRevision)
          x-apiture-errors:
            - malformedRequestBody
            - cannotModifyRevision
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          $ref: '#/components/responses/404TaskDefinition'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/task'
          application/json:
            schema:
              $ref: '#/components/schemas/task'
        required: true
    delete:
      summary: Delete this task definition resource
      description: >-
        Delete this task definition resource and any resources that are owned by it. The task definition may not be deleted if it or any of its
        revisions are in use by any tasks or workflows. Deleting a task definition also deletes all revisions.
      operationId: deleteTaskDefinition
      security:
        - apiKey: []
          accessToken:
            - data/delete
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`taskDefinitionInUse`](#err-taskDefinitionInUse)
          x-apiture-errors:
            - taskDefinitionInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '412':
          $ref: '#/components/responses/412'
  '/taskDefinitions/{taskDefinitionId}/revisions':
    get:
      summary: Return a collection of workflow task definition revisions
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of workflow task revisions. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination
        links. The revisions collection shows the modification history of the workflow task definition. Revisions are immutable.
      operationId: getTaskDefinitionRevisions
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - name: start
          in: query
          description: >-
            The zero-based index of the first workflow task revision item to include in this page. The default 0 denotes the beginning of the
            collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of workflow task representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. Revision collections are sorted by default in reverse chronological order (most recent revision first). See [sort
            criteria format](https://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.
          schema:
            type: string
        - $ref: '#/components/parameters/filterQueryParam'
        - $ref: '#/components/parameters/qQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/tasks'
            application/json:
              schema:
                $ref: '#/components/schemas/tasks'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new task definition revision
      description: >-
        Create a new immutable revision of this workflow task definition. The revision is a snapshot of the content of the definition. This operation
        has no request body. The response body is the representation of the new _revision_. This operation is ignored if the task definition has not
        changed since the last time the revision was created. Creating a revision does not alter the entity tag of the task definition.
      operationId: createTaskDefinitionRevision
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '201':
          description: OK. A new revision was created.
          headers:
            Location:
              description: >-
                The URI of the new revision. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag for the revision. This entity tag may be passed as the `If-Not-Match` on a `GET`
                request for the revision location. (This is _not_ the entity tag of the mutable definition resource.)
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '204':
          description: 'No Content. The resource has not changed since the last revision was created, and a new revision has not been created.'
  '/taskDefinitions/{taskDefinitionId}/revisions/{revisionId}':
    get:
      summary: Fetch a representation of an immutable revision of this workflow task
      description: >-
        Return an immutable [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this revision of this workflow task resource. The
        revision may also have `prev` and `next` links to previous and/or next revisions, if they exist.
      operationId: getTaskDefinitionRevision
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Task Definition
      parameters:
        - $ref: '#/components/parameters/taskDefinitionIdPathParam'
        - $ref: '#/components/parameters/revisionIdParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow task resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/task'
            application/json:
              schema:
                $ref: '#/components/schemas/task'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404Task'
        '412':
          $ref: '#/components/responses/412'
  /workflows:
    get:
      summary: Return a collection of workflows
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of workflows. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getWorkflows
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow
      x-apiture-traits:
        sortBy:
          - state
          - name
          - domain
          - type
          - label
        itemSchema: Workflow
        filters:
          state:
            filter:
              - eq
              - ne
              - in
          name:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          domain:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          type:
            filter:
              - eq
              - ne
              - in
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first workflow item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of workflow representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `state`<br>&bullet; `name`<br>&bullet;
            `domain`<br>&bullet; `type`<br>&bullet; `label`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `state` using functions `eq`,  `ne`,  `in`<br>&bullet;  Property `name` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `domain` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `type` using
            functions `eq`,  `ne`,  `in`<br>&bullet;  Property `label` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using functions `eq`,  `in`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/stateQueryParam'
        - $ref: '#/components/parameters/nameQueryParam'
        - $ref: '#/components/parameters/domainQueryParam'
        - $ref: '#/components/parameters/typeQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflows'
            application/json:
              schema:
                $ref: '#/components/schemas/workflows'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new workflow
      description: >-
        Create a new workflow instance from a workflow definition.


        The default behavior is to start the workflow automatically upon creation; initial tasks (those with no input dependencies) will be started. 
        If called with `?deferStart=true`, the workflow is _not_ started automatically but left in the `pending` state; start the workflow later with
        [`startWorkflow`](#op-startWorkflow).  Once started, the state of the new workflow may be `running` or `blocked` depending on the initial
        tasks.
      operationId: createWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - name: definition
          required: false
          in: query
          description: >-
            A server-supplied value which identifies the workflow definition instance from which this new workflow will be created. The request body
            is ignored when this parameter is used.
          schema:
            type: string
        - name: deferStart
          in: query
          description: >-
            Optionally defer starting a workflow upon creation, the default behavior is to start the workflow upon creation.  `?deferStart=true` will
            leave the workflow with a `state` of `pending`, it can be started via [`startWorkflow`](#op-startWorkflow).
          schema:
            type: boolean
            default: false
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '400':
          $ref: '#/components/responses/400'
        '404':
          description: >-
            Not Found. There is no such workflow definition resource at the specified URL. The `_error` field in the response will contain details
            about the request error.


            This error response may have one of the following `type` values:

            * [`invalidWorkflowId`](#err-invalidWorkflowId)
          x-apiture-errors:
            - invalidWorkflowId
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createWorkflow'
          application/json:
            schema:
              $ref: '#/components/schemas/createWorkflow'
        description: The data necessary to create a new workflow.
        required: true
  '/workflows/{workflowId}':
    get:
      summary: Fetch a representation of this workflow
      description: 'Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this workflow resource.'
      operationId: getWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
        - $ref: '#/components/parameters/workflowEmbedQueryParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404Workflow'
    delete:
      summary: Delete this workflow resource
      description: Delete this workflow resource and any resources that are owned by it.
      operationId: deleteWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/delete
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/workflowIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '412':
          $ref: '#/components/responses/412'
  '/workflows/{workflowId}/visibleTasks':
    get:
      summary: Fetch an ordered representation of the visible tasks within this workflow
      description: >-
        Return a collection of visible tasks for the given workflow. The result reflects the nested structure of the workflow and any tasks that are
        embedded inside nested workflows.
      operationId: getVisibleTasks
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/visibleTasks'
            application/json:
              schema:
                $ref: '#/components/schemas/visibleTasks'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404Workflow'
        '412':
          $ref: '#/components/responses/412'
  '/workflows/{workflowId}/values':
    get:
      summary: Fetch the runtime values associated with this workflow
      description: |-
        Fetch the runtime values associated with this workflow. This provides
        convenient access to the map of `values` of the workflow, including the
        inputs and outputs. This map does **not** include the tasks and their
        values, or values from nested workflows; it only contains values defined
        in the workflow's `schema`.


        Use the `PUT
        /workflows/{workflowId}/values` operation to update the values, or to
        update a specific value, use `PUT
        /workflows/{workflowId}/values/{valueName}`.
      operationId: getWorkflowValues
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/404Workflow'
    put:
      summary: Update the runtime values associated with this workflow
      description: |-
        Update the runtime values associated with this workflow. This provides
        convenient access to the map of `values` of the workflow, including the
        inputs and outputs. This map does **not** include the tasks and their
        values, or values from nested workflows; it only contains values defined
        in the workflow's `schema`. This operation is idempotent. The request
        body must include _all_ values obtained from the `GET` operation, and
        the values must conform to the workflow's schema.


        To update a
        specific value, use `PUT /workflows/{workflowId}/values/{valueName}`.
      operationId: updateWorkflowValues
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404Workflow'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/attributes'
          application/json:
            schema:
              $ref: '#/components/schemas/attributes'
        required: true
  '/workflows/{workflowId}/values/{valueName}':
    get:
      summary: Fetch a single runtime value associated with this workflow
      description: |-
        Fetch a single runtime value associated with this workflow. This
        provides convenient access to the map of `values` of the workflow,
        including the inputs and outputs.  This map does **not** include the
        tasks and their values, or values from nested workflows; it only
        contains values defined in the workflow's `schema`.


        To update a
        specific value, use `PUT /workflows/{workflowId}/values/{valueName}`
        (operation `updateWorkflowValue`).
      operationId: getWorkflowValue
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
        - $ref: '#/components/parameters/valueNamePathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/404Workflow'
    put:
      summary: Update a single runtime value associated with this workflow
      description: >-
        Update a single runtime value associated with this workflow. This provides convenient access to individual `values` of the workflow as defined
        in the workflow's `schema`. The request body must conform to the workflow's schema for the named `{valueName}`. This operation is idempotent.
      operationId: updateWorkflowValue
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowIdPathParam'
        - $ref: '#/components/parameters/valueNamePathParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/attributes'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/attributes'
          application/json:
            schema:
              $ref: '#/components/schemas/attributes'
        required: true
  /runningWorkflows:
    post:
      summary: 'Start, restart, or resume a workflow'
      description: >-
        Change the `state` of a workflow to `running`. This is allowed if the state is `pending` or `paused`. If the workflow is restartable, this is
        also allowed if the state is `failed`, `completed`, or `canceled`. There is no request body on this operation; the task is passed as a query
        parameter, `?workflow=`. This operation is invoked from the `apiture:start` link on a workflow; the link is present if the operation is
        allowed. This operation is not allowed on a workflow definition.
      operationId: startWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
  /pausedWorkflows:
    post:
      summary: Pause a workflow
      description: >-
        Change the `state` of a workflow to `paused`. This is allowed if the state is `running`.  There is no request body on this operation; the task
        is passed as a query parameter, `?workflow=`. This operation is invoked from the `apiture:pause` link on a workflow; the link is present if
        the operation is allowed. This operation will also pause all `running` tasks in the workflow. This operation is not allowed on a workflow
        definition.
      operationId: pauseWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
  /canceledWorkflows:
    post:
      summary: Cancel a workflow
      description: >-
        Change the `state` of a workflow to `canceled`. This is allowed if the state is `running` or `paused`. There is no request body on this
        operation; the task is passed as a query parameter, `?workflow=`. This operation is invoked from the `apiture:cancel` link on a workflow; the
        link is present if the operation is allowed. This operation will also cancel all `running` or `paused` tasks in the workflow. This operation
        is not allowed on a workflow definition.
      operationId: cancelWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
  /failedWorkflows:
    post:
      summary: Stop a workflow and mark it as failed
      description: >-
        Change the `state` of a workflow to `failed`. This is allowed if the state is `running` or `paused`. There is no request body on this
        operation; the task is passed as a query parameter, `?workflow=`. This operation is invoked from the `apiture:fail` link on a workflow; the
        link is present if the operation is allowed. This operation may also affect the state of the workflow in which the task instance resides.


        This operation is not allowed on a workflow definition.
      operationId: failWorkflow
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow
      parameters:
        - $ref: '#/components/parameters/workflowQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
  /workflowDefinitions:
    get:
      summary: Return a collection of workflow definitions
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of workflow definitions. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getWorkflowDefinitions
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow Definition
      x-apiture-traits:
        sortBy:
          - state
          - name
          - domain
          - type
          - label
        itemSchema: Task
        filters:
          state:
            filter:
              - eq
              - ne
              - in
          name:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          domain:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          type:
            filter:
              - eq
              - ne
              - in
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first workflow definition item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of workflow definition representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `state`<br>&bullet; `name`<br>&bullet;
            `domain`<br>&bullet; `type`<br>&bullet; `label`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `state` using functions `eq`,  `ne`,  `in`<br>&bullet;  Property `name` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `domain` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `type` using
            functions `eq`,  `ne`,  `in`<br>&bullet;  Property `label` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using functions `eq`,  `in`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/stateQueryParam'
        - $ref: '#/components/parameters/nameQueryParam'
        - $ref: '#/components/parameters/domainQueryParam'
        - $ref: '#/components/parameters/typeQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflows'
              examples:
                response:
                  value:
                    _profile: 'https://api.apiture.com/schemas/workflow/workflows/v1.1.0/profile.json'
                    start: 10
                    limit: 10
                    count: 67
                    name: workflows
                    _links:
                      self:
                        href: /workflow/workflows?start=10&limit=10
                      first:
                        href: /workflow/workflows?start=0&limit=10
                      next:
                        href: /workflow/workflows?start=20&limit=10
                      collection:
                        href: /workflow/workflows
                    _embedded:
                      items:
                        - _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
                          _profile: 'https://api.apiture.com/schemas/workflow/v1.1.0/profile.json'
                          _links:
                            self:
                              href: /workflow/workflowDefinitions/0399abed-fd3d-4830-a88b-30f38b8a365c
                          name: newAccountSelector
                          domain: 'https://api.apiture.com/acctApps'
                          label: New Account Selector
                          type: somethingElse
                          visibility: hidden
                          state: definition
                          values:
                            category: personal
                            ownership: joint
                            minimumBalanceGoal: 1000
                          description: >-
                            A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with
                            that specific product.
                          _embedded: {}
            application/json:
              schema:
                $ref: '#/components/schemas/workflows'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new workflow definition
      description: Create a new workflow definition in the workflow definitions collection.
      operationId: createWorkflowDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow Definition
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)

            * [`nameDomainInUse`](#err-nameDomainInUse)
          x-apiture-errors:
            - malformedRequestBody
            - nameDomainInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createWorkflow'
          application/json:
            schema:
              $ref: '#/components/schemas/createWorkflow'
        description: A workflow definition. The `state` must be `definition`.
        required: true
  '/workflowDefinitions/{workflowDefinitionId}':
    get:
      summary: Fetch a representation of this workflow definition
      description: >-
        Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this workflow definition resource. This resource is referred
        to as the `revisionless` workflow definition, in contrast to the explicit revision at
        `/workflowDefinitions/{workflowDefinitionId}/revisions/{revisionId}`.
      operationId: getWorkflowDefinition
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow definition resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404WorkflowDefinition'
    put:
      summary: Update this workflow definition
      description: Perform a complete replacement of this workflow definition.
      operationId: updateWorkflowDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow definition resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
              examples:
                response:
                  value:
                    _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
                    _profile: 'https://.api.apiture.com/schemas/workflow/v1.1.0/profile.json'
                    name: personalCheckingApplicationWorkflow
                    label: Personal Checking Application Workflow
                    description: Personal Checking Application Workflow
                    state: definition
                    schema:
                      applicant:
                        type: object
                        required:
                          - firstName
                          - lastName
                        properties:
                          firstName:
                            type: string
                          middleName:
                            type: string
                          lastName:
                            type: string
                    tasks:
                      personalInfoForm1:
                        domain: 'http:/api.apiture.com/domains/tasks/forms'
                        name: userForm
                        label: Personal Information
                        type: form
                        _links:
                          self:
                            href: /workflow/tasks/46913e8b-fb7f-4f31-92bf-7b263907ed95
                      accountOwnershipChoice:
                        domain: 'http:/api.apiture.com/domains/tasks/prompts'
                        name: accountOwnershipChoice
                        type: binaryChoice
                        label: Select Account Ownership Type
                        _links:
                          self:
                            href: /workflow/tasks/3768afc0-1070-4372-b965-44f01cba70cb
                      jointOwnerInfoForm1:
                        domain: 'http:/api.apiture.com/domains/tasks/forms'
                        name: userForm
                        type: form
                        label: Joint Owner Personal Information
                        _links:
                          self:
                            href: /workflow/tasks/cb898688-05d1-4ecd-8684-d67da617eafa
                    dependencies:
                      jointOwnerInfoForm1:
                        - dependents:
                            - accountOwnershipChoice
                          rule: accountOwnershipChoice.choice == 'joint'
                      accountOwnershipChoice:
                        - dependents:
                            - personalInfoForm1
                    bindings:
                      - source: _.userProfile
                        targets:
                          - userForm1.user
                          - jointUserForm1.spouse
                    _links:
                      self:
                        href: /workflow/workflowDefinitions/0399abed-fd3d-4830-a88b-30f38b8a365c
                    _embedded: {}
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)

            * [`nameDomainInUse`](#err-nameDomainInUse)
          x-apiture-errors:
            - malformedRequestBody
            - nameDomainInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          $ref: '#/components/responses/404WorkflowDefinition'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/workflow'
          application/json:
            schema:
              $ref: '#/components/schemas/workflow'
        required: true
    patch:
      summary: Update this workflow definition
      description: >-
        Perform a partial update of this workflow definition. Fields which are omitted are not updated. Nested `_embedded` and `_links` are ignored if
        included.
      operationId: patchWorkflowDefinition
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow definition resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`malformedRequestBody`](#err-malformedRequestBody)
          x-apiture-errors:
            - malformedRequestBody
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          $ref: '#/components/responses/404WorkflowDefinition'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/workflow'
          application/json:
            schema:
              $ref: '#/components/schemas/workflow'
        required: true
    delete:
      summary: Delete this workflow definition resource
      description: >-
        Delete this workflow definition resource. The workflow definition may not be deleted if it or any of its revisions are in use by any tasks.
        Deleting a workflow definition also deletes all of its revisions.
      operationId: deleteWorkflowDefinition
      security:
        - apiKey: []
          accessToken:
            - data/delete
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`workflowDefinitionInUse`](#err-workflowDefinitionInUse)
          x-apiture-errors:
            - workflowDefinitionInUse
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '412':
          $ref: '#/components/responses/412'
  '/workflowDefinitions/{workflowDefinitionId}/revisions':
    get:
      summary: Return a collection of workflow definition revisions
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of workflow definition revisions. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination
        links.
      operationId: getWorkflowDefinitionRevisions
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - name: start
          in: query
          description: >-
            The zero-based index of the first workflow definition revision item to include in this page. The default 0 denotes the beginning of the
            collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of workflow definition representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. Revision collections are sorted by default in reverse chronological order (most recent revision first). See [sort
            criteria format](https://developer.apiture.com/docs/concepts/sorting), such as `?sortBy=field1,-field2`.
          schema:
            type: string
        - $ref: '#/components/parameters/filterQueryParam'
        - $ref: '#/components/parameters/qQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflows'
            application/json:
              schema:
                $ref: '#/components/schemas/workflows'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new workflow definition revision
      description: >-
        Create a new immutable revision of this workflow definition. The revision is a snapshot of the content of the definition. This operation has
        no request body. The response body is the representation of the new _revision_. It is recommended to update the workflow definition's
        `revisionLabel` _before_ calling this operation. This operation is ignored (it returns 204 No Content) if the workflow definition has not
        changed since the last time the revision was created. Creating a revision does not alter the entity tag of the workflow definition.
      operationId: createWorkflowDefinitionRevision
      security:
        - apiKey: []
          accessToken:
            - data/write
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - name: revisionPolicy
          in: query
          description: >-
            The `revisionPolicy` property determines how task definitions reference by this workflow definition are processed when creating a workflow
            definition revision.

            If `revisionPolicy` is `none`, then the task definitions referenced by this workflow definition are copied directly to the new workflow
            definition revision. With this policy, when instantiating a new workflow _`W`_ from the new workflow definitions revision, _`W`_ will use
            the _revisionless_ task definitions, unless the workflow definition already specifies an explicit task definition revisionless.


            If `revisionPolicy` is `taskRevisions` (the default), then the new revision will explicitly link to (and optionally create) the latest
            _revisions_ of any task definitions embedded within  this workflow definition, even if the workflow definition refers to revisionless task
            definitions.  This effectively "snapshots" both the workflow definition and the task definitions in one operation. For example, if the
            workflow embeds task definitions `A` and `B` and `C` such that:

              * A is already a reference to a specific revision `2018-10-10T10:10:10.10Z`
              * B refers to a revisionless task definition _and_ `B` has _not_ been modified since the last revision `2018-10-20T20:20:20.000Z` was created;
              * `C` refers to a revisionless task definition but `C` _has_ been modified since its last revision was created;

            then creating new workflow definition revision with `?taskRevisions=true` will first create a task definition revision for `C`
            (`2018-10-30T13:30:30.300Z`) and the new workflow definition revision will embed the existing revision `2018-10-10T10:10:10.10Z` of `A`,
            the existing revision `2018-10-20T20:20:20.000Z` of `B`, and the new revision `2018-10-30T13:30:30.300Z` of `C`.
          schema:
            type: string
            enum:
              - none
              - taskRevisions
      responses:
        '201':
          description: OK. A new revision was created.
          headers:
            Location:
              description: >-
                The URI of the new revision. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag for the revision. This entity tag may be passed as the `If-Not-Match` on a `GET`
                request for the revision location. (This is _not_ the entity tag of the mutable definition resource.)
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '204':
          description: 'No Content. The resource has not changed since the last revision was created, and a new revision has not been created.'
  '/workflowDefinitions/{workflowDefinitionId}/revisions/{revisionId}':
    get:
      summary: Fetch a representation of an immutable revision of this workflow definition
      description: >-
        Return an immutable [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this revision of this workflow definition
        resource. The revision may also have `prev` and `next` links to previous and/or next revisions, if they exist.
      operationId: getWorkflowDefinitionRevision
      security:
        - apiKey: []
          accessToken:
            - data/read
      tags:
        - Workflow Definition
      parameters:
        - $ref: '#/components/parameters/workflowDefinitionIdPathParam'
        - $ref: '#/components/parameters/revisionIdParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which must be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this workflow definition resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/workflow'
            application/json:
              schema:
                $ref: '#/components/schemas/workflow'
        '304':
          $ref: '#/components/responses/304'
        '404':
          $ref: '#/components/responses/404Workflow'
        '412':
          $ref: '#/components/responses/412'
  /labels:
    get:
      summary: Localized Labels
      description: |-
        Return a JSON object which defines labels
        for enumeration types defined by the schemas
        defined in this API.


        The labels in the response may not all match the
        requested language; some may be in the default
        language (`en-us`).
      operationId: getLabels
      security:
        - apiKey: []
      x-apiture-implemented: true
      parameters:
        - name: Accept-Language
          in: header
          description: >-
            The weighted language tags which indicate the user's preferred natural language for the localized labels in the response, as per [RFC
            7231](https://tools.ietf.org/html/rfc7231#section-5.3.5).
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/labelGroups'
            application/json:
              schema:
                $ref: '#/components/schemas/labelGroups'
      tags:
        - API
  /:
    get:
      summary: Top-level resources and operations in this API
      description: |-
        Return links to the top-level resources and operations in this API. Links included in this response include:

          * *`apiture:workflowDefinitions`* - links to the collection of workflow definitions
          * *`apiture:workflows`* - links to the collection of workflows
          * *`apiture:taskDefinitions`* - links to the collection of workflow task definitions
          * *`apiture:tasks`* - links to the collection of workflow tasks
      operationId: getApi
      security:
        - apiKey: []
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/root'
            application/json:
              schema:
                $ref: '#/components/schemas/root'
            id:
              examples:
                response:
                  value: apiName
            name:
              examples:
                response:
                  value: API name
            apiVersion:
              examples:
                response:
                  value: 0.0.1-SNAPSHOT
            _profile:
              examples:
                response:
                  value: 'https://api.apiture.com/schemas/common/root/v2.0.0/profile.json'
            _links:
              examples:
                response:
                  value:
                    'apiture:workflowDefinitions':
                      href: /workflow/workflowDefinitions
                    'apiture:createWorkflowDefinition':
                      href: /workflow/workflowDefinitions
                    'apiture:workflows':
                      href: /workflow/workflowDefinitions
                    'apiture:taskDefinitions':
                      href: /workflow/workflowDefinitions
                    'apiture:createTaskDefinition':
                      href: /workflow/workflowDefinitions
                    'apiture:tasks':
                      href: /workflow/workflowDefinitions
      tags:
        - API
  /apiDoc:
    get:
      summary: Return API definition document
      description: Return the OpenAPI document that describes this API.
      operationId: getApiDoc
      security:
        - apiKey: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
            application/openapi+json;version=2.0:
              schema:
                type: object
            application/openapi+yaml;version=2.0:
              schema:
                type: object
            application/hal+json:
              schema:
                type: object
      tags:
        - API
x-apiture-errors:
  invalidWorkflowId:
    description: No workflows were found for the specified workflowId
    remediation: Check to make sure that the supplied workflowId corresponds to an apiture workflow resource
  invalidTaskDefinitionId:
    description: No task definitions were found for the specified taskDefinitionId
    remediation: Check to make sure that the supplied taskDefinitionId corresponds to an apiture task definition resource
  invalidWorkflowDefinitionId:
    description: No workflow definitions were found for the specified workflowDefinitionId
    remediation: Check to make sure that the supplied workflowDefinitionId corresponds to an apiture workflow definition resource
  invalidTaskId:
    description: No tasks were found for the specified taskId
    remediation: Check to make sure that the supplied taskId corresponds to an apiture task resource
  invalidTaskDefinitionRevisionId:
    description: No task definition revisions were found for the specified task definition revisionId
    remediation: Check to make sure that the supplied revisionId corresponds to an apiture task definition revision resource
  invalidWorkflowDefinitionRevisionId:
    description: No workflow definition revisions were found for the specified workflow definition revisionId
    remediation: Check to make sure that the supplied revisionId corresponds to an apiture workflow definition revision resource
  cannotModifyRevision:
    description: Modifying revisioned resources is not allowed
    remediation: 'Revisioned resources are immutable, check to ensure that the supplied id does not belong to a revision'
  malformedRequestBody:
    description: The body of the request is invalid
    remediation: Check to make sure that the body of the patch request is valid JSON
  taskDefinitionInUse:
    description: Task definitions cannot be deleted if they are in use in a workflow definition
    remediation: Check the existing workflow definitions to see if the requested task definition is being used
  workflowDefinitionInUse:
    description: Workflow definitions cannot be deleted if they are in use by other workflow or task definitions
    remediation: Check the existing workflow definitions to see if the requested workflow definition is a revision
  nameDomainInUse:
    description: The combination of name and domain must be unique across workflow definitions and task definitions
    remediation: 'Check for existing workflow definitions or task definitions using the requested name, domain combination'
  updateFailed:
    description: The update to the database object failed
    remediation: Check to make sure that the object being updated has valid properties
x-apiture-traits:
  - api:
      title: Workflow
      basePath: workflow
      links:
        - getApi
        - getApiDoc
        - getLabels
        - getTasks
        - createTask
        - getTaskDefinitions
        - createTaskDefinition
        - getWorkflows
        - createWorkflow
        - createWorkflowDefinition
        - getWorkflowDefinitions
  - resource:
      name: workflow definition
      description: >
        A definition (template) for creating new workflows. The definition specifies the attributes of the workflow (the state variables), the
        workflow inputs and outputs, which task (task definitions) to instantiate in the workflow, the task criteria, and the workflow global
        completion criteria.
  - resource:
      name: workflow
      description: >-
        A workflow instance based on a workflow definition. Creating a workflow from a workflow definition, with additional workflow attributes
        (initial state).
      excludeMethods:
        - put
        - patch
  - resource:
      name: task definition
      description: A definition (template) for creating new tasks in workflows.
  - resource:
      name: task
      description: A task step in a workflow.
  - security:
      baseScope: data
x-apiture-annotated-at: '2020-10-02T13:42:24.726Z'
components:
  schemas:
    flowItemSummary:
      title: Flow Item (v1.1.0)
      x-apiture-version: 1.1.0
      x-apiture-fragment: true
      x-apiture-deprecated:
        since: 0.19.0
        removeOn: 0.21.0
      description: >-
        This schema defines common properties shared between workflow and task _summary_ representations. It is used to define other model schemas for
        this API and is not used on its own to describe request and response bodies.<br>**Warning**: The schema `flowItemSummary` was deprecated on
        version `v0.19.0` of the API.  `flowItemSummary` will be removed on version `v0.21.0` of the API.
      x-apiture-composition:
        - $ref: '#/components/schemas/revisionEffectiveInterval'
        - properties:
            - name
            - domain
            - label
            - description
            - instructions
            - revisionLabel
            - done
            - restartable
            - restartableRule
            - maxRestartCount
            - restartCount
            - includeInTaskSequence
      properties:
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        revisionLabel:
          description: >-
            The text label for the revision of this resource, suitable for presentation to the client. This is used to differentiate between different
            revisions of the item. Clients should change this via the `PATCH` or `PUT` before creating the revision, since revisions are immutable and
            there is no way to change this label after the revision is created.
          type: string
          maxLength: 128
          minLength: 1
          example: Use Terms and Conditions 1.0.4 as of 2018-09-25
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow `_embedded` data. That value contains an ordered list of
            tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          readOnly: true
          example: true
      type: object
      x-apiture-flattened: true
    flowItemState:
      title: Flow Item State (v1.0.0)
      description: |-
        The state of a workflow task or of a workflow.

        <strong><code>flowItemState</code></strong> strings may have one of the following
        [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations):

        <table>
        <tr>
          <th>Value</th><th>Description</th>
        </tr>

        <tr>
            <td><strong><code>definition</code></strong></td><td>This workflow or task is a _definition_.: The service uses workfow definitions and task definitions to instatiate runnable workflows or tasks. Definitions may not be run. Tasks with this value may only be added to `/taskDefinitions`; workflows with this value may only be added to `/workflowDefinitions`.</td>
            </tr>
        <tr>
            <td><strong><code>pending</code></strong></td><td>The workflow or task is available to be started: The workflow or task is available to be started (it is not `blocked`) but has not been started. *Note*: This state is currently not used, but in a future release, an option to the `createWorkflow` operation will allow creating workflows in the `pending` state instead of automatically starting them.</td>
            </tr>
        <tr>
            <td><strong><code>blocked</code></strong></td><td>The workflow or task is waiting for the entry criteria to be satisfied.: This could be one or more predecessor tasks are not completed, or the global criteria expression is not satisfied.</td>
            </tr>
        <tr>
            <td><strong><code>running</code></strong></td><td>The workflow or task has started but not completed.</td>
            </tr>
        <tr>
            <td><strong><code>paused</code></strong></td><td>The workflow or task has been paused.: Resume a paused item by resumed by setting the state back to `running` via a `POST` to `/runningTasks` or `/runningWorkflows`.</td>
            </tr>
        <tr>
            <td><strong><code>completed</code></strong></td><td>The workflow or task has completed successfully.</td>
            </tr>
        <tr>
            <td><strong><code>canceled</code></strong></td><td>The workflow or task was canceled before completing.</td>
            </tr>
        <tr>
            <td><strong><code>failed</code></strong></td><td>The workflow or task has failed with an error or other non-success criteria.: The state is a derived value, maintained by the Workflow service. It is updated by the service or by operations on workflow instances or task instances such as the `apiture:cancelWorkflow` link found on a workflow.</td>
            </tr>
        </table>


        These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
        named `flowItemState` in the response from the [`getLabels`](#op-getLabels) operation.
      type: string
      enum:
        - definition
        - pending
        - blocked
        - running
        - paused
        - completed
        - failed
        - canceled
      x-apiture-enum: flowItemState
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    flowItem:
      title: Flow Item (v1.1.0)
      description: >-
        This schema defines common properties shared between workflows and tasks. It is used to define other model schemas for this API and is not
        used on its own to describe request and response bodies.
      x-apiture-version: 1.1.0
      x-apiture-fragment: true
      x-apiture-composition:
        - properties:
            - name
            - domain
            - label
            - description
            - instructions
            - restartable
            - restartableRule
            - maxRestartCount
            - restartCount
            - schema
            - interface
            - bindings
            - values
      properties:
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
      type: object
      x-apiture-flattened: true
    interface:
      title: Interface (v1.0.0)
      description: Defines the input and output interface (subset of values) for  a task or workflow.
      properties:
        input:
          description: '`true` if the variable is an input to the task or workflow.'
        output:
          description: '`true` if the variable is an output of the task or workflow.'
        required:
          description: >-
            `true` if the input variable is required. For a task, the workflow must bind the task's required inputs to a value, such as one of the
            variables in the workflow, or to an output variable of another task. (The schema types must match for such assignments.)
      x-apiture-version: 1.0.0
      type: object
      x-apiture-flattened: true
    taskFields:
      title: Task Fields (v1.1.0)
      description: Common fields of the task resource used to build other model schemas.
      x-apiture-fragment: true
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/taskFields/v1.1.0/profile.json'
        domain: 'http:/api.apiture.com/domains/tasks/prompts'
        name: accountCategoryChoice
        label: Account Category Choice
        type: staticChoice
        state: blocked
        done: false
        mode: interactive
        restartable: true
        description: >-
          This workflow task presents a user choices representing a set of account types. The user selects one. (For this example, we assume that
          `staticChoice` is a defined task type for making a choice from a static list of values.)
        schema:
          type: object
          properties:
            choice:
              description: The `id` of the selected choice.
              type: string
            choiceLabel:
              description: The `label` of the selected choice.
              type: string
            choices:
              description: An array of choices which are presented to the user for selection.
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: This selection's unique ID.
                  label:
                    type: string
                    description: This selection's text label.
                  image:
                    type: string
                    description: A URI of an image to present for this choice.
        interface:
          choice:
            input: true
            output: true
          choiceLabel:
            input: false
            output: true
          choices:
            input: true
          label: Choose an account type
          presentation: iconAndLabel
          selection: single
          defaultSelection: savings
        values:
          choice: checking
          choiceLabel: Checking
          choices:
            - id: savings
              label: Savings
              image: 'https://api.apiture.com/static/images/accountTypes/savings.png'
            - id: checking
              label: Checking
              image: 'https://api.apiture.com/static/images/accountTypes/checking.png'
      x-apiture-composition:
        - $ref: '#/components/schemas/flowItem'
        - properties:
            - type
            - visibility
            - mode
            - includeInTaskSequence
      properties:
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
      type: object
      x-apiture-flattened: true
    createTask:
      title: Create Task Definition (v1.1.0)
      description: Representation used to create a new task definition.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/createTask/v1.1.0/profile.json'
        name: accountCategoryChoice
        label: Account Category Choice
        type: staticChoice
        state: blocked
        mode: interactive
        restartable: true
        description: >-
          This workflow task presents a user choices representing a set of account types. The user selects one. (For this example, we assume that
          `staticChoice` is a defined task type for making a choice from a static list of values.)
        schema:
          type: object
          properties:
            choice:
              description: The `id` of the selected choice.
              type: string
            choiceLabel:
              description: The `label` of the selected choice.
              type: string
            choices:
              description: An array of choices which are presented to the user for selection.
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: This selection's unique ID.
                  label:
                    type: string
                    description: This selection's text label.
                  imageUri:
                    type: string
                    description: A URI of an image to present for this choice.
        interface:
          choice:
            input: true
            output: true
          choices:
            value:
              - id: savings
                label: Savings
                imageUri: 'https://api.apiture.com/static/images/accountTypes/savings.png'
              - id: checking
                label: Checking
                imageUri: 'https://api.apiture.com/static/images/accountTypes/checking.png'
          label: Choose an account type
          presentation: iconAndLabel
          selection: single
          defaultSelection: savings
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractRequest'
        - $ref: '#/components/schemas/taskFields'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
      type: object
      x-apiture-flattened: true
    nestableTask:
      title: Nestable Task Definition Summary (v1.0.0)
      description: >
        Summary representation of a task definition resource that contains an optional array of subtasks. This representation normally does not
        contain any `_embedded` objects. If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.



        <h3 class='schema-links' id="nestableTask-links" >Links</h3>


        Response and request bodies using this <strong><code>nestableTask</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getTask'><strong><code>self</code></strong></a></td><td>Fetch a representation of this task</td><td><code>GET</code></td>

        </tr>

        </table>
      x-apiture-links:
        - rel: self
          operationId: getTask
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _links:
          self:
            href: /workflow/tasks/0399abed-fd3d-4830-a88b-30f38b8a365c
      x-apiture-version: 1.0.0
      x-apiture-composition:
        - $ref: '#/components/schemas/summaryTask'
        - properties:
            - subtasks
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
        _id:
          description: The unique identifier for this task definition resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a task.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        initial:
          description: >-
            Indicates if a task is an _initial_ task A initial task is one which has no task dependencies and thus can never be `blocked`. Initial
            tasks are started automatically when the workflow is started. <br> This is a derived property.
          type: boolean
          readOnly: true
          example: false
        terminal:
          description: |-
            Indicates if a task is a _terminal_ task A terminal task is one
            which no other task depends on. If a terminal state is reached
            (its entry criteria are satisfied), the workflow containing the
            task is also marked as `completed` or `failed`.
            <br>
            This is a derived property.
          type: boolean
          readOnly: true
          example: false
        subtasks:
          description: 'An optional array of summary task definitions.  Subtasks appear on nested workflows (tasks of `type: workflow`).'
          type: array
          items:
            $ref: '#/components/schemas/nestableTask'
      type: object
      x-apiture-flattened: true
    summaryTask:
      title: Task Definition Summary (v1.1.0)
      description: >
        Summary representation of a task definition resource in task definitions collections. This representation normally does not contain any
        `_embedded` objects. If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.



        <h3 class='schema-links' id="summaryTask-links" >Links</h3>


        Response and request bodies using this <strong><code>summaryTask</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getTask'><strong><code>self</code></strong></a></td><td>Fetch a representation of this task</td><td><code>GET</code></td>

        </tr>

        </table>
      x-apiture-version: 1.1.0
      x-apiture-links:
        - rel: self
          operationId: getTask
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        name: updateBusinessInfo
        domain: 'https://api.apiture.com/acctApps'
        type: updateOrg
        initial: false
        terminal: false
        visibility: hidden
        label: Save Business Information
        done: false
        restartable: true
        errorTask: businessInfoForm
        includeInTaskSequence: true
        state: blocked
        _links:
          self:
            href: /workflow/tasks/0399abed-fd3d-4830-a88b-30f38b8a365c
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/taskFields'
        - properties:
            - _id
            - state
            - done
            - initial
            - terminal
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
        _id:
          description: The unique identifier for this task definition resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a task.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        initial:
          description: >-
            Indicates if a task is an _initial_ task A initial task is one which has no task dependencies and thus can never be `blocked`. Initial
            tasks are started automatically when the workflow is started. <br> This is a derived property.
          type: boolean
          readOnly: true
          example: false
        terminal:
          description: |-
            Indicates if a task is a _terminal_ task A terminal task is one
            which no other task depends on. If a terminal state is reached
            (its entry criteria are satisfied), the workflow containing the
            task is also marked as `completed` or `failed`.
            <br>
            This is a derived property.
          type: boolean
          readOnly: true
          example: false
      type: object
      x-apiture-flattened: true
    updateTask:
      title: Update Workflow Task (v1.1.0)
      description: >-
        Representation used to update or patch a task definition. Updates do not change the derived `state` field.<br>**Warning**: The schema
        `updateTask` was deprecated on version `v0.19.0` of the API. Use `task` schema instead. `updateTask` will be removed on version `v0.21.0` of
        the API.
      x-apiture-version: 1.1.0
      x-apiture-deprecated:
        since: 0.19.0
        removeOn: 0.21.0
        replacement: '`task` schema'
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _links:
          self:
            href: /workflow/tasks/0399abed-fd3d-4830-a88b-30f38b8a365c
      x-apiture-composition:
        - $ref: '#/components/schemas/task'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
        _id:
          description: The unique identifier for this task definition resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a task.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        initial:
          description: >-
            Indicates if a task is an _initial_ task A initial task is one which has no task dependencies and thus can never be `blocked`. Initial
            tasks are started automatically when the workflow is started. <br> This is a derived property.
          type: boolean
          readOnly: true
          example: false
        terminal:
          description: |-
            Indicates if a task is a _terminal_ task A terminal task is one
            which no other task depends on. If a terminal state is reached
            (its entry criteria are satisfied), the workflow containing the
            task is also marked as `completed` or `failed`.
            <br>
            This is a derived property.
          type: boolean
          readOnly: true
          example: false
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
        errorTask:
          description: >-
            The name of task to [start](#op-startTask) if this task fails. When the task fails, it [sets its state to `failed`](#op-failTask). If the
            value is `""`, then the workflow does nothing if the task fails. If this is not set, the workflow will start the task named by the
            workflow's `errorTask`, if any, otherwise the workflow [sets its state to `failed`](#op-failWorkflow).
          type: string
          maxLength: 48
          pattern: '[a-zA-Z][-\w_]*'
          example: businessInfoForm
        revisionLabel:
          description: >-
            The text label for the revision of this resource, suitable for presentation to the client. This is used to differentiate between different
            revisions of the item. Clients should change this via the `PATCH` or `PUT` before creating the revision, since revisions are immutable and
            there is no way to change this label after the revision is created.
          type: string
          maxLength: 128
          minLength: 1
          example: Use Terms and Conditions 1.0.4 as of 2018-09-25
      type: object
      x-apiture-flattened: true
    task:
      title: Workflow Task (v1.1.0)
      description: >
        Representation of a task definition resource. A definition (template) for

        creating new tasks in workflows.



        <h3 class='schema-links' id="task-links" >Links</h3>


        Response and request bodies using this <strong><code>task</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getTask'><strong><code>self</code></strong></a></td><td>Fetch a representation of this task</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-getWorkflow'><strong><code>up</code></strong></a></td><td>Fetch a representation of this
        workflow</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-getTaskDefinition'><strong><code>apiture:definition</code></strong></a></td><td>The task
        definition</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-startTask'><strong><code>apiture:start</code></strong></a></td><td>Start or resume the task</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-pauseTask'><strong><code>apiture:pause</code></strong></a></td><td>Pause the task</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-cancelTask'><strong><code>apiture:cancel</code></strong></a></td><td>Cancel the task</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-failTask'><strong><code>apiture:fail</code></strong></a></td><td>Stop the task and set its state to
        `failed`</td><td><code>POST</code></td>

        </tr>

        </table>
      x-apiture-version: 1.1.0
      x-apiture-links:
        - rel: self
          operationId: getTask
        - rel: up
          operationId: getWorkflow
        - rel: 'apiture:definition'
          operationId: getTaskDefinition
          title: The task definition
        - rel: 'apiture:start'
          operationId: startTask
          title: Start or resume the task
        - rel: 'apiture:pause'
          operationId: pauseTask
          title: Pause the task
        - rel: 'apiture:cancel'
          operationId: cancelTask
          title: Cancel the task
        - rel: 'apiture:fail'
          operationId: failTask
          title: Stop the task and set its state to `failed`
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/workflow/task/v1.1.0/profile.json'
        name: updateBusinessInfo
        domain: 'https://api.apiture.com/acctApps'
        type: updateOrg
        initial: false
        terminal: false
        visibility: hidden
        label: Save Business Information
        done: false
        restartable: true
        errorTask: businessInfoForm
        includeInTaskSequence: true
        state: blocked
        _links:
          self:
            href: /workflow/tasks/0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:definition':
            href: /workflow/taskDefinitions/99ced512-9c19-4c5d-8859-9c42cd4bcc7b
          up:
            href: /workflow/workflows/64802afe-d0a4-4680-b6fb-a0de98f3d871
          'apiture:cancel':
            href: /canceledTasks?task=0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:fail':
            href: /failedTasks?task=0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:pause':
            href: /pausedTasks?task=0399abed-fd3d-4830-a88b-30f38b8a365c
      x-apiture-composition:
        - $ref: '#/components/schemas/summaryTask'
        - $ref: '#/components/schemas/revisionEffectiveInterval'
        - properties:
            - errorTask
            - revisionLabel
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        type:
          description: >-
            Describes the type of this task. This determines the behavior when the task is activated. Example task types are `form` (fill out a form),
            `choice` (select a value from a fixed set of choices), `select` (select one or more values from a dynamic set of choices), `rest` (perform
            a REST call), `compute` (compute output values based on the input values), `workflow` (a reusable set of subtasks). Task types are defined
            in the Workflow configuration.
          type: string
          pattern: '[a-zA-Z][-\w_]*'
          minLength: 3
          maxLength: 64
        visibility:
          description: Whether the client should show or hide this task.
          allOf:
            - $ref: '#/components/schemas/taskVisibility'
          example: hidden
        mode:
          description: Indicates whether the client interacts with the task or not.
          allOf:
            - $ref: '#/components/schemas/taskMode'
        includeInTaskSequence:
          description: >-
            If `true`,  include this task in an optional task sequence object on the workflow's `_embedded` data. That value contains an ordered list
            of tasks that have been completed during the workflow.  The UI may use this object to traverse the completed tasks.
          type: boolean
          example: true
        _id:
          description: The unique identifier for this task definition resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a task.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        initial:
          description: >-
            Indicates if a task is an _initial_ task A initial task is one which has no task dependencies and thus can never be `blocked`. Initial
            tasks are started automatically when the workflow is started. <br> This is a derived property.
          type: boolean
          readOnly: true
          example: false
        terminal:
          description: |-
            Indicates if a task is a _terminal_ task A terminal task is one
            which no other task depends on. If a terminal state is reached
            (its entry criteria are satisfied), the workflow containing the
            task is also marked as `completed` or `failed`.
            <br>
            This is a derived property.
          type: boolean
          readOnly: true
          example: false
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
        errorTask:
          description: >-
            The name of task to [start](#op-startTask) if this task fails. When the task fails, it [sets its state to `failed`](#op-failTask). If the
            value is `""`, then the workflow does nothing if the task fails. If this is not set, the workflow will start the task named by the
            workflow's `errorTask`, if any, otherwise the workflow [sets its state to `failed`](#op-failWorkflow).
          type: string
          maxLength: 48
          pattern: '[a-zA-Z][-\w_]*'
          example: businessInfoForm
        revisionLabel:
          description: >-
            The text label for the revision of this resource, suitable for presentation to the client. This is used to differentiate between different
            revisions of the item. Clients should change this via the `PATCH` or `PUT` before creating the revision, since revisions are immutable and
            there is no way to change this label after the revision is created.
          type: string
          maxLength: 128
          minLength: 1
          example: Use Terms and Conditions 1.0.4 as of 2018-09-25
      type: object
      x-apiture-flattened: true
    taskVisibility:
      title: Task Visibility (v1.0.0)
      description: |-
        Determines the visibility of the task in interactive (UI) clients.

        <strong><code>taskVisibility</code></strong> strings may have one of the following
        [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations):

        <table>
        <tr>
          <th>Value</th><th>Description</th>
        </tr>

        <tr>
            <td><strong><code>hidden</code></strong></td><td>Hidden: Presentation clients (UI) should not show this task to the end user.</td>
            </tr>
        <tr>
            <td><strong><code>visible</code></strong></td><td>Visible: Presentation clients (UI) may show this task to the end user.</td>
            </tr>
        </table>


        These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
        named `taskVisibility` in the response from the [`getLabels`](#op-getLabels) operation.
      type: string
      enum:
        - hidden
        - visible
      default: visible
      x-apiture-enum: taskVisibility
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    taskMode:
      title: Task Mode (v1.0.0)
      description: |-
        Indicates whether the client interacts with the task or not.


        <strong><code>taskMode</code></strong> strings may have one of the following
        [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations):

        <table>
        <tr>
          <th>Value</th><th>Description</th>
        </tr>

        <tr>
            <td><strong><code>interactive</code></strong></td><td>Interactive: The task requires interaction with the user, such as selecting a choice or filling out a form.</td>
            </tr>
        <tr>
            <td><strong><code>automatic</code></strong></td><td>Automatic: The task runs without interaction once its prerequisites are satisfied.</td>
            </tr>
        </table>


        These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
        named `taskMode` in the response from the [`getLabels`](#op-getLabels) operation.
      type: string
      enum:
        - interactive
        - automatic
      x-apiture-enum: taskMode
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    visibleTasks:
      title: Visible Task Collection (v1.1.0)
      description: >-
        Collection of visible tasks. The `visibility` of each task under `_embedded.items` will be `visible`.   If any of the tasks are of type
        `workflow`, their `visible` tasks will be included as well, nested inside that workflow task's `subTasks`.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/visibleTasks/v1.1.0/profile.json'
        name: visibleTasks
        _embedded:
          items:
            anyOf:
              - _id: 4c44d065-1f4c-4bf8-b76d-d0514cd2acff
                domain: 'http:/api.apiture.com/domains/accountApplication'
                name: userInfoForm
                description: User Info Form
                label: User Profile Information
                state: completed
                done: true
                type: form
                initial: false
                terminal: false
                visibility: visible
                mode: interactive
                restartable: true
                _links:
                  self:
                    href: /workflow/tasks/4c44d065-1f4c-4bf8-b76d-d0514cd2acff
              - _id: 32e4a075-bd33-43ee-a50a-ca499bbf3c6e
                domain: 'http:/api.apiture.com/domains/identityVerification'
                name: idVerification
                description: Identity Verification
                label: Identity Verification
                state: running
                done: false
                type: workflow
                initial: false
                terminal: false
                visibility: visible
                mode: interactive
                restartable: false
                _links:
                  self:
                    href: /workflow/tasks/32e4a075-bd33-43ee-a50a-ca499bbf3c6e
                subTasks:
                  - _id: 5ce72b5c-361f-4ba2-b0a5-92f7e18764bd
                    domain: 'http:/api.apiture.com/domains/identityVerification'
                    name: idQuiz
                    label: Identity Quiz
                    description: Identity Quiz
                    state: pending
                    done: false
                    type: rest
                    initial: false
                    terminal: false
                    visibility: visible
                    mode: interactive
                    restartable: false
                    _links:
                      self:
                        href: /workflow/tasks/5ce72b5c-361f-4ba2-b0a5-92f7e18764bd
              - _id: 4386bdee-ffe4-47ac-b313-87fd735be9ea
                domain: 'http:/api.apiture.com/domains/accountApplication'
                name: selectFundingAccount
                label: Select Funding Account
                description: Select Funding Account
                state: blocked
                done: false
                type: form
                initial: false
                terminal: false
                visibility: visible
                mode: interactive
                restartable: true
                _links:
                  self:
                    href: /workflow/tasks/4386bdee-ffe4-47ac-b313-87fd735be9ea
      x-apiture-composition:
        - $ref: '#/components/schemas/collection'
        - properties:
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          type: object
          description: Embedded task objects.
          properties:
            items:
              description: An array containing all visible task items.
              type: array
              items:
                $ref: '#/components/schemas/nestableTask'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    tasks:
      title: Task Collection (v1.1.0)
      description: |-
        Collection of tasks. The items in the collection are ordered in the `_embedded` object with name `items`.
         The top-level `_links` object may contain pagination links
         (`self`, `next`, `prev`, `first`, `last`, `collection`) as well
         as the following:

            * *`apiture:createTaskDefinition`* a POST
            operation to create a task definition using the
            `createTask` schema for the request.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/tasks/v1.1.0/profile.json'
        start: 10
        limit: 10
        count: 67
        name: tasks
        _links:
          self:
            href: /workflow/tasks?start=10&limit=10
          first:
            href: /workflow/tasks?start=0&limit=10
          next:
            href: /workflow/tasks?start=20&limit=10
          collection:
            href: /workflow/tasks
        _embedded:
          items:
            _profile: 'https://api.apiture.com/schemas/workflow/task/v1.1.0/profile.json'
            domain: 'http:/api.apiture.com/domains/tasks/prompts'
            name: accountCategoryChoice
            label: Account Category Choice
            type: staticChoice
            state: blocked
            done: false
            mode: interactive
            restartable: true
            description: >-
              This workflow task presents a user choices representing a set of account types. The user selects one. (For this example, we assume that
              `staticChoice` is a defined task type for making a choice from a static list of values.)
      x-apiture-composition:
        - $ref: '#/components/schemas/collection'
        - properties:
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          type: object
          description: Embedded task summary objects.
          properties:
            items:
              description: An array containing a page of task items.
              type: array
              items:
                $ref: '#/components/schemas/summaryTask'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    workflowFields:
      title: Workflow Fields (v1.0.0)
      description: 'Common properties used in `createWorkflow`, `updateWorkflow` and `workflow` which are not in the `summaryWorkflow` representation.'
      x-apiture-fragment: true
      x-apiture-version: 1.0.0
      x-apiture-composition:
        - $ref: '#/components/schemas/flowItem'
        - properties:
            - dependencies
            - _embedded
      properties:
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        dependencies:
          description: >-
            The task dependency graph. This defines which tasks are prerequisite tasks for other task in the workflow. `dependencies` is a map
            structure. The key is the name of the task which depends on the others; the value is an array of `dependency` objects which define what
            named task depends on and what conditions must be met.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/dependency'
        _embedded:
          description: >-
            Nested objects within a workflow definition. When creating a workflow definition, the nested tasks should be task or task summary
            representations from `/taskDefinitions` (i.e. the task `state`  must be `definition`). These may be either revisionless task definitions
            or specific revisions of task definitions.
          type: object
      type: object
      x-apiture-flattened: true
    createWorkflow:
      title: Create Workflow (v1.1.0)
      description: |-
        Representation used to create a new workflow definition. A workflow
        consists of one or more tasks, with dependencies and constraints. Each
        task can depend on one or more other tasks, with an optional constraint
        predicate which must evaluate to `true` when the dependent tasks have
        _completed_ (their `completed` field is `true`). The default constraint is
        that each dependent task has completed (its `completed` field is `true`,
        indicating it completed normally, it failed, or it was canceled).  The
        account application should be passed as the `apiture:application` link in
        `_links` in the request.


        The `values` of each task in the workflows `_embedded.tasks` will also be
        available within the `values` of the workflow via the names in the `tasks`
        object. For example, if a workflow has tasks

        ```
            { 'a' : { ... task type c ... },
              'b' : { ... task type c ... },
              ... }
        ```

        where tasks `a` and `b` both have `values` named `x`, `y` an `z`,
        these tasks will be available within the workflow's `values` as `a` and
        `b` and each of the tasks' `values` available via `a.x`, `a.y`, `a.z`,
        `b.x`, `b.y` and `b.z`, respectively. Thus, the `schema` and `values` from
        the workflow definition should not define any values whose name conflicts
        with the names in `tasks`.


        *Note*: When creating workflow definition, the `_embedded` objects should
        be task *definitions*.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/createWorkflow/v1.1.0/profile.json'
        _links:
          'apiture:application':
            href: /accountApplications/applications/2f23b9fe-532f-4e82-943e-b079ea55aebc
        name: newAccountSelector
        label: New Account Selector
        description: >-
          A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with that specific
          product.
        _embedded:
          tasks:
            personalInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              label: Personal Information
              type: form
              _links:
                self:
                  href: /workflow/tasks/46913e8b-fb7f-4f31-92bf-7b263907ed95
            accountOwnershipChoice:
              domain: 'http:/api.apiture.com/domains/tasks/prompts'
              name: accountOwnershipChoice
              type: binaryChoice
              label: Select Account Ownership Type
              _links:
                self:
                  href: /workflow/tasks/3768afc0-1070-4372-b965-44f01cba70cb
            jointOwnerInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              type: form
              label: Joint Owner Personal Information
              _links:
                self:
                  href: /workflow/tasks/cb898688-05d1-4ecd-8684-d67da617eafa
        dependencies:
          jointOwnerInfoForm1:
            - dependents:
                - accountOwnershipChoice
              rule: accountOwnershipChoice.choice == 'joint'
          accountOwnershipChoice:
            - dependents:
                - personalInfoForm1
        bindings:
          - source: _.userProfile
            targets:
              - userForm1.user
              - jointUserForm1.spouse
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractRequest'
        - $ref: '#/components/schemas/workflowFields'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: >-
            Nested objects within a workflow definition. When creating a workflow definition, the nested tasks should be task or task summary
            representations from `/taskDefinitions` (i.e. the task `state`  must be `definition`). These may be either revisionless task definitions
            or specific revisions of task definitions.
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        dependencies:
          description: >-
            The task dependency graph. This defines which tasks are prerequisite tasks for other task in the workflow. `dependencies` is a map
            structure. The key is the name of the task which depends on the others; the value is an array of `dependency` objects which define what
            named task depends on and what conditions must be met.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/dependency'
      type: object
      x-apiture-flattened: true
    binding:
      title: Variable Binding (v1.0.0)
      description: |-
        Binds (assigns) a source variable to one or more target destinations.


        Each source or target is a compound name, either
        <code>_.<em>fieldName</em></code> to refer to an variable in the
        workflow's or task's `values`, or <code><em>taskName</em>.<em>fieldName</em></code>
        to refer to a variable in a task's `values`. The <em>fieldName</em> may in
        turn be a compound name if the value is an object type, or may include an
        array index if the referenced data value is an array.


        For example, the binding

        ```
          { 'source' : '_.user',
            'targets' : [ 'userForm1.user', 'jointUserForm1.spouse' ]
          }
        ```

        will initialize the value `user` in the `userForm1` task with the
        workflow item's `user` value, and initialize the value `spouse` field in
        the `jointUserForm1` task with the same value.
      properties:
        source:
          description: >-
            The name of a value within the workflow's `values` (such as <code>_.<em>fieldName</em></code>) or within a task's `values` (such as
            <code><em>taskName</em>.<em>fieldName</em></code>).
          type: string
          minLength: 3
          maxLength: 256
          example: _.userProfile
        targets:
          description: >-
            The names of one or more `values` within the workflow (named <code>_.<em>fieldName</em></code>) or within a task (named
            <code><em>taskName</em>.<em>fieldName</em></code>) which will be bound to or assigned the value of the `source`.
          type: array
          items:
            type: string
            minLength: 3
            maxLength: 256
        externalTargets:
          description: |-
            External targets bind source variables to an external resource.


            For example, the external target

            ```
              { 'source' : 'userInformation.firstName',
                'externalTargets' : [ { 'uri': '_.applicationUri', 'target': 'applicants[0].firstName'} ]
              }
            ```

            will update the resource located at the uri at `applicationUri` in
            the workflow's `values` and map the source value from the
            userInformation task values to the external resource's body

            ```
            {
              'applicants': [{
                'firstName': 'mySourceValue'
              }]
            }
            ```
          type: array
          items:
            type: object
            properties:
              uri:
                type: string
                description: >-
                  The names of one or more `values` within the workflow (named <code>_.<em>fieldName</em></code>) or within a task (named
                  <code><em>taskName</em>.<em>fieldName</em></code>) which contains the uri of the external resource to bind to.
                minLength: 3
                maxLength: 256
              target:
                type: string
                description: >-
                  The name of one or more properties on the external resource which will be assigned the value of the `source`. This is used to map
                  the `source` value to the proper object structure of the external resource.
                minLength: 3
                maxLength: 256
      example:
        source: _.userProfile
        targets:
          - userForm1.user
          - jointUserForm1.spouse
      x-apiture-version: 1.0.0
      type: object
      x-apiture-flattened: true
    dependency:
      title: task Dependency (v1.0.0)
      description: >-
        A dependency captures a workflow task dependency: each task within a workflow can depend on 0 or more other _dependent_ tasks, creating a
        (possibly cyclic) dependency graph. Associated with each dependency is a _rule_: an optional constraint predicate expression which must
        evaluate to `true` in order for the task to start. The default constraint is that the dependent tasks all be `completed` (normal completion).
        A `dependency` object is the value associated with a task's name within a workflow's `dependencies` object.
      properties:
        dependents:
          description: The names of the tasks which must be `done` before this task can be run.
          type: array
          items:
            type: string
        rule:
          description: >-
            A business rule expression which must evaluate to true for this dependency to succeed. If any dependency constraint evaluates to false,
            the node's state becomes `failed`, and the workflow state may also become `failed`.
          type: string
          example: task1.state == 'completed' && task2.values.targetBalance < 1000
      x-apiture-version: 1.0.0
      type: object
      x-apiture-flattened: true
    summaryWorkflow:
      title: Workflow Summary (v1.1.0)
      x-apiture-version: 1.1.0
      description: >
        Summary representation of a workflow resource in workflows collections. This representation normally does not contain any `_embedded` objects.
        If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.



        <h3 class='schema-links' id="summaryWorkflow-links" >Links</h3>


        Response and request bodies using this <strong><code>summaryWorkflow</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getWorkflow'><strong><code>self</code></strong></a></td><td>Fetch a representation of this
        workflow</td><td><code>GET</code></td>

        </tr>

        </table>
      x-apiture-links:
        - rel: self
          operationId: getWorkflow
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/workflow/summaryWorkflow/v1.1.0/profile.json'
        _links:
          self:
            href: /workflow/workflows/0399abed-fd3d-4830-a88b-30f38b8a365c
        name: newAccountSelector
        domain: 'https://api.apiture.com/acctApps'
        label: New Account Selector
        type: somethingElse
        visibility: hidden
        values:
          category: personal
          ownership: joint
          minimumBalanceGoal: 1000
        description: >-
          A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with that specific
          product.
        _embedded: {}
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/workflowFields'
        - properties:
            - _id
            - state
            - done
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: >-
            Nested objects within a workflow definition. When creating a workflow definition, the nested tasks should be task or task summary
            representations from `/taskDefinitions` (i.e. the task `state`  must be `definition`). These may be either revisionless task definitions
            or specific revisions of task definitions.
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        dependencies:
          description: >-
            The task dependency graph. This defines which tasks are prerequisite tasks for other task in the workflow. `dependencies` is a map
            structure. The key is the name of the task which depends on the others; the value is an array of `dependency` objects which define what
            named task depends on and what conditions must be met.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/dependency'
        _id:
          description: The unique identifier for this workflow resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a workflow.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
      type: object
      x-apiture-flattened: true
    updateWorkflow:
      title: Update Workflow (v1.1.0)
      description: >-
        Representation used to update or patch a workflow. Updates do not change the derived `state` field.<br>**Warning**: The schema
        `updateWorkflow` was deprecated on version `v0.19.0` of the API. Use `workflow` schema instead. `updateWorkflow` will be removed on version
        `v0.21.0` of the API.
      x-apiture-version: 1.1.0
      x-apiture-deprecated:
        since: 0.19.0
        removeOn: 0.21.0
        replacement: '`workflow` schema'
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/workflow/updateWorkflow/v1.1.0/profile.json'
        _links:
          self:
            href: /workflow/workflows/0399abed-fd3d-4830-a88b-30f38b8a365c
        name: newAccountSelector
        domain: 'https://api.apiture.com/acctApps'
        label: New Account Selector
        type: somethingElse
        visibility: hidden
        state: running
        schema:
          category:
            type: string
            description: An account category
            enum:
              - personal
              - business
          ownership:
            type: string
            description: How account ownership is shared
            enum:
              - joint
              - individual
          minimumBalanceGoal:
            description: The applicant's target minimum balance.
            type: number
            example: 1000
        interface:
          category:
            input: true
            output: false
          ownership:
            input: true
            output: false
          minimumBalanceGoal:
            input: true
            output: false
            value: 10000
        values:
          category: personal
          ownership: joint
          minimumBalanceGoal: 1000
        description: >-
          A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with that specific
          product.
        _embedded:
          tasks:
            personalInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              label: Personal Information
              type: form
              _links:
                self:
                  href: /workflow/tasks/46913e8b-fb7f-4f31-92bf-7b263907ed95
            accountOwnershipChoice:
              domain: 'http:/api.apiture.com/domains/tasks/prompts'
              name: accountOwnershipChoice
              type: binaryChoice
              label: Select Account Ownership Type
              _links:
                self:
                  href: /workflow/tasks/3768afc0-1070-4372-b965-44f01cba70cb
            jointOwnerInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              type: form
              label: Joint Owner Personal Information
              _links:
                self:
                  href: /workflow/tasks/cb898688-05d1-4ecd-8684-d67da617eafa
        dependencies:
          jointOwnerInfoForm1:
            - dependents:
                - accountOwnershipChoice
              rule: accountOwnershipChoice.choice == 'joint'
          accountOwnershipChoice:
            - dependents:
                - personalInfoForm1
        bindings:
          - source: _.userProfile
            targets:
              - userForm1.user
              - jointUserForm1.spouse
      x-apiture-composition:
        - $ref: '#/components/schemas/workflow'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: >-
            Nested objects within a workflow definition. When creating a workflow definition, the nested tasks should be task or task summary
            representations from `/taskDefinitions` (i.e. the task `state`  must be `definition`). These may be either revisionless task definitions
            or specific revisions of task definitions.
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        dependencies:
          description: >-
            The task dependency graph. This defines which tasks are prerequisite tasks for other task in the workflow. `dependencies` is a map
            structure. The key is the name of the task which depends on the others; the value is an array of `dependency` objects which define what
            named task depends on and what conditions must be met.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/dependency'
        _id:
          description: The unique identifier for this workflow resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a workflow.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
        createdAt:
          description: >-
            The date-time when the workflow was created. This is an [RFC 3369](https://tools.ietf.org/html/rfc3339) formatted date-time string,
            `YYYY-MM-DDThh:mm:ss.sssZ`. This is a derived field and is immutable.
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: >-
            The date-time when the workflow was updated. This is an [RFC 3369](https://tools.ietf.org/html/rfc3339) formatted date-time string,
            `YYYY-MM-DDThh:mm:ss.sssZ`. This is a derived field and is immutable.
          type: string
          format: date-time
          readOnly: true
        errorTask:
          description: >-
            The name of a task to [start](#op-startTask) when a task fails and the failed task does not define its own `errorTask`. If the task is a
            `terminal` task, the workflow [sets its `state` to `failed`](#op-failTask). If the value is `""`, then the workflow does nothing when a
            task fails. If not defined, the workflow state becomes `failed` if a task without an `errorTask` fails.
          type: string
          maxLength: 48
          pattern: '[a-zA-Z][-\w_]*'
          example: failedWorkflowTerminalTask
        revisionLabel:
          description: >-
            The text label for the revision of this resource, suitable for presentation to the client. This is used to differentiate between different
            revisions of the item. Clients should change this via the `PATCH` or `PUT` before creating the revision, since revisions are immutable and
            there is no way to change this label after the revision is created.
          type: string
          maxLength: 128
          minLength: 1
          example: Use Terms and Conditions 1.0.4 as of 2018-09-25
      type: object
      x-apiture-flattened: true
    workflow:
      title: Workflow (v1.1.0)
      description: >
        Representation of a workflow resource. A workflow instance is based on a

        workflow definition.



        <h3 class='schema-links' id="workflow-links" >Links</h3>


        Response and request bodies using this <strong><code>workflow</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getWorkflow'><strong><code>self</code></strong></a></td><td>Fetch a representation of this
        workflow</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-getWorkflowDefinition'><strong><code>apiture:definition</code></strong></a></td><td>The workflow
        definition</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-pauseWorkflow'><strong><code>apiture:pause</code></strong></a></td><td>Pause the workflow and its
        tasks</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-cancelWorkflow'><strong><code>apiture:cancel</code></strong></a></td><td>Cancel the workflow and its
        tasks</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-startWorkflow'><strong><code>apiture:start</code></strong></a></td><td>Start or restart the
        workflow</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-failWorkflow'><strong><code>apiture:fail</code></strong></a></td><td>Stop the workflow and set its state to
        `failed`</td><td><code>POST</code></td>

        </tr>

        </table>
      x-apiture-version: 1.1.0
      x-apiture-links:
        - rel: self
          operationId: getWorkflow
        - rel: 'apiture:definition'
          operationId: getWorkflowDefinition
          title: The workflow definition
        - rel: 'apiture:pause'
          operationId: pauseWorkflow
          title: Pause the workflow and its tasks
        - rel: 'apiture:cancel'
          operationId: cancelWorkflow
          title: Cancel the workflow and its tasks
        - rel: 'apiture:start'
          operationId: startWorkflow
          title: Start or restart the workflow
        - rel: 'apiture:fail'
          operationId: failWorkflow
          title: Stop the workflow and set its state to `failed`
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/workflow/workflow/v1.1.0/profile.json'
        _links:
          self:
            href: /workflow/workflows/0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:cancel':
            href: /canceledWorkflows?workflow=0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:fail':
            href: /failedWorkflows?workflow=0399abed-fd3d-4830-a88b-30f38b8a365c
          'apiture:pause':
            href: /pausedWorkflows?workflow=0399abed-fd3d-4830-a88b-30f38b8a365c
        name: newAccountSelector
        domain: 'https://api.apiture.com/acctApps'
        label: New Account Selector
        type: somethingElse
        visibility: hidden
        state: blocked
        schema:
          category:
            type: string
            description: An account category
            enum:
              - personal
              - business
          ownership:
            type: string
            description: How account ownership is shared
            enum:
              - joint
              - individual
          minimumBalanceGoal:
            description: The applicant's target minimum balance.
            type: number
            example: 1000
        interface:
          category:
            input: true
            output: false
          ownership:
            input: true
            output: false
          minimumBalanceGoal:
            input: true
            output: false
            value: 10000
        values:
          category: personal
          ownership: joint
          minimumBalanceGoal: 1000
        description: >-
          A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with that specific
          product.
        _embedded:
          tasks:
            personalInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              label: Personal Information
              type: form
              _links:
                self:
                  href: /workflow/tasks/46913e8b-fb7f-4f31-92bf-7b263907ed95
            accountOwnershipChoice:
              domain: 'http:/api.apiture.com/domains/tasks/prompts'
              name: accountOwnershipChoice
              type: binaryChoice
              label: Select Account Ownership Type
              _links:
                self:
                  href: /workflow/tasks/3768afc0-1070-4372-b965-44f01cba70cb
            jointOwnerInfoForm1:
              domain: 'http:/api.apiture.com/domains/tasks/forms'
              name: userForm
              type: form
              label: Joint Owner Personal Information
              _links:
                self:
                  href: /workflow/tasks/cb898688-05d1-4ecd-8684-d67da617eafa
        dependencies:
          jointOwnerInfoForm1:
            - dependents:
                - accountOwnershipChoice
              rule: accountOwnershipChoice.choice == 'joint'
          accountOwnershipChoice:
            - dependents:
                - personalInfoForm1
        bindings:
          - source: _.userProfile
            targets:
              - userForm1.user
              - jointUserForm1.spouse
      x-apiture-composition:
        - $ref: '#/components/schemas/summaryWorkflow'
        - $ref: '#/components/schemas/revisionEffectiveInterval'
        - properties:
            - createdAt
            - updatedAt
            - errorTask
            - revisionLabel
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: >-
            Nested objects within a workflow definition. When creating a workflow definition, the nested tasks should be task or task summary
            representations from `/taskDefinitions` (i.e. the task `state`  must be `definition`). These may be either revisionless task definitions
            or specific revisions of task definitions.
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The name of this resource. The combination of `domain` and `name` must be unique within the set of all resources of this type.
          type: string
          maxLength: 48
          minLength: 1
          pattern: '[a-zA-Z][-\w_]*'
          example: acceptTermsAndConditions
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a *domain*, and all tasks or workflow instances they define will use that domain, so that they can avoid conflicting with task or
            workflow names in other domains. An API or service may define a domain for workflows and tasks that it defines. The combination of
            `domain` and `name` must be unique within the set of all resources of this type. It is a best practice to define domains with URIs.
          type: string
          maxLength: 512
          minLength: 1
          example: 'https://api.apiture.com/acctApps'
        label:
          description: 'The text label for this resource, suitable for presentation to the client.'
          type: string
          maxLength: 128
          minLength: 1
          example: Accept Terms and Conditions
        description:
          description: >-
            The full description for this resource, suitable for presentation in the tools for building/navigating the workflow. The content is
            processed as [Github Flavored Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich
            text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: Present the _Terms and Conditions_ to the user; they must actively accept the content for this task to complete successfully.
        instructions:
          description: >-
            End-user instructions for this workflow item. The content is processed as [Github Flavored
            Markdown](https://help.github.com/articles/basic-writing-and-formatting-syntax/) and thus supports rich text.
          type: string
          format: markdown
          maxLength: 4096
          minLength: 1
          example: >-
            Please read the _Terms and Conditions_ below and signify that you accept them by checking the box. You must accept the terms and
            conditions in order to continue.
        restartable:
          description: Indicates if the workflow or task is restartable.
          type: boolean
          default: true
          example: false
        restartableRule:
          description: An optional expression used in determining if the given task is restartable.
          type: string
          maxLength: 128
          minLength: 1
          example: start.state === 'completed' && end.state === 'blocked'
        maxRestartCount:
          description: An optional limit on the amount of times that the given task can be restarted.
          type: integer
          example: 3
        restartCount:
          description: A running count of the amount of times that a given task has been restarted.
          type: integer
          example: 3
        schema:
          description: >-
            The schema which defines the name and types of the variables that are part of this task definition. Property names must be simple
            identifiers consisting of alphanumeric characters, `-`, `_` following the pattern _`letter [letter | digit | '-' | '_']*`_

            This is implicitly a schema for `type: object` and contains the properties.


            The `values` in a task conform to the schema. The names and types are described with a subset of [JSON Schema
            Core](https://tools.ietf.org/html/draft-zyp-json-schema-04) and [JSON Schema
            Validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00) similar to that used to define schemas in [OpenAPI
            Specification 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject).
          type: object
        interface:
          description: >-
            `interface` defines the input and output interface of the workflow or task. The `interface` maps a variable from the schema to an object
            which indicates if the variable is part of the inputs to the task or workflow or part of the outputs of the instance, or both. The `value`
            provides a default value which is used when creating the instance. The `value` must confirm to the schema for that variable.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/interface'
        bindings:
          description: >-
            `bindings` connects input and output `interface` variables of the workflow and the workflow tasks.


            When the workflow starts, all workflow and task variables are first assigned to any default values as per their respective `interface` and
            `schema` defaults. Next, workflow and task `interface` inputs are assigned to the inputs of any tasks as per these `bindings`. When a task
            starts, any bindings for its inputs are assigned as per these bindings.

            Each binding defines a source and one or more targets that are assigned to the value named by the source.
          type: array
          items:
            $ref: '#/components/schemas/binding'
        values:
          description: >-
            The data associated with this flow item: the item's variable names and values. These values must conform to this item's `schema`. When a
            workflow or task runs, it may read and/or update these values as part of its processing.


            When used in a workflow definition or task definition, the `values` define the default values for the variable that the workflow or task
            will take if the corresponding value is not bound via a workflow's `bindings`. That is, a definition's `values` are copied into the new
            workflow item's `values` when the item is instantiated from the definition.


            *Note*: the `schema` may also contain `default` values which, if present, are used if a value is *not* set in the definition's `values`.
            (For example, multiple task definitions may use the same schema which defines values `a`, `b`, and `c`, but each task definition may have
            their own unique values for `a`, `b`, and `c` which is separate from the schema.)
          type: object
          additionalProperties:
            $ref: '#/components/schemas/attributeValue'
        dependencies:
          description: >-
            The task dependency graph. This defines which tasks are prerequisite tasks for other task in the workflow. `dependencies` is a map
            structure. The key is the name of the task which depends on the others; the value is an array of `dependency` objects which define what
            named task depends on and what conditions must be met.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/dependency'
        _id:
          description: The unique identifier for this workflow resource. This is an immutable opaque string.
          readOnly: true
          type: string
        state:
          description: The state of a workflow.
          allOf:
            - $ref: '#/components/schemas/flowItemState'
          readOnly: true
        done:
          description: >-
            Indicates if a task or workflow has completed. (With the current set of state values, this is true when the `state` is one of `completed`
            or `failed` or `canceled`, although the set of states may change when new states are added.)
          type: boolean
          readOnly: true
          example: false
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
        createdAt:
          description: >-
            The date-time when the workflow was created. This is an [RFC 3369](https://tools.ietf.org/html/rfc3339) formatted date-time string,
            `YYYY-MM-DDThh:mm:ss.sssZ`. This is a derived field and is immutable.
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: >-
            The date-time when the workflow was updated. This is an [RFC 3369](https://tools.ietf.org/html/rfc3339) formatted date-time string,
            `YYYY-MM-DDThh:mm:ss.sssZ`. This is a derived field and is immutable.
          type: string
          format: date-time
          readOnly: true
        errorTask:
          description: >-
            The name of a task to [start](#op-startTask) when a task fails and the failed task does not define its own `errorTask`. If the task is a
            `terminal` task, the workflow [sets its `state` to `failed`](#op-failTask). If the value is `""`, then the workflow does nothing when a
            task fails. If not defined, the workflow state becomes `failed` if a task without an `errorTask` fails.
          type: string
          maxLength: 48
          pattern: '[a-zA-Z][-\w_]*'
          example: failedWorkflowTerminalTask
        revisionLabel:
          description: >-
            The text label for the revision of this resource, suitable for presentation to the client. This is used to differentiate between different
            revisions of the item. Clients should change this via the `PATCH` or `PUT` before creating the revision, since revisions are immutable and
            there is no way to change this label after the revision is created.
          type: string
          maxLength: 128
          minLength: 1
          example: Use Terms and Conditions 1.0.4 as of 2018-09-25
      type: object
      x-apiture-flattened: true
    workflows:
      title: Workflow Collection (v1.1.0)
      description: |-
        Collection of workflows. The items in the collection are ordered in the
        `_embedded` object with name `items`.
        The top-level `_links` object may contain pagination links
        (`self`, `next`, `prev`, `first`, `last`, `collection`) as well
        the following:

            * *`apiture:createWorkflowDefinition`* - a POST operation to create a workflow definition using the
            `createWorkflow` schema for the request.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/workflow/workflows/v1.1.0/profile.json'
        start: 10
        limit: 10
        count: 67
        name: workflows
        _links:
          self:
            href: /workflow/workflows?start=10&limit=10
          first:
            href: /workflow/workflows?start=0&limit=10
          next:
            href: /workflow/workflows?start=20&limit=10
          collection:
            href: /workflow/workflows
        _embedded:
          items:
            _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/workflow/v1.1.0/profile.json'
            _links:
              self:
                href: /workflow/workflows/0399abed-fd3d-4830-a88b-30f38b8a365c
            name: newAccountSelector
            domain: 'https://api.apiture.com/acctApps'
            label: New Account Selector
            type: somethingElse
            visibility: hidden
            state: pending
            values:
              category: personal
              ownership: joint
              minimumBalanceGoal: 1000
            description: >-
              A flow for selecting a Banking Product. Once a product is selected, the application will run the workflow associated with that specific
              product.
            _embedded: {}
      x-apiture-composition:
        - $ref: '#/components/schemas/collection'
        - properties:
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: Embedded workflow summary objects.
          type: object
          properties:
            items:
              description: An array containing a page of workflow items.
              type: array
              items:
                $ref: '#/components/schemas/summaryWorkflow'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    attributes:
      x-apiture-version: 2.0.0
      title: Attributes (v2.0.0)
      description: |-
        An optional map of name/value pairs which contains additional dynamic data about the resource.

        This schema was resolved from [`common/attributes`](https://production.api.apiture.com/schemas/common/attributes/v2.0.0/model.json).
      type: object
      x-apiture-key: attributeName
      additionalProperties:
        $ref: '#/components/schemas/attributeValue'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributes/v2.0.0/model.json'
      x-apiture-namespace: common
      properties: {}
      x-apiture-flattened: true
    errorResponse:
      x-apiture-version: 2.0.0
      title: Error Response (v2.0.0)
      description: |-
        Describes an error response, typically returned on 4xx or 5xx errors from API operations. The `_error` object contains the error details.

        This schema was resolved from [`common/errorResponse`](https://production.api.apiture.com/schemas/common/errorResponse/v2.0.0/model.json).
      example:
        _profile: 'https://api.apiture.com/schemas/common/errorResponse/v2.0.0/profile.json'
        _error:
          _id: 2eae46e1-575c-4d69-8a8f-0a7b0115a4b3
          message: The value for deposit must be greater than 0.
          statusCode: 422
          type: positiveNumberRequired
          attributes:
            value: -125.5
          remediation: Provide a value which is greater than 0
          occurredAt: '2018-01-25T05:50:52.375Z'
          _links:
            describedby:
              href: 'https://api.apiture.com/errors/positiveNumberRequired'
          _embedded:
            errors: []
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/errorResponse/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
      type: object
      x-apiture-flattened: true
    labelGroups:
      title: Label Groups (v1.0.1)
      description: |-
        A set of named groups of labels, each of which contains multiple item labels.


        The abbreviated example shows two groups, one named `structure` and one named `estimatedAnnualRevenue`.
        The first has items with names such as `corporation`, `llc` and `soleProprietorship`,
        with text labels for each in the default and in French. The second has
        items for estimated revenue *ranges* but no localized labels. For example, the item named `from1to10Million`
        has the `label` "$1M to $10M" and the range `[1000000.00,10000000.00)`.

        This schema was resolved from [`common/labelGroups`](https://production.api.apiture.com/schemas/common/labelGroups/v1.0.1/model.json).
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/common/labelGroups/v1.0.1/profile.json'
        groups:
          structure:
            unknown:
              label: Unknown
              code: '0'
              hidden: true
            corporation:
              label: Corporation
              code: '1'
              variants:
                fr:
                  label: Soci\u00e9t\u00e9
            partnership:
              label: Partnership
              code: '2'
              variants:
                fr:
                  label: Partenariat
            llc:
              label: Limited Liability Company
              code: '2'
              variants:
                fr:
                  label: Soci\u00e9t\u00e9 \u00e9 Responsabilit\u00e9 Limit\u00e9e
            nonProfit:
              label: Non Profit
              code: '4'
              variants:
                fr:
                  label: Non Lucratif
            financialInstitution:
              label: Financial Institution
              code: '8'
              variants:
                fr:
                  label: Institution financi\u00e8re
            soleProprietorship:
              label: Sole Proprietorship
              code: '11'
              variants:
                fr:
                  label: Entreprise individuelle
            other:
              label: Other
              code: '254'
              variants:
                fr:
                  label: Autre
          estimatedAnnualRevenue:
            unknown:
              label: Unknown
              code: '0'
            under1Million:
              label: Under $1M
              code: '1'
              range: '[0,1000000.00)'
            from1to10Million:
              label: $1M to $10M
              code: '2'
              range: '[1000000.00,10000000.00)'
            from10to100Million:
              label: $10M to $100M
              code: '3'
              range: '[10000000.00,100000000.00)'
            over100Million:
              label: 'Over $100,000,000.00'
              code: '4'
              range: '[100000000.00,]'
            other:
              label: Other
              code: '254'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelGroups/v1.0.1/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - groups
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        groups:
          description: 'Groups of localized labels. This maps *group names* &rarr; [*a group of labels*](#schema-labelgroup) within that group.'
          x-apiture-key: groupName
          additionalProperties:
            $ref: '#/components/schemas/labelGroup'
      type: object
      x-apiture-flattened: true
    root:
      x-apiture-version: 2.0.0
      title: API Root (v2.0.0)
      description: |-
        A HAL response, with hypermedia `_links` for the top-level resources and operations in API.

        This schema was resolved from [`common/root`](https://production.api.apiture.com/schemas/common/root/v2.0.0/model.json).
      example:
        id: apiName
        name: API name
        apiVersion: 1.0.0
        _profile: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/profile.json'
        _links: {}
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - _id
            - name
            - apiVersion
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        _id:
          description: This API's unique ID.
          readOnly: true
          type: string
        name:
          type: string
          description: This API's name.
        apiVersion:
          type: string
          description: This API's version.
      type: object
      x-apiture-flattened: true
    revisionEffectiveInterval:
      title: Revision Effective Time Interval (v1.0.0)
      description: >-
        Time interval when a resource revision was effective and in use. This schema is used when composing other schemas.


        This schema was resolved from
        [`common/revisionEffectiveInterval`](https://production.api.apiture.com/schemas/common/revisionEffectiveInterval/v1.0.0/model.json).
      x-apiture-version: 1.0.0
      type: object
      properties:
        effectiveStartAt:
          description: >-
            The date-time when this revision was created and became effective. This is an [RFC 3339](https://tools.ietf.org/html/rfc3339) formatted
            date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable.
          type: string
          format: date-time
        effectiveEndAt:
          description: >-
            The date-time when the another revision became effective and this revision ceased being effective. This is an [RFC
            3339](https://tools.ietf.org/html/rfc3339) formatted date-time string `YYYY-MM-DDThh:mm:ss.sssZ`. This field is derived and immutable and
            is not present until the revision is no longer active.
          type: string
          format: date-time
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/revisionEffectiveInterval/v1.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-flattened: true
    attributeValue:
      x-apiture-version: 2.0.0
      title: Attribute Value (v2.0.0)
      description: |-
        The data associated with this attribute.

        This schema was resolved from [`common/attributeValue`](https://production.api.apiture.com/schemas/common/attributeValue/v2.0.0/model.json).
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributeValue/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      properties: {}
      x-apiture-flattened: true
    abstractRequest:
      x-apiture-version: 2.0.0
      title: Abstract Request (v2.0.0)
      description: >-
        An abstract schema used to define other request-only schemas. This is a [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource
        representation, minus the `_error` defined in `abstractResource`.


        This schema was resolved from [`common/abstractRequest`](https://production.api.apiture.com/schemas/common/abstractRequest/v2.0.0/model.json).
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
      example:
        _profile: '{uri of resource profile.json}'
        _links:
          self:
            href: '{uri of current resource}'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractRequest/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    abstractResource:
      x-apiture-version: 2.0.0
      title: Abstract Resource (v2.0.0)
      description: >-
        An abstract schema used to define other schemas for request and response bodies. This is a
        [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource representation. This model contains hypermedia `_links`, and either
        optional domain object data with `_profile` and optional `_embedded` objects, or an `_error` object. In responses, if the operation was
        successful, this object will not include the `_error`, but if the operation was a 4xx or 5xx error, this object will not include `_embedded`
        or any data fields, only `_error` and optionally `_links`.


        This schema was resolved from
        [`common/abstractResource`](https://production.api.apiture.com/schemas/common/abstractResource/v2.0.0/model.json).
      example:
        _profile: '{uri of resource profile.json}'
        _links:
          self:
            href: '{uri of current resource}'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractResource/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractRequest'
        - properties:
            - _error
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
      type: object
      x-apiture-flattened: true
    collection:
      x-apiture-version: 2.0.0
      title: Collection (v2.0.0)
      description: |-
        A collection of resources. This is an abstract model schema which is extended to define specific resource collections.

        This schema was resolved from [`common/collection`](https://production.api.apiture.com/schemas/common/collection/v2.0.0/model.json).
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/collection/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - count
            - start
            - limit
            - name
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    labelGroup:
      title: Label Group (v1.0.0)
      description: >-
        A map that defines labels for the items in a group. This is a map from each item *name* &rarr; *a [`labelItem`](#schema-labelitem) object*.
        For example, consider a JSON response that includes a property named `revenueEstimate`; the values for `revenueEstimate` must be one of the
        items in the group named `estimatedAnnualRevenue`, with options ranging `under1Million`, to `over100Million`. The item name is used as the
        selected value in an Apiture representation, such as `{ ..., "revenueEstimate" : "from10to100Million" , ...}`, and the item with the name
        `from10to100Million` defines the presentation labels for that item, as well as other metadata about that choice: this is the range
        `[10000000.00,100000000.00)`.


        This allows the client to let the user select a value from a list, such as the following derivde from the labels in the example:

          * Unknown
          * Under $1M
          * $1M to $10M
          * $10M to $100M
          * $100M or more

        Note that the `other` item is hidden from the selection list, as that item is marked as `hidden`. For items which define numeric ranges, a
        client may instead let the customer *directly* enter their estimated annual revenue as a number, such as 4,500,000.00. The client can then
        match that number to one of ranges in the items and set the `revenueEstimate` to the corresponding item's name: `{ ..., "revenueEstimate" :
        "from1to10Million", ... }`.


        This schema was resolved from [`common/labelGroup`](https://production.api.apiture.com/schemas/common/labelGroup/v1.0.0/model.json).
      x-apiture-key: labelName
      x-apiture-version: 1.0.0
      additionalProperties:
        $ref: '#/components/schemas/labelItem'
      example:
        unknown:
          label: Unknown
          code: '0'
          hidden: true
        under1Million:
          label: Under $1M
          code: '1'
          range: '[0,1000000.00)'
          variants:
            fr:
              label: Moins de $1M
        from1to10Million:
          label: $1M to $10M
          code: '2'
          range: '[1000000.00,10000000.00)'
          variants:
            fr:
              label: $1M \u00e0 $10M
        from10to100Million:
          label: $10M to $100M
          code: '3'
          range: '[10000000.00,100000000.00)'
          variants:
            fr:
              - label $10M \u00e0 $100M
        over100Million:
          label: 'Over $100,000,000.00'
          code: '4'
          range: '[100000000.00,]'
          variants:
            fr:
              label: Plus de $10M
        other:
          label: Other
          code: 254
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelGroup/v1.0.0/model.json'
      x-apiture-namespace: common
      type: object
      properties: {}
      x-apiture-flattened: true
    links:
      title: Links (v1.0.0)
      x-apiture-version: 1.0.0
      description: |-
        An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.

        This schema was resolved from [`common/links`](https://production.api.apiture.com/schemas/common/links/v1.0.0/model.json).
      type: object
      x-apiture-key: linkRelationName
      additionalProperties:
        $ref: '#/components/schemas/link'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/links/v1.0.0/model.json'
      x-apiture-namespace: common
      properties: {}
      x-apiture-flattened: true
    error:
      x-apiture-version: 2.0.0
      title: Error (v2.0.0)
      description: |-
        Describes an error in an API request or in a service called via the API.

        This schema was resolved from [`common/error`](https://production.api.apiture.com/schemas/common/error/v2.0.0/model.json).
      required:
        - message
      properties:
        message:
          type: string
          description: A localized message string describing the error condition.
        _id:
          description: >-
            A unique identifier for this error instance. This may be used as a correlation ID with the root cause error (i.e. this ID may be logged at
            the source of the error). This is is an opaque string.
          readOnly: true
          type: string
        statusCode:
          description: The HTTP status code associate with this error.
          type: integer
          minimum: 100
          maximum: 599
          example: 422
        type:
          type: string
          description: >-
            An error identifier which indicates the category of error and associate it with API support documentation or which the UI tier can use to
            render an appropriate message or hint. This provides a finer level of granularity than the `statusCode`. For example, instead of just 400
            Bad Request, the `type` may be much more specific. such as `integerValueNotInAllowedRange` or `numericValueExceedsMaximum` or
            `stringValueNotInAllowedSet`.
        occurredAt:
          type: string
          format: date-time
          description: 'An [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC time stamp indicating when the error occurred.'
          example: '2018-02-02T03:37:15.375Z'
        attributes:
          description: >-
            Informative values or constraints which describe the error. For example, for a value out of range error, the attributes may specify the
            `minimum` and `maximum` values. This allows clients to present error messages as they see fit (the API does not assume the
            client/presentation tier). The set of attributes varies by error `type`.
          allOf:
            - $ref: '#/components/schemas/attributes'
        remediation:
          type: string
          description: An optional localized string which provides hints for how the user or client can resolve the error.
        errors:
          description: An optional array of nested error objects. This property is not always present.
          type: array
          items:
            $ref: '#/components/schemas/error'
        _links:
          $ref: '#/components/schemas/links'
      example:
        _id: 2eae46e1575c0a7b0115a4b3
        message: Descriptive error message...
        statusCode: 422
        type: errorType1
        remediation: Remediation string...
        occurredAt: '2018-01-25T05:50:52.375Z'
        errors:
          - _id: ccdbe2c5c938a230667b3827
            message: An optional embedded error
          - _id: dbe9088dcfe2460f229338a3
            message: Another optional embedded error
        _links:
          describedby:
            href: 'https://developer.apiture.com/errors/errorType1'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/error/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    labelItem:
      title: Label Item (v1.0.0)
      description: >-
        An item in a [`labelGroup`](#schema-labelgroup), with a set of `variants` which contains different localized labels for the item. Each
        ([`simpleLabel`](#schema-simpleLabel)) variant defines the presentation text label and optional description for a language. Items may also
        have a lookup `code` to map to external syststems, a numeric range, and a `hidden` boolean to indicate the item is normally hidden in the UI.


        This schema was resolved from [`common/labelItem`](https://production.api.apiture.com/schemas/common/labelItem/v1.0.0/model.json).
      x-apiture-version: 1.0.0
      example:
        over100Million:
          label: 'Over $100,000,000.00'
          code: '4'
          range: '[100000000.00,]'
          variants:
            fr:
              label: Plus de $10M
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelItem/v1.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/simpleLabel'
        - properties:
            - variants
            - code
            - hidden
            - range
      properties:
        label:
          type: string
          description: A label or title which may be used as labels or other UI controls which present a value.
          example: Board of Directors
        description:
          type: string
          description: A more detailed localized description of a localizable label.
        variants:
          description: >-
            The language-specific variants of this label. The keys in this object are [RFC 7231](https://tools.ietf.org/html/rfc7231#section-3.1.3.1)
            language codes.
          x-apiture-key: languageCode
          type: object
          additionalProperties:
            $ref: '#/components/schemas/simpleLabel'
          example:
            en:
              label: More then $10M
            es:
              label: Mas de $10M
            fr:
              label: Plus de $10M
        code:
          type: string
          description: 'If the localized value is associated with an external standard or definition, this is a lookup code or key or URI for that value.'
          example: '3'
          minLength: 1
        hidden:
          type: boolean
          description: 'If `true`, this item is normally hidden from the User Interface.'
        range:
          description: >-
            The range of values, if the item describes a bounded numeric value. This is range notation such as `[min,max]`, `(exclusiveMin,max]`,
            `[min,exclusiveMax)`, or `(exclusiveMin,exclusiveMax)`. For example, `[0,100)` is the range greater than or equal to 0 and less than 100.
            If the *min* or *max* value are omitted, that end of the range is unbounded. For example, `(,1000.00)` means less than 1000.00 and
            `[20000.00,]` means 20000.00 or more. The ranges do not overlap or have gaps.
          type: string
          pattern: '^[\[\(](-?(0|[1-9][0-9]*)(\.[0-9]+)?)?,(-?(0|[1-9][0-9]*)(\.[0-9]+)?)?[\]\)]$'
      type: object
      x-apiture-flattened: true
    link:
      x-apiture-version: 1.0.0
      title: Link (v1.0.0)
      description: >-
        Describes a hypermedia link within a `_links` object in HAL representations. In Apiture APIs, links are [HAL
        links](https://developer.apiture.com/docs/concepts/links), but Apiture APIs do not use the `name` or `hreflang` properties of HAL. Apiture
        links _may_ include a `method` property.


        This schema was resolved from [`common/link`](https://production.api.apiture.com/schemas/common/link/v1.0.0/model.json).
      required:
        - href
      properties:
        href:
          type: string
          format: uri
          description: The URI or URI template for the resource/operation this link refers to.
        type:
          type: string
          description: The media type for the resource.
        templated:
          type: boolean
          description: 'If true, the link''s href is a [URI template](https://tools.ietf.org/html/rfc6570).'
        title:
          type: string
          description: An optional human-readable localized title for the link.
        deprecation:
          type: string
          format: uri
          description: 'If present, the containing link is deprecated and the value is a URI which provides human-readable text information about the deprecation.'
        profile:
          type: string
          format: uri
          description: 'The URI of a profile document, a JSON document which describes the target resource/operation.'
      example:
        href: /contacts/contacts/328f6bf6-d762-422f-a077-ab91ca4d0b6f
        title: Applicant
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/link/v1.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    simpleLabel:
      title: Simple Label (v1.0.0)
      description: |-
        A text label and optional description.

        This schema was resolved from [`common/simpleLabel`](https://production.api.apiture.com/schemas/common/simpleLabel/v1.0.0/model.json).
      x-apiture-version: 1.0.0
      type: object
      required:
        - label
      properties:
        label:
          type: string
          description: A label or title which may be used as labels or other UI controls which present a value.
          example: Board of Directors
        description:
          type: string
          description: A more detailed localized description of a localizable label.
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/simpleLabel/v1.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-flattened: true
  responses:
    '304':
      description: Not Modified. The resource has not been modified since it was last fetched.
    '400':
      description: >-
        Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will contain
        details about the request error.


        This error response may have one of the following `type` values:

        * [`malformedRequestBody`](#err-malformedRequestBody)
      x-apiture-errors:
        - malformedRequestBody
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    '412':
      description: >-
        Precondition Failed. The supplied `if-Match` header value does not match the most recent `ETag` response header value. The resource has
        changed in the interim.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    '422':
      description: >-
        Unprocessable Entity. One or more of the query parameters was well formed but otherwise invalid. The `_error` field in the response will
        contain details about the request error.


        This error response may have one of the following `type` values:

        * [`updateFailed`](#err-updateFailed)
      x-apiture-errors:
        - updateFailed
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404Task:
      description: >-
        Not Found. There is no such task resource at the specified `{taskId}` The `_error` field in the response will contain details about the
        request error.


        This error response may have one of the following `type` values:

        * [`invalidTaskId`](#err-invalidTaskId)
      x-apiture-errors:
        - invalidTaskId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404TaskDefinition:
      description: >-
        Not Found. There is no such task definition resource at the specified `{taskDefinitionId}` The `_error` field in the response will contain
        details about the request error.


        This error response may have one of the following `type` values:

        * [`invalidTaskDefinitionId`](#err-invalidTaskDefinitionId)

        * [`invalidTaskDefinitionRevisionId`](#err-invalidTaskDefinitionRevisionId)
      x-apiture-errors:
        - invalidTaskDefinitionId
        - invalidTaskDefinitionRevisionId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404Workflow:
      description: >-
        Not Found. There is no such workflow resource at the specified `{workflowId}` The `_error` field in the response will contain details about
        the request error.


        This error response may have one of the following `type` values:

        * [`invalidWorkflowId`](#err-invalidWorkflowId)

        * [`invalidWorkflowDefinitionRevisionId`](#err-invalidWorkflowDefinitionRevisionId)
      x-apiture-errors:
        - invalidWorkflowId
        - invalidWorkflowDefinitionRevisionId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404WorkflowDefinition:
      description: >-
        Not Found. There is no such workflow definition resource at the specified `{workflowDefinitionId}`. The `_error` field in the response will
        contain details about the request error.


        This error response may have one of the following `type` values:

        * [`invalidWorkflowDefinitionId`](#err-invalidWorkflowDefinitionId)
      x-apiture-errors:
        - invalidWorkflowDefinitionId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    204Deleted:
      description: No Content. The resource was deleted successfully.
  parameters:
    taskIdPathParam:
      name: taskId
      description: The unique identifier of this task. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    filterQueryParam:
      name: filter
      in: query
      description: 'Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).'
      schema:
        type: string
    qQueryParam:
      name: q
      in: query
      description: 'Optional search string. See [searching](https://developer.apiture.com/docs/concepts/searching).'
      schema:
        type: string
    stateQueryParam:
      name: state
      in: query
      description: >-
        Subset the collection to those whose `state` matches this value. Use `|` to separate multiple values. For example, `?state=pending` matches
        only items whose `state` is `pending`; `?state=removed|inactive` matches items whose `state` is `removed` or `inactive`. This is combined with
        an implicit `and` with other filters if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
        enum:
          - pending
          - definition
          - blocked
          - removed
          - running
          - paused
          - completed
          - failed
          - canceled
    nameQueryParam:
      name: name
      in: query
      description: >-
        Subset the collection to those with this name value. Use `|` to separate multiple values. For example, `?name=Bartell` will match only items
        whose name is `Bartell`; `?name=Bartell|kirsten` will match items whose name is `Bartell` or `kirsten`. This is combined with an implicit
        `and` with other filters if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    typeQueryParam:
      name: type
      in: query
      description: >-
        Subset the collection to those with this exact type value. Use `|` to separate multiple values. For example, `?type=Personal%20Savings`
        matches only items whose type is `Personal Savings`; `?type=Personal%20Savings|Investment%20Account` matches items whose type is `Personal
        Savings` or `Investment Account`. This is combined with an implicit `and` with other filters if they are used. See
        [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    domainQueryParam:
      name: domain
      in: query
      description: >-
        Subset the collection to those with this `domain` value. Use `|` to separate multiple values. For example,
        `?domain=http://api.apiture.com/acctApps` matches only items whose domain is `http://api.apiture.com/acctApps`;
        `?domain=http://api.apiture.com/acctApps|http:/api.apiture.com/domains/tasks/forms` will match items  whose domain is
        `http://api.apiture.com/acctApps` or `http:/api.apiture.com/domains/tasks/forms`. This is combined with an implicit `and` with other filters
        if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    labelQueryParam:
      name: label
      in: query
      description: >-
        Subset the collection to those with this label value. Use `|` to separate multiple values. For example, `?label=Email%20Verification` matches
        only items whose label is `Email Verification`; `?label=Email%20Verification|Account%20Verification` will match items whose label is `Email
        Verification` or `Account Verification`. This is combined with an implicit `and` with other filters if they are used. See
        [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    taskDefinitionIdPathParam:
      name: taskDefinitionId
      description: The unique identifier of this task definition. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    taskQueryParam:
      name: task
      in: query
      required: true
      description: A server-supplied value which identifies the task instance.
      schema:
        type: string
    valueNamePathParam:
      name: valueName
      description: >-
        The unique identifier of a value in a workflow item. This is the name of the value in the `schema`. A `{valueName}` must be a simple
        identifier following the pattern _`letter [letter | digit | '-' | '_']*`_
      in: path
      required: true
      schema:
        type: string
    workflowIdPathParam:
      name: workflowId
      description: The unique identifier of this workflow. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    workflowQueryParam:
      name: workflow
      in: query
      required: true
      description: A server-supplied value which identifies the workflow instance.
      schema:
        type: string
    workflowEmbedQueryParam:
      name: embed
      in: query
      required: false
      description: |-
        The resources to embed within the `_embedded` object.  This is a comma separated list which can include any of the following options:
          * *`tasks`* - A list of summary tasks specific to this workflow
            instance.
          * *`nextInteractiveTask`* - The next visible and running task within
            this workflow instance.

        `tasks` will be embedded by default even if no `embed` query parameters are specified.
      schema:
        type: string
    workflowDefinitionIdPathParam:
      name: workflowDefinitionId
      description: The unique identifier of this workflow definition. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    revisionIdParam:
      name: revisionId
      description: >-
        The identifier for a revision of this resource. Revision identifiers use [RFC 3339](https://tools.ietf.org/html/rfc3339) format:
        `YYYY-MM-DDThh:mm:ss.sssZ`.
      in: path
      required: true
      schema:
        type: string
    ifMatchHeaderParam:
      name: If-Match
      description: The entity tag that was returned in the `ETag` response. This must match the current entity tag of the resource.
      in: header
      schema:
        type: string
    ifNoneMatchHeaderParam:
      name: If-None-Match
      description: >-
        The entity tag that was returned in the `ETag` response. If the resource's current entity tag matches, the `GET` will return 304 (Not
        Modified) and no response body, else the resource representation will be returned.
      in: header
      schema:
        type: string
  requestBodies:
    task:
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/task'
        application/json:
          schema:
            $ref: '#/components/schemas/task'
      required: true
    attributes:
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/attributes'
        application/json:
          schema:
            $ref: '#/components/schemas/attributes'
      required: true
    workflow:
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/workflow'
        application/json:
          schema:
            $ref: '#/components/schemas/workflow'
      required: true
  securitySchemes:
    apiKey:
      type: apiKey
      name: API-Key
      in: header
      description: >-
        API Key based authentication. Each client application must pass its private, unique API key, allocated in the developer portal, via the
        `API-Key: {api-key}` request header.
    accessToken:
      type: oauth2
      description: >-
        OAuth2 client access token authentication. The client authenticates against the server at `authorizationUrl`, passing the client's private
        `clientId` (and optional `clientSecret`) as part of this flow. The client obtains an access token from the server at `tokenUrl`. It then
        passes the received access token via the `Authorization: Bearer {access-token}` header in subsequent API calls. The authorization process also
        returns a refresh token which the client should use to renew the access token before it expires.
      flows:
        authorizationCode:
          authorizationUrl: 'https://auth.devbank.apiture.com/auth/oauth2/authorize'
          tokenUrl: 'https://api.devbank.apiture.com/auth/oauth2/token'
          scopes:
            data/read: 'Read access to non-account, non-profile data.'
            data/write: 'Write (update) access to non-account, non-profile data.'
            data/delete: 'Delete access to non-account, non-profile data.'
            data/full: 'Full access to non-account, non-profile data.'
