You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding support for AsyncAPI definitions would extend the types of workflows that can be described with Arazzo, as many organizations are now combining Request/Response APIs (OpenAPI) with Event-Driven architectures (AsyncAPI).
The latest version of AsyncAPI is v3, but since v2 is still the most widely adopted version, the intention is to provide support for both versions as feasible, and prioritize v3 only when supporting both becomes impractical.
Required Changes to Arazzo Specification
Add asyncapi as a source definition type.
Extend the meaning of workflow.step.operationId to include pointing to an AsyncAPI operationId (either v2 or v3):
Extend the meaning of workflow.step.parameters.in:
header should also include AsyncAPI message headers.
path should include AsyncAPI channel.parameters, as they are similar to OpenAPI path parameters (or consider adding a channel value for disambiguation).
Runtime expressions already include support for $message.body and $message.header this would be used for context in successCriterias
Additional Considerations for Broker-Intermediated APIs
While AsyncAPI and OpenAPI are similar, and it’s tempting to use the operationId in AsyncAPI, there is a key difference: broker-mediated APIs are reciprocal (publishing/sending on one side is subscribing/receiving on the other).
Sometimes, an API might only document one side’s perspective. For example:
A service that publishes events might document its "publish" operations.
However, it might not document the "subscribe" operation that consumers would use to receive these events (consumers just use the "publish" operation documentation and tooling).
Teams and organizations may model this symmetry differently, and sometimes the "inverse" operation may not be defined at all.
To support this, we would need an alternative way to reference the reciprocal operation.
Additional Changes to Arazzo Specification
When the desired operationId is not documented in the existing AsyncAPI, we can support referencing the channel instead of the operation and specify the reciprocal action (send|receive).
Add workflow.step.channel as a fixed field pointing to an AsyncAPI channel:
This is a blocking action: the workflow will wait until successCriteria is met or it times out.
In the following example, in the wait_KitchenOrdersStatusChannel_accepted step, the workflow would "wait until a message is received where the message’s body contains a customerOrderId that matches the orderId of the previous step’s output."
Adding support for AsyncAPI definitions would extend the types of workflows that can be described with Arazzo, as many organizations are now combining Request/Response APIs (OpenAPI) with Event-Driven architectures (AsyncAPI).
The latest version of AsyncAPI is v3, but since v2 is still the most widely adopted version, the intention is to provide support for both versions as feasible, and prioritize v3 only when supporting both becomes impractical.
Required Changes to Arazzo Specification
asyncapi
as a source definition type.workflow.step.operationId
to include pointing to an AsyncAPIoperationId
(either v2 or v3):workflow.step.parameters.in
:header
should also include AsyncAPI message headers.path
should include AsyncAPIchannel.parameters
, as they are similar to OpenAPIpath
parameters (or consider adding achannel
value for disambiguation).$message.body
and$message.header
this would be used for context in successCriteriasAdditional Considerations for Broker-Intermediated APIs
While AsyncAPI and OpenAPI are similar, and it’s tempting to use the
operationId
in AsyncAPI, there is a key difference: broker-mediated APIs are reciprocal (publishing/sending on one side is subscribing/receiving on the other).To support this, we would need an alternative way to reference the reciprocal operation.
Additional Changes to Arazzo Specification
When the desired
operationId
is not documented in the existing AsyncAPI, we can support referencing thechannel
instead of the operation and specify the reciprocal action (send|receive
).workflow.step.channel
as a fixed field pointing to an AsyncAPI channel:workflow.step.action
with supported valuessend|receive
.The combination of
channel+action
would be mutually exclusive withoperationId
, withoperationId
being the preferred option when available.Meaning of AsyncAPI Steps
Send/Publish
A workflow step pointing to a Send/Publish operation will send a message with the
workflow.step.requestBody
.workflow.step.parameters
will also be used to populate AsyncAPImessage.headers
andchannel.parameters
.The only meaningful
successCriteria
is "OK, message accepted," so it may be omitted.This action is non-blocking and has no
outputs
; it will immediately continue to the next step, either onSuccess or onFailure.This is an example of a workflow step sending a message:
Receive/Subscribe
This is a blocking action: the workflow will wait until
successCriteria
is met or it times out.In the following example, in the
wait_KitchenOrdersStatusChannel_accepted
step, the workflow would "wait until a message is received where the message’s body contains acustomerOrderId
that matches theorderId
of the previous step’s output."This step can include
outputs
using the contexts$message.body
and$message.header
Support for Parallel Invocation: Forking and Joining
When using non-blocking steps, there may be a need for parallel invocation, involving forking and joining.
Parallel Invocation and Looping can also be applied to OpenAPI Request/Response steps.
Because of the complexity of this, we could address this in a separate issue for further discussion.
The text was updated successfully, but these errors were encountered: