Skip to content
Last updated

Document workflows for multiple APIs with Arazzo

What is Arazzo?

Arazzo is an OpenAPI Initiative specification for describing workflows and use cases that span multiple APIs. For a more detailed introduction, see What is Arazzo?.

Traditional API documentation is like a set of drawings of the individual rooms in a building. You can see how the kitchen is laid out, the dimensions of the bathroom, and where each electrical outlet sits.

Traditional API Docs

Individual Endpoints

Arazzo

Connected Workflows

Isolated Rooms

Complete Building

Traditional API Docs

Individual Endpoints

Arazzo

Connected Workflows

Isolated Rooms

Complete Building

What the drawings don't show is how people move through the building, from the front door to the kitchen and on to the dining room. Endpoint docs have the same gap: they don't show how a caller moves from one endpoint to the next to finish a task.

Arazzo fills that gap. As OpenAPI did for individual HTTP endpoints, Arazzo provides a standard, machine-readable format for multi-step workflows that involve multiple API calls.

The Arazzo specification enables you to:

  • Document complex, multi-step workflows in a format that's both human and machine-readable
  • Document dependencies, data flow, and business logic across APIs so teams know how services work together
  • Test complete user journeys rather than just individual API calls

Documenting complete workflows ties the technical implementation to business requirements. Product managers can trace how features work across services, developers can see the downstream impact of their code changes, and QA teams can validate full user journeys instead of isolated endpoints.

Arazzo began in a working group formed in 2021 under the OpenAPI Initiative and has since become a full specification.

As Redocly CEO Adam Altman wrote in the Arazzo roadmap blog post, Arazzo's workflow approach matches how Redocly has thought about APIs for years. Respect, which started as an internal Redocly product and is now available to everyone, tests API workflows rather than single endpoints. When we found the Arazzo project, we saw a chance to contribute to a shared standard for workflow documentation.

Why use Arazzo

Endpoint documentation tells callers what each operation does on its own, not how operations work together in practice. For more background, read Why Arazzo Matters.

Arazzo gives you a standard way to document workflows that use multiple APIs to complete a task. Without it, API producers fall back on workarounds:

  • Using separate tools like Postman Collections to demonstrate workflow sequences
  • Writing external guides that go out of date quickly
  • Using non-standard formats that don't match how people browse OpenAPI documentation

API

Traditional

Individual Endpoints

Static Documentation

Isolated Components

Arazzo

Connected Workflows

Dynamic Documentation

Integrated Systems

API

Traditional

Individual Endpoints

Static Documentation

Isolated Components

Arazzo

Connected Workflows

Dynamic Documentation

Integrated Systems

These workarounds live outside your API descriptions, so they drift out of sync with the implementation. When an API changes, the external workflow docs often don't get updated.

By keeping workflow documentation next to your OpenAPI descriptions, Arazzo helps you:

  • Give internal and external API consumers endpoint reference and workflow docs in one place
  • Show what's possible with your APIs, not just which endpoints exist
  • Support onboarding, testing, and monitoring

Redocly adopted this approach because it addresses two problems:

  1. It reduces drift between documentation and implementation.
  2. It makes sure APIs can be run, tested, and monitored end to end.

How your APIs benefit from Arazzo

Arazzo turns static API reference docs into runnable workflow documentation.

It also changes how API producers think about what they ship. Writing Arazzo workflows before you ship an API forces you to explain how people will use it in real scenarios. The focus moves from documenting endpoints to documenting outcomes.

API Producer

Documentation

Consumer Understanding

Successful Integration

API Producer

Documentation

Consumer Understanding

Successful Integration

API producers often build good APIs and then leave consumers to work out how to combine them. Internal teams may have unit tests for individual endpoints, but that's different from describing sequences of calls across services that complete a business task. It's the difference between testing that a door closes and confirming that the whole fire evacuation route works.

External API benefits

For external APIs, Arazzo gives consumers step-by-step instructions instead of leaving them to piece endpoints together on their own.

For human developers, Arazzo avoids two common documentation problems:

  • Traditional guides and tutorials cost a lot to create, are hard to verify, and go out of date quickly
  • Without clear workflow documentation, developers often abandon APIs that don't immediately work for their use case

It also helps machine integrations, especially AI agents. As more development work involves AI, a machine-readable description of what your API can accomplish (not just which endpoints exist) becomes more useful.

workflows:
  - workflowId: createAndUpdateUser
    summary: Create a user and update their profile
    description: Shows how to create a user and then update their profile information
    steps:
      - stepId: createUser
        description: Create a user with basic information
        operationPath: '{$sourceDescriptions.users.url}#/paths/~1users/post'
        requestBody:
          payload:
            email: "john.doe@example.com"
            name: "John Doe"
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          userId: $response.body#/id
      - stepId: updateProfile
        description: Add additional profile information
        operationPath: '{$sourceDescriptions.users.url}#/paths/~1users~1{userId}/patch'
        parameters:
          - name: userId
            in: path
            value: $steps.createUser.outputs.userId
        requestBody:
          payload:
            address: "123 Main St"
            phoneNumber: "555-123-4567"
        successCriteria:
          - condition: $statusCode == 200

Internal API benefits

For internal APIs, Arazzo documents and verifies how services work together, not just whether each endpoint matches its own spec.

An API can meet every technical requirement and still be impractical in real use. Writing Arazzo workflows makes producers use their own APIs, which reveals gaps that consumers would otherwise find first.

Internal benefits include:

  • Confirming that APIs work together to support real business processes
  • Documenting dependencies between services that aren't obvious from individual API specs
  • Giving internal teams clear examples when they move to new API versions or features

How Arazzo works

Arazzo descriptions

If your OpenAPI descriptions are the room drawings, an Arazzo description is the circulation diagram that shows how people move between the rooms. It adds a workflow layer on top of your OpenAPI descriptions without changing them. For more on workflows and steps, see Understanding Workflows and Steps.

Outputs

Outputs

Variables

Variables

Variables

Workflow Step Relationships and Data Flow

Step 1

Step 2

Step 3

Success Criteria

Success Criteria

Success Criteria

Outputs

Outputs

Variables

Variables

Variables

Workflow Step Relationships and Data Flow

Step 1

Step 2

Step 3

Success Criteria

Success Criteria

Success Criteria

Arazzo descriptions are separate documents that reference your existing OpenAPI files. Arazzo files usually live next to the OpenAPI files in your repository and go through the same versioning and review process.

Arazzo File

Info

Source Descriptions

Workflows

Title

Version

Description

OpenAPI Specs

Steps

Step Success Criteria

Outputs

Arazzo File

Info

Source Descriptions

Workflows

Title

Version

Description

OpenAPI Specs

Steps

Step Success Criteria

Outputs

Here is a patient onboarding workflow that spans three healthcare APIs:

arazzo: 1.0.1
info:
  title: Healthcare Patient Onboarding
  version: 1.0.0
  description: |
    Complete patient onboarding workflow that spans multiple healthcare systems.
    This workflow demonstrates error handling, conditional paths, and data flow
    between different healthcare services.

sourceDescriptions:
  - name: patient-registry
    type: openapi
    url: ./patient-registry-api.yaml
  - name: insurance-verification
    type: openapi
    url: ./insurance-api.yaml
  - name: appointment-scheduling
    type: openapi
    url: ./scheduling-api.yaml

components:
  parameters:
    authorizationHeader:
      name: Authorization
      in: header
      required: true
  failureActions:
    standardRetry:
      name: standardRetry
      type: retry
      retryLimit: 3
      retryAfter: 1
  successActions:
    continueToNext:
      name: continueToNext
      type: goto
      stepId: next
    gotoScheduleAppointment:
      name: gotoScheduleAppointment
      type: goto
      stepId: scheduleAppointment
    gotoHandleUnverified:
      name: gotoHandleUnverified
      type: goto
      workflowId: handleUnverified

workflows:
  - workflowId: patientOnboarding
    summary: New Patient Registration and Scheduling
    description: |
      Complete workflow for registering a new patient, verifying insurance,
      and scheduling their first appointment. Includes error handling and
      conditional paths based on insurance verification results.
    inputs:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        dateOfBirth:
          type: string
          format: date
        insuranceProvider:
          type: string
        insuranceId:
          type: string
        preferredAppointmentDate:
          type: string
          format: date
    failureActions:
      - name: handleCriticalFailure
        type: goto
        workflowId: handleUnverified
        criteria:
          - condition: $statusCode >= 500

    steps:
      - stepId: registerPatient
        description: Create new patient record in the system
        operationPath: '{$sourceDescriptions.patient-registry.url}#/paths/~1patients/post'
        parameters:
          - $components.parameters.authorizationHeader
        requestBody:
          payload:
            firstName: {$inputs.firstName}
            lastName: {$inputs.lastName}
            dateOfBirth: {$inputs.dateOfBirth}
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          patientId: $response.body#/id
        onFailure:
          - $components.failureActions.standardRetry
        onSuccess:
          - $components.successActions.continueToNext

      - stepId: verifyInsurance
        description: Verify patient's insurance coverage
        operationPath: '{$sourceDescriptions.insurance-verification.url}#/paths/~1verify/post'
        parameters:
          - $components.parameters.authorizationHeader
        requestBody:
          payload:
            patientId: {$steps.registerPatient.outputs.patientId}
            provider: {$inputs.insuranceProvider}
            insuranceId: {$inputs.insuranceId}
        successCriteria:
          - condition: $statusCode == 200
          - context: $response.body
            condition: $.status
            type: jsonpath
        outputs:
          coverageDetails: $response.body#/coverage
          isVerified: $response.body#/status
        onSuccess:
          - $components.successActions.gotoScheduleAppointment
            criteria:
              - condition: $response.body.status == "verified"
          - $components.successActions.gotoHandleUnverified
            criteria:
              - condition: $response.body.status != "verified"

      - stepId: scheduleAppointment
        description: Schedule initial appointment
        operationPath: '{$sourceDescriptions.appointment-scheduling.url}#/paths/~1appointments/post'
        parameters:
          - $components.parameters.authorizationHeader
        requestBody:
          payload:
            patientId: {$steps.registerPatient.outputs.patientId}
            preferredDate: {$inputs.preferredAppointmentDate}
            appointmentType: "initial_consultation"
            insuranceDetails: {$steps.verifyInsurance.outputs.coverageDetails}
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          appointmentId: $response.body#/id
          appointmentDate: $response.body#/scheduledDate
        onSuccess:
          - $components.successActions.continueToNext

      - stepId: sendWelcomeEmail
        description: Send welcome email with appointment details
        operationPath: '{$sourceDescriptions.patient-registry.url}#/paths/~1notifications~1email/post'
        parameters:
          - $components.parameters.authorizationHeader
        requestBody:
          payload:
            patientId: {$steps.registerPatient.outputs.patientId}
            template: "welcome"
            data:
              appointmentId: {$steps.scheduleAppointment.outputs.appointmentId}
              appointmentDate: {$steps.scheduleAppointment.outputs.appointmentDate}
              insuranceStatus: {$steps.verifyInsurance.outputs.isVerified}
        successCriteria:
          - condition: $statusCode == 200

  - workflowId: handleUnverified
    summary: Handle Unverified Insurance Cases
    description: Manages cases where insurance verification fails
    steps:
      - stepId: notifyUnverified
        description: Send notification about unverified insurance
        operationPath: '{$sourceDescriptions.patient-registry.url}#/paths/~1notifications~1email/post'
        parameters:
          - $components.parameters.authorizationHeader
        requestBody:
          payload:
            patientId: {$steps.registerPatient.outputs.patientId}
            template: "insurance_unverified"
            data:
              provider: {$inputs.insuranceProvider}
              insuranceId: {$inputs.insuranceId}
        successCriteria:
          - condition: $statusCode == 200

This example shows several advanced Arazzo features:

  1. Workflow inputs: Defines structured input parameters with JSON Schema validation
  2. Error handling: Implements retry logic using reusable failure actions from components
  3. Flow control: Uses reusable success actions for both sequential and conditional branching
  4. Data flow: Shows how data flows between steps using outputs and inputs
  5. Success criteria: Uses JSONPath expressions for response validation at the step level
  6. Reusable components: Defines and references common parameters and actions using $components expressions
  7. Workflow-level actions: Defines a workflow-level failure action (handleCriticalFailure) that sends 5xx responses to the handleUnverified workflow
  8. Multi-service integration: Spans multiple healthcare systems (patient registry, insurance, scheduling)

Best practices for Arazzo descriptions include:

  • Focus on real-world use cases that consumers need to implement
  • Include every step in the workflow, from authentication to the final outcome
  • Extract values, such as IDs and tokens, and reuse them in later steps
  • Document expected responses at each step so tools can test the workflow
  • Use reusable components to maintain consistency and reduce duplication across workflows
  • Define success criteria at the step level, not the workflow level, as per the Arazzo Specification
  • Name all reusable objects in the components section as required by the specification
  • Apply criteria to component references when needed for conditional execution

Arazzo linting

Linting catches errors in your Arazzo files before they reach your API consumers. Learn more about Linting Arazzo Workflows.

Redocly CLI can lint Arazzo files to:

  • Validate that referenced OpenAPI operations exist
  • Check syntax and structure in your Arazzo documents
  • Verify that extracted variables are used correctly in later steps
  • Keep your workflow documentation consistent

Arazzo use cases and examples

Technical pattern examples

Authentication and authorization

Here's an example of an OAuth2 flow with multiple providers:

arazzo: 1.0.1
info:
  title: Multi-Provider OAuth2 Flow
  version: 1.0.0
  description: Demonstrates OAuth2 authentication flow with multiple identity providers

sourceDescriptions:
  - name: auth-service
    type: openapi
    url: ./auth-service.yaml
  - name: user-service
    type: openapi
    url: ./user-service.yaml

workflows:
  - workflowId: oauth2Authentication
    summary: OAuth2 Authentication with Multiple Providers
    description: Complete OAuth2 flow supporting multiple identity providers
    inputs:
      type: object
      properties:
        provider:
          type: string
          enum: [google, github, microsoft]
        redirectUri:
          type: string
          format: uri
    steps:
      - stepId: initiateAuth
        description: Start OAuth2 flow with selected provider
        operationPath: '{$sourceDescriptions.auth-service.url}#/paths/~1oauth2~1{provider}~1authorize/get'
        parameters:
          - name: provider
            in: path
            value: {$inputs.provider}
          - name: redirect_uri
            in: query
            value: {$inputs.redirectUri}
        successCriteria:
          - condition: $statusCode == 302
        outputs:
          authUrl: $response.headers#/location

      - stepId: handleCallback
        description: Process OAuth2 callback and exchange code for tokens
        operationPath: '{$sourceDescriptions.auth-service.url}#/paths/~1oauth2~1{provider}~1token/post'
        parameters:
          - name: provider
            in: path
            value: {$inputs.provider}
        requestBody:
          payload:
            code: {$inputs.code}
            redirect_uri: {$inputs.redirectUri}
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          accessToken: $response.body#/access_token
          refreshToken: $response.body#/refresh_token

      - stepId: getUserProfile
        description: Fetch user profile using obtained access token
        operationPath: '{$sourceDescriptions.user-service.url}#/paths/~1me/get'
        parameters:
          - name: Authorization
            in: header
            value: "Bearer {$steps.handleCallback.outputs.accessToken}"
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          userId: $response.body#/id
          email: $response.body#/email

Data synchronization

Example of a real-time data replication workflow:

arazzo: 1.0.1
info:
  title: Real-time Data Replication
  version: 1.0.0
  description: Demonstrates real-time data synchronization between systems

sourceDescriptions:
  - name: source-db
    type: openapi
    url: ./source-db-api.yaml
  - name: target-db
    type: openapi
    url: ./target-db-api.yaml

workflows:
  - workflowId: dataReplication
    summary: Real-time Data Replication Workflow
    description: Replicates data changes from source to target system
    steps:
      - stepId: captureChanges
        description: Capture changes from source system
        operationPath: '{$sourceDescriptions.source-db.url}#/paths/~1changes/get'
        parameters:
          - name: since
            in: query
            value: {$inputs.lastSyncTimestamp}
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          changes: $response.body#/changes
          newTimestamp: $response.body#/timestamp

      - stepId: applyChanges
        description: Apply changes to target system
        operationPath: '{$sourceDescriptions.target-db.url}#/paths/~1sync/post'
        requestBody:
          payload:
            changes: {$steps.captureChanges.outputs.changes}
        successCriteria:
          - condition: $statusCode == 200
        onFailure:
          - name: retryOnConflict
            type: retry
            criteria:
              - condition: $statusCode == 409
            retryLimit: 3
            retryAfter: 1

Business process examples

Customer journey workflows

Example of a subscription management workflow:

arazzo: 1.0.1
info:
  title: Subscription Management
  version: 1.0.0
  description: Complete subscription lifecycle management workflow

sourceDescriptions:
  - name: subscription-service
    type: openapi
    url: ./subscription-api.yaml
  - name: billing-service
    type: openapi
    url: ./billing-api.yaml
  - name: notification-service
    type: openapi
    url: ./notification-api.yaml

workflows:
  - workflowId: subscriptionLifecycle
    summary: Subscription Lifecycle Management
    description: Handles the complete lifecycle of a subscription
    inputs:
      type: object
      properties:
        customerId:
          type: string
        planId:
          type: string
        paymentMethodId:
          type: string
    steps:
      - stepId: createSubscription
        description: Create new subscription
        operationPath: '{$sourceDescriptions.subscription-service.url}#/paths/~1subscriptions/post'
        requestBody:
          payload:
            customerId: {$inputs.customerId}
            planId: {$inputs.planId}
            paymentMethodId: {$inputs.paymentMethodId}
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          subscriptionId: $response.body#/id
        onSuccess:
          - type: goto
            stepId: processInitialPayment

      - stepId: processInitialPayment
        description: Process initial subscription payment
        operationPath: '{$sourceDescriptions.billing-service.url}#/paths/~1payments/post'
        requestBody:
          payload:
            subscriptionId: {$steps.createSubscription.outputs.subscriptionId}
            amount: {$response.body#/amount}
        successCriteria:
          - condition: $statusCode == 200
        onFailure:
          - name: handlePaymentFailure
            type: goto
            workflowId: handleFailedPayment
            criteria:
              - condition: $statusCode == 402
        onSuccess:
          - type: goto
            stepId: sendWelcomeEmail

      - stepId: sendWelcomeEmail
        description: Send welcome email to new subscriber
        operationPath: '{$sourceDescriptions.notification-service.url}#/paths/~1notifications~1email/post'
        requestBody:
          payload:
            template: "subscription_welcome"
            data:
              subscriptionId: {$steps.createSubscription.outputs.subscriptionId}
              customerId: {$inputs.customerId}
        successCriteria:
          - condition: $statusCode == 200

  - workflowId: handleFailedPayment
    summary: Handle Failed Payment
    description: Manages cases where initial payment fails
    steps:
      - stepId: notifyPaymentFailure
        description: Send notification about failed payment
        operationPath: '{$sourceDescriptions.notification-service.url}#/paths/~1notifications~1email/post'
        requestBody:
          payload:
            template: "payment_failed"
            data:
              subscriptionId: {$steps.createSubscription.outputs.subscriptionId}
              customerId: {$inputs.customerId}
        successCriteria:
          - condition: $statusCode == 200

Operational workflows

Example of a deployment workflow:

arazzo: 1.0.1
info:
  title: Service Deployment
  version: 1.0.0
  description: Automated service deployment workflow

sourceDescriptions:
  - name: deployment-service
    type: openapi
    url: ./deployment-api.yaml
  - name: monitoring-service
    type: openapi
    url: ./monitoring-api.yaml

workflows:
  - workflowId: serviceDeployment
    summary: Service Deployment Workflow
    description: Handles the deployment of a new service version
    inputs:
      type: object
      properties:
        serviceName:
          type: string
        version:
          type: string
        environment:
          type: string
          enum: [staging, production]
    steps:
      - stepId: deployService
        description: Deploy new service version
        operationPath: '{$sourceDescriptions.deployment-service.url}#/paths/~1deploy/post'
        requestBody:
          payload:
            serviceName: {$inputs.serviceName}
            version: {$inputs.version}
            environment: {$inputs.environment}
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          deploymentId: $response.body#/id
        onSuccess:
          - type: goto
            stepId: verifyDeployment

      - stepId: verifyDeployment
        description: Verify deployment health
        operationPath: '{$sourceDescriptions.monitoring-service.url}#/paths/~1health/get'
        parameters:
          - name: deploymentId
            in: query
            value: {$steps.deployService.outputs.deploymentId}
        successCriteria:
          - condition: $statusCode == 200
          - context: $response.body
            condition: $.status
            type: jsonpath
        onFailure:
          - name: rollbackDeployment
            type: goto
            workflowId: rollbackService
            criteria:
              - condition: $statusCode != 200

  - workflowId: rollbackService
    summary: Rollback Failed Deployment
    description: Handles rollback of failed deployments
    steps:
      - stepId: initiateRollback
        description: Start deployment rollback
        operationPath: '{$sourceDescriptions.deployment-service.url}#/paths/~1rollback/post'
        requestBody:
          payload:
            deploymentId: {$steps.deployService.outputs.deploymentId}
        successCriteria:
          - condition: $statusCode == 200

API contract testing

Testing individual endpoints against their schemas doesn't show that multi-step workflows work end to end. Arazzo lets you test full sequences of calls against your API contracts. For more details, see Testing Arazzo Workflows.

Respect has focused on testing API workflows rather than single calls since it was an internal Redocly tool. Arazzo makes that approach a standard that any API producer can use.

Contract testing with Arazzo allows you to:

  • Validate that entire user journeys work as expected
  • Test interactions between multiple microservices or APIs
  • Ensure that data flows correctly from one step to the next
  • Detect breaking changes that might not be apparent from testing individual endpoints

End-to-end API testing

End-to-end testing with Arazzo goes beyond contract testing. It runs complete user journeys across services in realistic scenarios, rather than only checking that each request and response match the contract.

With Arazzo-based end-to-end testing, you can:

  • Automate testing of entire workflows in CI/CD pipelines
  • Test with real or mocked dependencies
  • Keep workflow documentation verified against actual API behavior

For the latest updates on our Arazzo support, check out our Arazzo roadmap blog post.

Get started with Arazzo

To start documenting multi-step workflows with Arazzo:

  1. Learn from real examples: Review the examples in this article, including the Healthcare Patient Onboarding workflow and Technical pattern examples sections above.
  2. Create your first workflow: Start with a common use case that involves multiple API calls. See Arazzo Basics for the file structure.
  3. Validate your workflow: Use the Redocly CLI to lint and validate your Arazzo files. Learn more about Success Criteria and Failure Handling:
    npx @redocly/cli@latest lint YOUR_ARAZZO_FILE
    
  4. Integrate with your documentation: Store your Arazzo files alongside your OpenAPI specs. See Source Descriptions and References for best practices.
  5. Use Respect to run your workflows: Execute your Arazzo workflows with Redocly CLI. For a complete walkthrough, see Arazzo Walkthrough:
    npx @redocly/cli@latest respect YOUR_ARAZZO_FILE
    

To see which linters, runners, and generators support the format, read Arazzo specification tools.

Start by documenting the workflows your API consumers run most often.