Skip to main content

Arazzo in Apiome

An Arazzo document describes workflows: sequences of API calls, each step calling an operation of an OpenAPI (or, in Arazzo 1.1, AsyncAPI) description, with the inputs a workflow takes, the outputs it returns, and what happens when a step succeeds or fails. Apiome treats Arazzo 1.0.x and 1.1.x as first-class: you can bring a workflow in with the API files it calls, read it as a flow, check that every step points at a real operation, compare two revisions, export it back, and run it against a deployment or a mock.

Each part has its own page. This page shows how they fit together.

When to use it​

  • You document how an API is meant to be used, not only what it offers. A checkout, an onboarding or an adopt-a-pet flow lives next to the APIs it calls, with its steps resolved to their operations.
  • A workflow must keep working as its APIs change. A change to a workflow's inputs, outputs, criteria or sources is graded like any other breaking change, and a stored workflow can be run in CI against a mock or a staging deployment.
  • Agents or partners follow your workflows. The steps, their success criteria and their outputs are readable from the UI, the CLI and the REST API.

The lifecycle at a glance​

You want to…WhereDetails
Bring in a workflow with the OpenAPI and AsyncAPI files it callsImport dialog, or apiome import arazzo <archive or folder>Import an Arazzo workflow with its API files
Read its steps, inputs, outputs and success and failure pathsThe Workflows tab of a catalog item or project; apiome arazzo list and apiome arazzo showArazzo workflows
Check that every step resolved and every source was foundapiome arazzo validate, or apiome arazzo validate FILE for a local documentArazzo workflow records
Lint its structure — expressions, criteria, goto targets, ids, inputs and outputsThe Quality score of the revision; GET /v1/lint/rules lists the rulesLint rules
Compare two revisions and see what breaks a workflow's callersapiome diff, the diff GitHub Action, the publish check and catalog change reportsArazzo workflow changes
Export it back, or start workflows for an API you already haveExport dialog → REST & HTTP → ArazzoArazzo from any source, Arazzo exports
Run it, step by step, against a deployment or a mockapiome arazzo run <workflowId> --target <target>Run a workflow against a target

Arazzo 1.0 and 1.1​

Every surface accepts both lines and keeps the version a document declares:

  • Import and validation check a document against the JSON Schema for its own version, 1.0.x or 1.1.x, so a 1.1 document is not judged by 1.0 rules.
  • Arazzo 1.1 additions come in and go back out unchanged: AsyncAPI source descriptions, steps that wait on an event channel (channelPath, with action, correlationId and timeout), workflow-level parameters, querystring parameters and $self.
  • Export writes 1.0 or 1.1 as you choose. A workflow with AsyncAPI sources needs 1.1, because 1.0 cannot express them; asking for 1.0 is refused rather than silently dropping the sources.
  • Round trips are tested against the OpenAPI Initiative's own examples and files from Redocly, Spectral and Specmatic; the fidelity report on the Arazzo card names any difference.

Lint rules​

Every Arazzo revision is linted by the arazzo rule pack, under the rules of the version it declares. All of these are errors by default; a style guide can turn any of them down or off.

The pack checks that…Rule
each step's operationId or operationRef names an operation of a declared sourcearazzo.dangling-operation-id, arazzo.unresolvable-operation-ref
every $-expression parses — the finding gives the position where it stopsarazzo.runtime-expression-invalid
a jsonpath or regex success criterion names its contextarazzo.success-criteria-context-required
a goto action's stepId or workflowId existsarazzo.on-success-target-unresolved, arazzo.on-failure-target-unresolved
every $components.* reference names a declared componentarazzo.component-ref-unresolved
step ids are unique in their workflow, and workflow ids in the documentarazzo.step-id-duplicate, arazzo.workflow-id-duplicate
workflow dependsOn chains do not loop backarazzo.depends-on-cycle
a parameter's in is one its step's source defines: path, query, header or cookie for OpenAPI (plus querystring in 1.1); header or channel for an AsyncAPI steparazzo.parameter-in-invalid
workflow inputs are valid JSON Schema 2020-12arazzo.inputs-schema-invalid
every output is a runtime expression (or, from 1.1, a selector object)arazzo.outputs-expression-invalid
each source description's type is one the version defines — asyncapi only from 1.1arazzo.source-description-type-invalid, arazzo.async-source-before-1-1

Two warnings round out the pack: arazzo.missing-success-criteria and arazzo.unused-workflow-input.

The operationRef rule shipped as arzzo.unresolvable-operation-ref. Findings now carry arazzo.unresolvable-operation-ref, and the old id is kept as an alias: a style guide that names it, a stored finding and a waiver recorded against it all still match.

Fixes​

Three Arazzo findings can be repaired by a deterministic fix: a repeated stepId, a step with no successCriteria whose embedded source operation declares a 2xx response, and an arazzo: 1.0.x marker on a document that uses a 1.1-only feature. See Fixable Arazzo rules.

How the pieces fit​

  1. Import stores the workflow as records. Each workflow and each of its steps is stored on the revision, and each step's operationId or operationRef is matched to the operation it calls — in the same archive or repository selection, in a spec already in the catalog, or fetched from its URL. A step that matches nothing is kept as written and marked unresolved, with the reason; so is a source description nothing could find.
  2. Every read uses those records. The Workflows tab, apiome arazzo list|show|validate and the GET /v1/workflows/… routes all read the same workflows, steps and resolution states.
  3. Changes are graded by workflow rules. Comparing two revisions grades each change by what a workflow's callers depend on: a newly required input or a removed output is Breaking, a changed success criterion is flagged for review, an added optional input is Safe. A change no rule covers is reported as breaking.
  4. A run sends the steps in order. apiome arazzo run builds each request from the inputs and earlier steps' outputs, judges each step's success criteria with expected and actual values, and follows goto, retry and end. It sends only GET, HEAD and OPTIONS steps unless the target allows writes, the run opts in, and a fixture names the operation. Every run is recorded as verification evidence.

From the command line​

apiome import arazzo ./checkout.zip --dry-run # what would come in
apiome import arazzo ./checkout/ --root checkout.arazzo.yaml
apiome arazzo list --catalog <item-uuid> # workflows and resolution
apiome arazzo show checkout --catalog <item-uuid>
apiome arazzo validate checkout.arazzo.yaml # local schema check
apiome arazzo validate --catalog <item-uuid> # exit 7 when a step did not resolve
apiome arazzo run checkout --catalog <item-uuid> --target checkout-mock --input cartId=42

See apiome arazzo and apiome import arazzo in the CLI reference, and Arazzo workflows in the REST reference.

Where next​