The workflowId of a step must reference an existing workflow.
| Arazzo | Compatibility |
|---|---|
| 1.x | ✅ |
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
workflowIdmust match a workflow in theworkflowslist 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 thearazzotype.
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.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default: error (in recommended configuration). |
An example configuration:
rules:
spec-step-workflowId-defined: error
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
- spec-sourceDescriptions-defined
- spec-step-mutually-exclusive-fields
- workflowId-unique
- workflow-dependsOn
- Rule source
- Step Object in the Arazzo specification