The recent emergence of Generative AI has increased interest in the world of APIfication, due to its relevant role in this context.

There is no doubt that the union of the two worlds, Generative AI and APIs, forms a nucleus of technological innovation with great potential.

Regardless of the company or sector, or even the type of architecture, sound mechanisms are needed for the consumers of APIs, be they systems, humans or AI, and it goes without saying that this solvency is often lacking.

It is in this sense of facilitating the consumption of APIs that the figure of the API Workflows specification emerges, whose fundamental objective is to describe and document business processes in a standardised way. In other words, they become a key component for two reasons:

What does it consist of?

API Workflows Specification is a ground-breaking framework that seeks to define and document API call flows, i.e. it standardises the sequence of calls to different APIs, incorporating success conditions for each step and instructions for passing the response to the next link in the chain.

This work is part of the OpenAPI initiative and enables consumers to make endpoints not only easier to understand, but also easier to consume and integrate, making them easier to adopt and use for both traditional consumers and the new wave of Generative AI consumers.

Objectives

In this first release of API Workflows, the OpenAPI initiative has worked to define and solve a number of common problems that define the initial goals of the workstream, which are to:

“Only 32% of respondents said they considered their APIs to be well documented.”

SmartBear - SOSA API Report 2023
SmartBear - SOSA API Report 2023

Structure of the specification

The API Workflows specification is in pre-release version 1.0.0. This means that the initiative is still working on releasing its first official version.

This specification defines the structure of the document(s) describing the call flows in both JSON and Yaml format, and the following image shows the details of its components in a very summarised form:

A step-by-step example of the specification to better understand the structure would be: presentation by Frank Kilcommins from which we have extracted the image above or examples from the OpenAPI initiative, where they are standardising typical flows found in real scenarios to use as a basis.

The way it works is very simple: within each workflow you define the possible parameters or inputs for that flow and the list of actions or steps that are formed based on certain conditions, as shown in the image below:

When we talk about testing, how can it help us?

In the field of testing, the use of API Workflows allows us to solve one of the most common challenges we face: the validation of information flows. With today’s tools, such validation requires a lot of effort from teams, regardless of their testing toolkit.

The current approach is based on testing individual endpoints at the acceptance and/or integration level, rather than focusing on business processes, because building such complete scenarios requires a lot of effort and is a type of testing that is not performed. At best, it is done for critical business processes, but this is not the norm.

The use of API Workflows allows us to define system-readable test scenarios that contain all the necessary information: operations, sequence, expectations... without having to spend time and effort implementing the process.

This allows us to create test plans based on real scenarios, rather than one-off tests, which are more effective and guarantee the expected behaviour from the end user’s point of view.

And of course, what is the role of Generative AI in this area?

Throughout this article we have been talking about generative AI, and this is no coincidence. The synergy that exists between the specification of API workflows and Generative AI is undeniable, as workflows serve as a link between the functionalities offered by APIs and the processing capabilities of the AIs that consume them.

In other words, workflows not only facilitate consumption by developers or traditional systems, but also provide a standardised interface for Generative AI to interact in a more efficient way, with the following benefits:

Conclusions

In summary, the work done so far by the OpenAPI initiative with the API Workflows specification, and which is still ongoing, enables us to:

We think this is an initiative to keep an eye on, as it will give us a lot to talk about and, of course, to incorporate into our stack once a stable version is released.

References

Tell us what you think.

Comments are moderated and will only be visible if they add to the discussion in a constructive way. If you disagree with a point, please, be polite.

Subscribe