Arazzo Specification
Write, review, and modify Arazzo workflow specifications that describe deterministic, multi-step API workflows on top of OpenAPI.
Workflow
Authoring a New Arazzo Document
- Identify the business outcome the workflow achieves.
- Collect the OpenAPI spec(s) involved and note the
operationIds needed. - Read
references/01-overview-and-structure.mdfor document skeleton and naming. - Read
references/02-core-constructs.mdfor source descriptions, steps, parameters, request bodies, and runtime expressions. - Draft the document using the skeleton below.
- Define each step: choose
operationId(preferred),operationPath, orworkflowId. - Thread data between steps using runtime expressions and step outputs.
- Add success criteria to every step — read
references/03-criteria-flow-outputs.md. - Add failure/success actions for known failure modes (rate limits, auth expiry) — same reference.
- Extract repeated elements into
components— readreferences/04-reuse-and-composition.md. - For sub-workflow composition, read
references/04-reuse-and-composition.md. - Validate with the checklist below and recommend linting tools from
references/06-ai-agents-validation-practices.md.
Reviewing an Existing Arazzo Document
- Validate structure against the skeleton below.
- Check every item in the best practices checklist below.
- Read
references/07-pitfalls-tooling-resources.mdand scan for common pitfalls. - Verify all
operationIdreferences exist in the source OpenAPI document(s). - Verify all runtime expressions reference steps that precede them in sequence.
- Suggest linting integration (Spectral, Redocly CLI).
For AI Agent / MCP Integration
- Read
references/06-ai-agents-validation-practices.mdfor patterns on exposing Arazzo workflows as MCP tools and reducing LLM token consumption.
Document Skeleton
arazzo: "1.0.1"
info:
title: Workflow Title
version: "1.0.0"
description: What this workflow achieves.
sourceDescriptions:
- name: myApi # Descriptive name, used as operationId prefix
url: ./openapi.yaml
type: openapi
workflows:
- workflowId: my-workflow
summary: One-line purpose.
inputs:
type: object
properties:
param_name:
type: string
steps:
- stepId: first-step
description: What this step does and why.
operationId: myApi.someOperation
parameters:
- name: paramName
in: query
value: $inputs.param_name
successCriteria:
- condition: $statusCode == 200
outputs:
result_id: $response.body#/id
- stepId: second-step
operationId: myApi.anotherOperation
parameters:
- name: id
in: path
value: $steps.first-step.outputs.result_id
successCriteria:
- condition: $statusCode == 200
outputs:
workflow_result: $steps.first-step.outputs.result_id
components:
parameters: {}
inputs: {}
successActions: {}
failureActions: {}
Runtime Expression Quick Reference
| Expression | Resolves To |
|---|---|
$inputs.fieldName |
Workflow input value |
$steps.stepId.outputs.name |
Output from a previous step |
$statusCode |
HTTP response status code |
$response.body |
Full response body |
$response.body#/json/pointer |
Specific field via JSON Pointer (RFC 6901) |
$response.header.name |
Response header value |
$request.body#/json/pointer |
Specific field in request body |
$workflows.workflowId.outputs.name |
Output from another workflow |
$components.parameters.name |
Reusable parameter from components |
$url / $method |
Request URL / HTTP method |
Embedding in strings: Use curly braces — "Bearer {$steps.auth.outputs.token}". When the entire value is an expression, no braces needed: value: $inputs.pet_id.
JSON Pointer: #/0/id = first array element's id. #/data/customer/email = nested field. Escape / as ~1, ~ as ~0.
Operation Reference Rules
Use exactly one per step (mutually exclusive):
| Field | When to Use |
|---|---|
operationId |
Preferred. Stable across path changes. Format: sourceName.operationId. |
operationPath |
Third-party APIs without operationId. Format: sourceName.{jsonPointer}. |
workflowId |
Invoke sub-workflow. Local: workflowId. External: $sourceDescriptions.name.workflowId. |
Key Syntax Rules
$refis for JSON Schema references (ininputsschemas only).referenceis for Arazzo's Reusable Object (in parameter/action arrays). Supportsvalueoverride.- Success criteria in an array are AND-ed. For OR, combine in one expression:
$statusCode == 200 || $statusCode == 201. dependsOndeclares prerequisites but does not invoke them.- Failure action types:
end,goto,retry(withretryAfterandretryLimit). - All field names are case-sensitive (except HTTP header names).
Best Practices Checklist
Structure
- File named
arazzo.yamlorarazzo.json. -
arazzoversion field set to"1.0.1". -
summaryanddescriptionon info, workflows, and steps.
Naming
-
workflowIds reflect business outcomes:apply-coupon, notworkflow1. -
stepIds reflect actions:search-pets, notstep1. -
sourceDescriptionnames are descriptive:payments, notapi2. - All IDs match
[A-Za-z0-9_\-]+.
Operations & Data Flow
-
operationIdpreferred overoperationPath. - Every
operationIdexists in the source OpenAPI document. - Exactly one of
operationId/operationPath/workflowIdper step. - Workflow inputs typed with JSON Schema.
- Outputs are minimal — only values consumed downstream.
- Every runtime expression references a preceding step.
Robustness
-
successCriteriadefined on every step. -
onFailureactions for rate limits (429), auth expiry (401). - Reasonable
retryAfterandretryLimitvalues. - Workflow-level
failureActionsas defaults; step-level overrides where needed.
Reusability
- Repeated parameters (auth, pagination) in
components/parameters. - Shared input schemas in
components/inputs. - Common actions in
components/successActionsandcomponents/failureActions. - Multi-step reusable sequences as sub-workflows.
Maintenance
- Arazzo versioned alongside OpenAPI specs — single documentation unit.
- Linting in CI (Spectral or Redocly CLI).
References
references/01-overview-and-structure.md— What Arazzo is, ecosystem context, document structure, first document walkthrough.references/02-core-constructs.md— Source descriptions, workflows, steps, parameters, request bodies, runtime expressions.references/03-criteria-flow-outputs.md— Success criteria, control flow (success/failure actions), outputs and data threading.references/04-reuse-and-composition.md— Reusable components and workflow composition (local and cross-document).references/05-complete-example.md— End-to-end e-commerce checkout example demonstrating all features together.references/06-ai-agents-validation-practices.md— AI agent and MCP integration patterns, validation/linting tools, best practices checklist.references/07-pitfalls-tooling-resources.md— Common pitfalls, tooling ecosystem, and learning resources.