# Documenting API workflows

An OpenAPI file lists the Warp API's endpoints, such as `timeTravel` and `setAnchor`, but it doesn't show _how_ to call them together.
Arazzo documents those multi-step flows in a format that both people and tools can read.
This guide uses Arazzo to document a Warp API workflow that retrieves Tesla's blueprint from 1889.

## Why Arazzo beats traditional docs

OpenAPI describes _what_ each endpoint does (its paths, parameters, and responses), but not the order to call them in.
A developer new to Warp sees `createTimeline` and `timeTravel` and has to guess which runs first, or what a temporal anchor is for.
Arazzo puts the sequence, the dependencies, and the intent in one place.
Your team gets a time-travel manual instead of a parts list: faster onboarding, fewer paradoxes.

With Arazzo, you get:

- **Clarity**: Summaries and descriptions explain the big picture and each step.
- **Context**: Dependencies show what relies on what (e.g., travel needs a timeline).
- **Automation**: Tools can render it as interactive docs or test scripts.

## How to document with Arazzo

Three Arazzo fields carry most of the human-readable documentation:

- **`summary`** (workflow-level): A one-liner of the mission.
- **`description`** (workflow or step): Extra context for humans.
- **`steps`**: The ordered API calls, each with a clear `stepId` tied to a Warp operation.

Here's a documented Warp workflow:

```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"
    description: |-
      This workflow guides you through setting a temporal anchor in the present, creating a timeline to March 10, 1889, traveling back to retrieve Nikola Tesla's lost blueprint, and returning home. Follow these steps to avoid paradoxes and cosmic vaporization.
    steps:
      - stepId: "setHomeAnchor"
        operationId: "warpApi.setAnchor"
        description: "Set an anchor in 2025 to return to after the mission."
        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 targeting March 10, 1889, before the fire destroys Tesla's lab."
        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 using the created timeline."
        requestBody:
          payload:
            destination: $steps.create1889Timeline.outputs.timelineId
      - stepId: "registerBlueprint"
        operationId: "warpApi.registerItem"
        description: "Register Tesla's blueprint as an item for transport back to 2025."
        requestBody:
          payload:
            description: "Tesla's lost blueprint - oscillating current design"
        outputs:
          itemId: $response.body#/id
      - stepId: "returnTo2025"
        operationId: "warpApi.timeTravel"
        description: "Return to the 2025 anchor, bringing the blueprint."
        requestBody:
          payload:
            destination: $steps.setHomeAnchor.outputs.anchorId
            items_transported:
              - $steps.registerBlueprint.outputs.itemId
```

## How the workflow is structured

1. **Workflow summary**: "Travel to 1889 to retrieve Tesla's lost blueprint and return safely" states the goal in one line.
2. **Description**: The multiline description explains the goal and the stakes for new readers.
3. **Steps**: Each step has a short description that says why it runs (for example, "before the fire destroys Tesla's lab").
4. **Flow**: Runtime expressions (`$steps.create1889Timeline.outputs.timelineId`) show the data handoff between steps.
