# How to lint Arazzo workflows

To lint an Arazzo workflow, run `npx @redocly/cli@latest lint my-workflow.arazzo.yaml`.
Redocly CLI validates the file against the Arazzo Specification and its built-in Arazzo rules, and loads the OpenAPI source descriptions to check that every step's `operationId` exists.
Linting doesn't call the API, so it's fast enough to run after every edit and on every pull request.

Before you run your Warp API workflow with Respect, check the file for syntax and reference errors.
A typo in an `operationId` or a broken reference will fail the run before you reach 1889.
This guide lints the Warp API Tesla blueprint workflow and shows how Redocly CLI reports a broken reference.

## Why lint Arazzo?

Linting checks your Arazzo file for errors before you run it.
It ensures:

- **Syntax is clean**: No missing colons or misnested YAML.
- **References work**: Every `operationId` (e.g., `warpApi.timeTravel`) matches the Warp OpenAPI spec.
- **Data flow is valid**: Outputs are defined before later steps reference them, and `dependsOn` targets exist.

Unlike Respect, Redocly CLI's `lint` command is a static check that doesn't call the API.

## Set up Redocly CLI

Start with your Arazzo file, such as `warp.arazzo.yaml` from the Warp example.
Run Redocly CLI with `npx` to use the latest version:

```bash
npx @redocly/cli@latest lint warp.arazzo.yaml
```

### Lint the Tesla blueprint workflow

Here's the workflow we've been working with:

```yaml
arazzo: "1.0.1"
info:
  title: "Tesla Blueprint Retrieval Guide"
  version: "1.0.0"
sourceDescriptions:
  - name: "warpApi"
    url: "https://api.warp.example.com/v1/openapi.yaml"
    type: "openapi"
workflows:
  - workflowId: "retrieveTeslaBlueprint"
    summary: "Travel to 1889 to retrieve Tesla's lost blueprint and return safely"
    parameters:
      - name: "Authorization"
        in: "header"
        value: "Bearer {$inputs.token}"
    steps:
      - stepId: "setHomeAnchor"
        operationId: "warpApi.setAnchor"
        description: "Set an anchor in 2025."
        requestBody:
          payload:
            timestamp: "2025-02-19T12:00:00Z"
            description: "Mission start point - 2025 base"
        outputs:
          anchorId: $response.body#/id
      - stepId: "create1889Timeline"
        operationId: "warpApi.createTimeline"
        description: "Create a timeline to 1889."
        requestBody:
          payload:
            name: "Tesla Mission 1889"
            destination_time: "1889-03-10T23:50:00Z"
        outputs:
          timelineId: $response.body#/id
      - stepId: "jumpTo1889"
        operationId: "warpApi.timeTravel"
        description: "Travel to 1889."
        requestBody:
          payload:
            destination: $steps.create1889Timeline.outputs.timelineId
      - stepId: "registerBlueprint"
        operationId: "warpApi.registerItem"
        description: "Register Tesla's blueprint."
        requestBody:
          payload:
            description: "Tesla's lost blueprint"
        outputs:
          itemId: $response.body#/id
      - stepId: "returnTo2025"
        operationId: "warpApi.timeTravel"
        description: "Return to 2025 with the blueprint."
        requestBody:
          payload:
            destination: $steps.setHomeAnchor.outputs.anchorId
            items_transported:
              - $steps.registerBlueprint.outputs.itemId
```

## Catch a broken reference

Here's what happens when a step's `operationId` has a typo.
In the walkthrough's `warp.arazzo.yaml`, change `api-reference.setAnchor` to `api-reference.setAnchr` and lint the file:

```text
npx @redocly/cli@latest lint warp.arazzo.yaml

No configurations were provided -- using built in recommended configuration by default.

validating warp.arazzo.yaml...
[1] warp.arazzo.yaml:28:22 at #/workflows/0/steps/0/operationId

The operation `api-reference.setAnchr` is not defined in any of the source descriptions.

26 | steps:
27 |   - stepId: setAnchorToCurrentTime
28 |     operationId: api-reference.setAnchr
   |                  ^^^^^^^^^^^^^^^^^^^^^^
29 |     description: Set an anchor to the current time.
30 |     outputs:

Error was generated by the spec-step-operationId-resolved rule.

Reference: https://redocly.com/docs/cli/rules/arazzo/spec-step-operationid-resolved

warp.arazzo.yaml: validated in 14ms

❌ Validation failed with 1 error.
run `redocly lint --generate-ignore-file` to add all problems to the ignore file.
```

Respect would have failed at the same step at runtime.
The linter finds it in milliseconds, without sending a request.

## What the linter checks

Redocly CLI has a family of [built-in Arazzo rules](/docs/cli/rules/built-in-rules#arazzo-rules), for example:

- `spec-step-operationId-resolved`: every step's `operationId` resolves to an operation in a source description.
- `stepId-unique` and `workflowId-unique`: IDs are unique.
- `outputs-defined`: an output is defined before a later step uses it.
- `workflow-dependsOn`: workflows listed in `dependsOn` exist and are unique.
- `sourceDescription-type`: each source description has a supported `type`.

There are also rules for the extensions that Respect supports, such as `x-security`.
Pick a ruleset (`spec`, `minimal`, `recommended`, or `recommended-strict`) and adjust individual rules in `redocly.yaml`:

```yaml
extends:
  - recommended

rules:
  sourceDescription-type: error
```

To fail pull requests with annotations on the problem lines, run `lint` with `--format=github-actions` in CI.
The [Lint Arazzo with Redocly CLI](/docs/cli/guides/lint-arazzo) guide shows a complete GitHub Actions setup.

## Tips for linting workflows

- Check references early: Lint before Respect to avoid runtime 404s from bad `operationIds`.
- Fix dependencies: Double-check `$steps` references.
- Mock first: If sourceDescriptions URLs are live, test with mocks to avoid network flakiness.

When the file lints clean, run it against the API: see [How to test API workflows with Arazzo](/learn/arazzo/testing-arazzo-workflows).
Other Arazzo linters, such as Spectral, are listed in [Arazzo specification tools](/learn/arazzo/arazzo-tools).
