Real API workflows rarely involve a single request. You fetch a resource, capture its ID, pass that ID to a second call, validate the result, and so on. MarkApiDown flow pipelines let you describe these multi-step sequences as a single markdown file inDocumentation Index
Fetch the complete documentation index at: https://docs.markapidown.net/llms.txt
Use this file to discover all available pages before exploring further.
api-docs/flows/. Each step references an existing endpoint spec, captures values from the response, and injects them into later steps — all without writing a line of scripting code.
File location
Place pipeline files underapi-docs/flows/ (or api-docs/pipelines/ — both directories are recognized):
flows/ or pipelines/ directories as pipeline specs, not endpoint specs. The mad validate command checks both kinds.
Pipeline frontmatter fields
A pipeline file opens with a YAML frontmatter block, just like an endpoint spec. The key difference istype: pipeline.
Must be
pipeline. Tells MarkApiDown to parse this file as a flow rather than
a single endpoint spec.A machine-friendly identifier for the pipeline, used in CLI output and the
browser UI (e.g.
post-with-author, checkout-flow).A human-readable sentence describing what the pipeline does. Shown in the
browser UI and in
mad flow console output.When
true, MarkApiDown runs all remaining steps even if an earlier step
fails an assertion or returns an unexpected status. Defaults to false.When
true, MarkApiDown executes all steps concurrently instead of
sequentially. Use this for independent steps where order does not matter.
Defaults to false.Annotated pipeline example
The following pipeline is taken directly from the JSONPlaceholder example project. It fetches a post, capturesuserId from the response body, and then fetches the author using that captured value:
Steps format
Define steps as a numbered list under## Steps. Each step entry includes:
- A label — a bold name for the step, displayed in CLI output and the flow canvas.
- A spec path — the path to the endpoint spec file, relative to the
flows/directory’s parent (api-docs/). Written after->. - Capture, Inject, and Assert sub-items — indented bullet points that describe how to wire values between steps.
Capture syntax
TheCapture directive extracts a value from a step’s response and stores it as a named variable for downstream steps. Use dot-notation and bracket-notation to navigate the response:
| Capture expression | What it extracts |
|---|---|
response.body.id | The id field of a JSON object body |
response.body[0].id | The id field of the first item in a JSON array body |
response.body.data.token | A nested field at body.data.token |
response.headers.Location | The Location response header |
resourceId) becomes available to every subsequent step as if it were defined in env.md.
Running a pipeline
Usemad flow and pass the pipeline file path along with the target environment:
--var to inject additional variables for this run:
Running steps in parallel
Override theparallel frontmatter setting at runtime with the --parallel flag:
parallel: true:
Parallel execution is best for independent steps such as health checks or data
seeding. Do not run steps in parallel when a later step depends on a value
captured from an earlier one — the capture will not be available yet.
Viewing pipelines in the browser
Runmad serve and open the Flows section in the left sidebar. Each pipeline appears as a visual flow canvas where nodes represent steps and edges represent captured values flowing between them.