Skip to content
Last updated

spec-step-workflowId-defined

The workflowId of a step must reference an existing workflow.

ArazzoCompatibility
1.x✅

Design principles

A step can run another workflow with the workflowId field. The Arazzo specification defines the field as a reference to an existing workflow within the Arazzo description. A tool cannot run a step that points to a missing workflow.

The spec-step-workflowId-defined rule checks both forms of the field:

  • A plain workflowId must match a workflow in the workflows list of the same document.
  • A reference to a workflow of another Arazzo document must have the form $sourceDescriptions.<name>.<workflowId>, and the source description it names must have the arazzo type.

The spec-sourceDescriptions-defined rule reports a reference to a source description that is not defined. The rule does not open the other Arazzo document, so it does not check that the workflow exists there.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default: error (in recommended configuration).

An example configuration:

rules:
  spec-step-workflowId-defined: error

Examples

Given the following configuration:

rules:
  spec-step-workflowId-defined: error

Example of an incorrect step that references a workflow the document does not define:

workflows:
  - workflowId: place-order
    steps:
      - stepId: create-order
        operationId: cafe-api.createOrder
  - workflowId: order-and-pay
    steps:
      - stepId: order
        workflowId: submit-order

Example of correct steps that reference a workflow of the same document and a workflow of an Arazzo source description:

sourceDescriptions:
  - name: cafe-api
    type: openapi
    url: openapi.yaml
  - name: payments
    type: arazzo
    url: payments.arazzo.yaml
workflows:
  - workflowId: place-order
    steps:
      - stepId: create-order
        operationId: cafe-api.createOrder
  - workflowId: order-and-pay
    steps:
      - stepId: order
        workflowId: place-order
      - stepId: pay
        workflowId: $sourceDescriptions.payments.pay-for-order

Resources