Speakeasy Logo
Skip to Content
OpenAPI HubArazzo

Arazzo: OpenAPI Workflows

The Arazzo Specification is a new addition to the OpenAPI Specification that allows you to define sequences of operations for your API.

An Arazzo description is a separate document that references your OpenAPI document and describes how to combine operations from your OpenAPI document into step-by-step sequences.

Arazzo descriptions are useful for:

  • Defining complex sequences of operations that involve multiple API calls.
  • Documenting the expected behavior of your API in a more structured way than a narrative description.
  • Generating code to execute the sequences of operations.
  • Generating tests to verify that the sequences of operations behave as expected.
  • Generating documentation that explains how to use the sequences of operations.

Arazzo Description Structure

An Arazzo description is a JSON or YAML document that follows the structure defined by the Arazzo Specification.

Arazzo version

Field NameTypeRequired
arazzostring

The version of the Arazzo Specification that the document uses. The value must be a supported version number.

Info metadata

Field NameTypeRequired
infoInfo Object

Provides metadata about the Arazzo description.

Source description

Field NameTypeRequired
sourceDescriptions[Source Description Object]

An array of source description objects defining the OpenAPI or other documents containing the operations referenced by the workflows. The array must contain at least one source.

Workflows

Field NameTypeRequired
workflows[Workflow Object]

An array of workflow objects defining the workflows. The array must contain at least one workflow.

This table shows all fields at the root of the Arazzo Specification:

Field Name
Type
Required
Description
The version of the Arazzo Specification that the document uses. The value must be a supported version number.
Required
Description
Provides metadata about the Arazzo description.
Required
Description
An array of source description objects defining the OpenAPI or other documents containing the operations referenced by the workflows. The array must contain at least one source.
Required
Description
An array of workflow objects defining the workflows. The array must contain at least one workflow.
Required
Description
An element to hold reusable schemas for the workflow, for example, inputs and parameters.
Required
Description
Any number of extension fields can be added to the Arazzo description that can be used by tooling and vendors. When provided at this level, the extensions generally apply to the entire document.

Arazzo Specification Versions

The arazzo field contains the version number of the Arazzo Specification that the document conforms to. Tooling should use this value to interpret the document correctly.

The current version of the Arazzo Specification is 1.0.0-prerelease, but keep in mind that the specification is still under development.

Info Object

Provides metadata about the Arazzo description.

Field Name
Type
Required
Description
A human-readable title for the set of workflows.
Type
Required
Description
A short summary of the Arazzo description.
Type
Required
Description
A longer description of the Arazzo description. CommonMark syntax  may be used for rich text representation.
Type
Required
Description
A version string indicating the version of the Arazzo document.
Required
Description
Any number of extension fields can be added that can be used by tooling and vendors.

Below is an example of an info object in an Arazzo document:

Source Description Object

A source description points to an OpenAPI document containing the operations referenced by the workflows in this document. It may also reference other Arazzo documents.

Field Name
Type
Required
Description
A name for the source document, used to reference it from other parts of the Arazzo description. The name must be unique within the
array and may only contain alphanumeric characters, underscores, and dashes.
Type
Required
Description
The URL of the source document. This identifier must conform to RFC 3986 section 4.1  for absolute URLs or section 4.2  for relative URIs.
Type
Required
Description
The type of the source document. Supported values are
, indicating an OpenAPI document, or
indicating another Arazzo description. Additional values may be supported in future versions of the specification.
Required
Description
Any number of extension fields can be added to the source description object that can be used by tooling and vendors.

Below is an example of two source description objects in an Arazzo description document:

Workflow Object

A workflow object defines a sequence of operations.

Field Name
Type
Required
Description
A unique identifier for the workflow. This is used to reference the workflow from other parts of the Arazzo description. May contain only alphanumeric characters, underscores, and dashes.
Type
Required
Description
A short summary of what the workflow does.
Type
Required
Description
A longer description of the workflow. CommonMark syntax  may be used for rich text representation.
Required
Description
A schema defining the input parameters for the workflow.
Type
[
]
Required
Description
An array of workflow IDs that this workflow depends on. The workflows in the array must be executed before this workflow.
Required
Description
An ordered array of step objects defining the steps of the workflow. The array must contain at least one step.
Description
An array of success action objects and reusable objects specifying actions to take for each step of this workflow that completes successfully. Individual steps may override the workflow object's success actions. Reusable objects must reference success actions defined in the components/successActions of this Arazzo document.
Description
An array of failure action objects and reusable objects specifying actions to take for each step of this workflow that fails. Individual steps may override the workflow object's failure actions. Reusable objects must reference success actions defined in the components/failureActions of this Arazzo document.
Type
Required
Description
A map of output values produced by the workflow. The keys are the names of the outputs, and the values are runtime expressions that extract the output values from the results of the workflow steps.
Description
An array of parameters applicable to all steps in this workflow. Individual steps may override the workflow object's parameters. A reusable object must reference an object in this document's components/parameters of this Arazzo document.
Required
Description
Any number of extension fields can be added to the workflow object that can be used by tooling and vendors.

Below is an example of a workflow object:

Step Object

A step object defines a single operation to perform as part of a workflow.

Field Name
Type
Required
Description
A unique identifier for the step within the workflow. Used to reference the step's outputs from other parts of the workflow. May contain only alphanumeric characters, underscores, and dashes.
Type
Required
Description
A description of what the step does. CommonMark syntax  may be used for rich text representation.
Type
Required
Description
The
of the operation to execute for this step. Must match an
in one of the
. This field is mutually exclusive with
and
.
Type
Required
Description
A JSON Pointer to the operation to execute for this step, relative to one of the
. This field is mutually exclusive with
and
.
Type
Required
Description
The ID of a workflow in this document to execute as a sub-workflow. This field is mutually exclusive with
and
.
Description
An array of parameters to pass to the operation for this step. Overrides any parameters defined at the workflow level.
Description
The request body to send for the operation.
Required
Description
An array of criteria for determining if the step succeeded. All criteria must be met for the step to be considered successful. Individual criteria are defined using criterion objects.
Description
An array of actions to take if the step succeeds. Overrides any success actions defined at the workflow level. Individual actions are defined using success action objects.
Description
An array of actions to take if the step fails. Overrides any failure actions defined at the workflow level. Individual actions are defined using failure action objects.
Type
Required
Description
A map of output values produced by the step. The keys are the names of the outputs, and the values are runtime expressions that extract the output values from the result of the operation.
Required
Description
Any number of extension fields can be added to the step object that can be used by tooling and vendors.

Below is an example of step objects in an Arazzo description document:

Parameter Object

A parameter object defines a single parameter to pass to an operation in a workflow step.

Field Name
Type
Required
Description
The name of the parameter.
Type
Required
Description
The location of the parameter. Possible values are
,
,
,
. Required for parameters passed to an operation. Must be omitted for parameters passed to a workflow, where the parameter is always passed in the workflow's
object. See Parameter Location.
Type
Required
Description
The value of the parameter. Can be a literal value, or a runtime expression that will be evaluated and passed to the operation or workflow.
Required
Description
Any number of extension fields can be added to the parameter object that can be used by tooling and vendors.

Parameter Location

For parameters passed to an operation, the in field specifies the location of the parameter. The possible values are:

  • path - The parameter is part of the operation’s URL path.
  • query - The parameter is appended to the operation’s URL as a query parameter.
  • header - The parameter is sent in the request headers.
  • cookie - The parameter is sent in a cookie.

For parameters passed to a workflow, the in field must be omitted. Workflow parameters are always passed in the workflow’s inputs object.

Arazzo Parameter Object Examples

Success Action Object

A success action object defines an action to take when a workflow step succeeds.

Field Name
Type
Required
Description
The name of the action. Names are case-sensitive and must be unique within the
array of a step or workflow.
Type
Required
Description
The type of action to take. Possible values are:
  • - End the workflow.
  • - Move to another step in the workflow. Requires either
    or
    to be specified.
Type
Required
Description
The
of the step to execute next if
is
. Mutually exclusive with
.
Type
Required
Description
The
of the workflow to execute if
is
. Mutually exclusive with
.
Required
Description
An array of criteria that determine whether the action should be executed. All criteria must be met for the action to execute. If not provided, the action will always execute.
Required
Description
Any number of extension fields can be added to the success action object that can be used by tooling and vendors.

Below is an example of a success action object:

Failure Action Object

A failure action object defines an action to take when a workflow step fails.

Field Name
Type
Required
Description
The name of the action. Names are case-sensitive and must be unique within the
array of a step or workflow.
Type
Required
Description
The type of action to take. Possible values are:
  • - End the workflow, returning the specified
    if provided.
  • - Move to another step in the workflow. Requires either
    or
    to be specified.
  • - Retry the failed step. Requires
    and optionally
    to be specified.
Type
Required
Description
The
of the step to execute next if
is
. Mutually exclusive with
.
Type
Required
Description
The
of the workflow to execute if
is
. Mutually exclusive with
.
Type
Number
Required
Description
The number of seconds to wait before retrying the failed step if
is
. Must be a non-negative integer. The specification is ambiguous about whether this field also applies when
is
.
Type
Integer
Required
Description
The maximum number of times to retry the failed step if
is
. Must be a non-negative integer. If not provided, the step will be retried indefinitely until it succeeds or the workflow is canceled.
Required
Description
An array of criteria that determine whether the action should be executed. All criteria must be met for the action to execute.
Required
Description
Any number of extension fields can be added to the failure action object that can be used by tooling and vendors.

Below is an example of a failure action object:

Components Object

The components object holds reusable objects that can be referenced from other parts of the Arazzo description.

Field Name
Type
Map[
,
]
Required
Description
An object containing reusable JSON Schemas  that can be referenced from workflow
.
Type
Required
Description
An object containing reusable parameter objects.
Required
Description
An object containing reusable success action objects.
Required
Description
An object containing reusable failure action objects.
Required
Description
Any number of extension fields can be added to the components object that can be used by tooling and vendors.

The keys in the components object may only contain alphanumeric characters, underscores, and dashes.

Arazzo Components Object Example

The components defined in an Arazzo description are scoped to that document. Components defined in one Arazzo description cannot be referenced from another Arazzo description.

Reusable Object

A reusable object allows you to reference objects like success actions and failure actions defined in the components object from locations within steps or workflows.

Field Name
Required
Description
A runtime expression used to reference the desired object from the
object.
Type
string
Required
Description
The value of the referenced parameter. Only used for parameters.

Arazzo Reusable Object Example

Criterion Object

A criterion object is used to specify assertions in the successCriteria field of a step object, or the criteria field of a success action object or failure action object.

Criterion objects support three types of assertions:

  • simple - Basic comparisons using literals, operators, and runtime expressions. This is the default if no type is specified.
  • regex - Applies a regular expression pattern to a context defined by a runtime expression.
  • JSONPath - Applies a JSONPath  expression to a context defined by a runtime expression. The root node of the JSONPath is the context.

Literals

Literals are constant values that can be used in simple conditions. The following data types are supported:

Type
Literal Value
or
Literal Value
Literal Value
A number of type
,
,
, or
.
Literal Value
Strings must be enclosed in single quotes ('). To include a literal single quote, escape it with another single quote ('').

Operators

Simple conditions support the following operators:

Operator
Description
Less than
Description
Less than or equal
Description
Greater than
Description
Greater than or equal
Description
Equal
Description
Not equal
Description
Not
Description
And
Description
Or
Description
Grouping
Description
Array index (0-based)
Description
Property dereference

String comparisons are case-insensitive.

A criterion object consists of the following fields:

Field Name
Required
Description
A runtime expression that defines the context for
and
conditions. Must be provided if
is specified.
Type
Required
Description
The assertion to evaluate. For
conditions, combines literals, operators, and runtime expressions. For
and
conditions, provides the expression to evaluate against the
.
Type
Required
Description
The type of assertion. Allowed values are
,
, or
. Defaults to
if not provided.
Required
Description
Any number of extension fields can be added to the criterion object that can be used by tooling and vendors.

Arazzo Criterion Object Examples

Simple Condition - Check if a drink was successfully created

Simple Condition - Check if the bar is open

Regex Condition - Check if the drink name matches a pattern

JSONPath Condition - Check if the ingredient list contains “whiskey”

Simple Condition - Check if the customer is over 21

JSONPath Condition - Check if there are any available tables

Request Body Object

The request body object describes the payload and Content-Type to send with the request when executing an operation in a workflow step.

Field Name
Type
Required
Description
The
header for the request payload. If omitted, defaults to the
of the referenced operation.
Type
Any
Required
Description
The literal payload value to send in the request body. Can contain runtime expressions which will be evaluated before sending the request.
Description
An array of payload replacement objects specifying values to insert into specific locations in the payload.
Required
Description
Any number of extension fields can be added to the request body object that can be used by tooling and vendors.

Request Body Object Examples

JSON Payload (Template)

JSON Payload (Object)

JSON Payload (Runtime Expression)

XML Payload (Template)

Form Data Payload (Object)

Form Data Payload (String)

Payload Replacement Object

A payload replacement object specifies a location within the request payload and the value to insert at that location.

Field Name
Type
Required
Description
A JSON Pointer  or XPath  expression that identifies the location in the payload to insert the
. For JSON payloads, use JSON Pointer. For XML payloads, use XPath.
Type
Any
Required
Description
The value to insert at the specified
location. Can be a literal or a runtime expression that will be evaluated before sending the request.
Required
Description
Any number of extension fields can be added to the payload replacement object that can be used by tooling and vendors.

Payload Replacement Object Examples

Runtime Expression Value

Literal Value

Runtime Expressions

Runtime expressions allow you to reference values that will be available when a workflow is executed, such as values from the HTTP request or response, the event that triggered the workflow, or outputs from previous workflow steps.

The syntax for runtime expressions is {expression}, where expression is one of the following:

Expression
Description
The full URL of the request
Description
The HTTP method of the request
Description
The HTTP status code of the response
Description
The value of the specified request header
Description
The value of the specified query parameter from the request URL
Description
The value of the specified path parameter from the request URL
Description
The entire request body
Description
The value of the specified JSON pointer path from the request body
Description
The value of the specified response header
Description
The entire response body
Description
The value of the specified JSON pointer path from the response body
Description
The value of the specified workflow input
Description
The value of the specified workflow output
Description
The value of the specified output from the step with ID
Description
The value of the specified input from the workflow with ID
Description
The value of the specified output from the workflow with ID

Runtime Expression Examples

Expression
Example Value
Example Value
Example Value
Example Value
Example Value

Arazzo Specification Extensions

The Arazzo Specification allows custom properties to be added at certain points using specification extensions.

Extension properties are always prefixed by "x-" and can have any valid JSON value.

For example:

The extensions defined by the Arazzo Specification are:

Context
Description
Applies to the entire Arazzo description document
Description
Applies to the
object
Description
Applies to all the source description objects
Description
Applies to all workflow objects
Description
Applies to all step objects
Description
Applies to all parameter objects
Description
Applies to all success action objects
Description
Applies to all failure action objects
Description
Applies to all criterion objects
Description
Applies to all request body objects
Description
Applies to all payload replacement objects
Description
Applies to all reusable objects
Description
Applies to the components object

The specification extension key formats ^x-oai- and ^x-oas- are reserved for extensions defined by the OpenAPI Initiative .

Extension properties can be used to add additional features, metadata, or configuration options to the Arazzo description that are not directly supported by the current version of the specification. However, additional tooling may be required to process custom extensions.

Last updated on