Skip to content

Everything <rapi-flow> takes and offers, read from the element’s own source. How to use it is in the Quickstart, Pairing with <rapi-doc>, Running Workflows and Slots & Styling. It ships in its own bundle, rapidoc-flow-min.js.

Set on the element in HTML, or changed at runtime with setAttribute.

Workflow Attributes 8

AttributeDescription and allowed valuesDefault
arazzo-url
URL of the Arazzo spec (Arazzo 1.x), YAML or JSON.
(empty)
spec-url
Replaces the URL of the first OpenAPI source description. Other sources are fetched relative to the Arazzo spec.
(empty)
workflow-id
The workflow to show. With several workflows, a picker in the header switches between them.
(the first workflow)
for
id of a <rapi-doc> or <rapi-doc-mini> on the page, or several ids separated by spaces, one element per OpenAPI source of the Arazzo spec. Each element supplies its source's OpenAPI spec, server, credentials and mock; clicking a step shows its operation in the element of its source. An element is paired with the source its arazzo-source attribute names, else the source whose URL it has loaded, else the next source not paired yet. A paired <rapi-doc-mini> gets filter-operations: the shown workflow's operations of its source, in step order.
(empty)
view

expandedcompact

expanded shows each step's inputs and actions in its box; compact shows the operation, the values that come from the inputs or earlier steps, and the gotos and retries whose lines leave the box.
expanded
show-view-toggle

truefalse

false hides the Compact / Expanded switch.
true
allow-arazzo-url-load

truefalse

true shows a box above the diagram to load any Arazzo spec by URL (YAML or JSON; the server must allow cross-origin requests). Loading one shows its first workflow. The element then manages the Arazzo spec: with for, whenever the Arazzo spec changes (from the box or arazzo-url), each paired element loads its OpenAPI source, unless it already shows that OpenAPI spec, so steps resolve and runs go to that API.
false
update-route

truefalse

true keeps the shown workflow and the selected step in the page's address as query parameters, ?workflow=<id>&step=<id>, so a link opens that workflow with that step selected and scrolled into view. It uses the query string, not the hash, which <rapi-doc> keeps for its operations; the address is replaced (no history entries) and history.state is kept for the page's router. Set it on one element per page.
false

Theme Attributes 2

AttributeDescription and allowed valuesDefault
theme

embercarboncobaltjadeindigoamber(or custom hex color e.g. #2563eb)

Brand color preset, or a custom brand color as a hex code. Each preset defines a dark and a light palette.
amber
color-scheme

darklightsystemauto

Base color scheme mode. 'system' automatically matches the user's OS preference. 'auto' follows the host page: it reads the page's CSS color-scheme (for example :root[data-theme='light'] { color-scheme: light }, as Starlight sets it) and updates when the page switches theme; when the page declares none, it falls back to the OS preference.
dark

Run Attributes 3

AttributeDescription and allowed valuesDefault
allow-run

truefalse

false hides the run panel: the diagram only.
true
server-url
Base URL the first OpenAPI source's requests go to in runs, instead of the server its paired element selected or the OpenAPI spec's first server.
(empty)
server-is-mock

truefalse

true says the server runs go to is a mock that picks its response status from a Prefer: code= header, such as rapidoc mock or Prism. The run panel then shows Mock Response Status, sent with each step's request, and the button reads "RUN WORKFLOW (Mock)". Not needed when the paired elements have mock-server="true"; against a real API, leave it off: the header is ignored.
false

MCP Attributes 2

AttributeDescription and allowed valuesDefault
mcp

truefalse

true shows an Export MCP Server button that downloads an MCP server with one tool per workflow of the Arazzo spec (every one the runtime can run), and no tool per operation. Its steps call every API source of the Arazzo spec; <rapi-doc>'s own export covers one API's operations.
false
mcp-server-name
Name of the exported MCP server. Defaults to the Arazzo spec's title.
(empty)
MethodDescription
load()
Loads the Arazzo spec and its OpenAPI sources. Fires flow-loaded when done.
generateMcpServer()
Builds the MCP server of the document's workflows: { manifest, files, budget, hostConfig, problems }, as <rapi-doc>'s generateMcpServer, with one tool per workflow the runtime can run and none per operation; problems says why a workflow was left out. Null until the document and its first source are loaded.
downloadMcpServer()
Downloads that server as <server-name>-mcp.zip.

All events bubble and cross the shadow boundary.

const flow = document.querySelector('rapi-flow');
// A step was clicked: show its operation somewhere else on the page
flow.addEventListener('step-click', (e) => {
console.log(e.detail.workflowId, e.detail.stepId, e.detail.operation);
});
// A run finished: one trace entry per step attempt
flow.addEventListener('workflow-run', (e) => {
console.table(e.detail.trace);
});
EventDescription
flow-loaded
The Arazzo spec and its sources are loaded. e.detail is { doc, problems }; problems lists validation findings.
step-click
A step box is clicked or activated with the keyboard. e.detail is { workflowId, stepId, operation, workflowRef }.
view-change
The reader switched between compact and expanded. e.detail is { view }.
workflow-run
A run finished. e.detail is { workflowId, inputs, result, trace }: result is the MCP tool result, and trace has one entry per step attempt with its request and response.
SlotDescription
header
Markup shown at the top, above the Arazzo spec card: a logo, a title, or controls such as a mock / real server switch. It stays in the page's DOM, so page styles and scripts reach it.