Skip to content

RapiFlow

An API reference shows operations one at a time. Integrators also need the order: find a pet, check it, order it, read the order back. Arazzo describes those sequences, and <rapi-flow> draws them: one box per step, linked to its operation, the values each step passes on, and the success and failure branches. Readers can run a workflow from the page and watch each step answer.

<rapi-flow> is a separate bundle, so pages that only use <rapi-doc> don’t download it.

<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-flow-min.js"></script>
<rapi-flow arazzo-url="/specs/petstore.arazzo.yaml" for="thedoc"></rapi-flow>
<rapi-doc id="thedoc" spec-url="/specs/petstore.yaml"></rapi-doc>

With a bundler, import 'rapidoc/flow'; registers the element. It carries its own copy of Lit and the Arazzo runtime; rapidoc-min.js carries no Arazzo code.

  • Paired (for="<id>"): the element uses that <rapi-doc>’s spec, its selected server and the credentials entered in its Authentication section. Clicking a step scrolls the reference to the step’s operation. If the <rapi-doc> has mock-server="true", runs go to the in-browser mock. A workflow that calls several APIs can be paired with one element per API (see one element per API).
  • Standalone: the element loads each OpenAPI source of the Arazzo file itself (spec-url replaces the first one’s URL) and shows its own credentials fields, one per security scheme of the loaded specs. Values typed there stay in the page. A paired element’s sources get no fields: it has its own.

@rapidoc/portal draws workflows in docs pages with the {% workflow file="…" id="…" %} Markdoc tag: the diagram is rendered as static SVG at build time, and rapidoc-flow-min.js loads only when a reader clicks Run workflow. The portal build also turns each workflow into an MCP tool for rapidoc serve’s /mcp endpoint.