> ## Documentation Index
> Fetch the complete documentation index at: https://helpcenter.magure.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto-documentation

> Generate clear, shareable documentation for any workflow — what it does, how it runs, what it connects to — without writing it by hand

## Why auto-documentation

Every workflow you build is also a decision: which agents handle what, which tools they're allowed to touch, where humans step in, what errors get retried. Over time that intent lives only in the canvas, and newcomers — reviewers, auditors, teammates taking over an on-call — have to reverse-engineer it from nodes and prompts.

MagOneAI can read a use case and produce a structured, human-readable document that explains the workflow in plain language. It's always derivable from the current workflow, so it stays accurate without being maintained separately.

<Info>
  Auto-documentation is descriptive, not authoritative. The workflow itself is the source of truth — documentation is a view on top of it.
</Info>

## What gets generated

The generated document is organized into sections that mirror how a reviewer actually reads a workflow — starting with the big picture, then drilling into specifics:

<CardGroup cols={2}>
  <Card title="Overview" icon="book-open">
    What the workflow does, how it's used (chat, form, or hybrid), and which agents or tools make it work.
  </Card>

  <Card title="How to use" icon="play">
    The expected inputs, how to trigger the workflow, and what consumers should do with the output.
  </Card>

  <Card title="Flow" icon="diagram-project">
    Step-by-step narration of the workflow — each activity, how it's connected, and what routes it takes.
  </Card>

  <Card title="Agents" icon="robot">
    Each agent's role, persona, and the tools and knowledge bases it can access.
  </Card>

  <Card title="Integrations" icon="plug">
    External tools the workflow connects to, with setup notes for integrations that require credentials.
  </Card>

  <Card title="Error handling" icon="triangle-exclamation">
    How failures are handled — retries, fallbacks, and where execution can halt or route around errors.
  </Card>

  <Card title="Execution summary" icon="chart-line">
    Recent run statistics when available: volume, success rate, latency, and where failures cluster.
  </Card>

  <Card title="Governance" icon="shield">
    Guardrails in use — output schemas, prohibited-content checks, human approval points.
  </Card>
</CardGroup>

Together, these sections give a reader enough to understand the workflow without opening Studio.

## How it works

Generation happens on demand. Open the **Documentation** panel for a use case and trigger a new generation — the platform reads the current workflow and the agents it references, then produces the document.

<Steps>
  <Step title="Open the documentation panel">
    Available from any use case in Studio.
  </Step>

  <Step title="Generate">
    The platform inspects your workflow and drafts each section. Generation is powered by your selected language model and takes a few seconds.
  </Step>

  <Step title="Review">
    Read the generated document inline. If something's off, tweak the workflow — rename a node, sharpen a prompt, update an agent's persona — and regenerate.
  </Step>

  <Step title="Export or copy">
    Copy the full markdown to paste into a wiki, export as `.md`, or render to **PDF** with the canvas snapshot embedded for onboarding packets and reviews.
  </Step>
</Steps>

### Staying fresh

Documentation is cached after generation, so opening the panel again loads the last version instantly. If you edit the workflow afterwards, the cached doc is automatically flagged as **stale** — a one-click refresh brings it up to date.

<Tip>
  Regenerate after any meaningful workflow change. Stale docs are worse than no docs: they look authoritative but mislead.
</Tip>

### Deterministic fallback

When a language model isn't available or you want a baseline view, MagOneAI also supports a template-based renderer that produces the same sections from the raw workflow — no LLM needed. The content is more mechanical but always consistent, which is useful as a sanity check against the AI-written version.

## Exporting

Three output formats cover most needs:

* **Copy to clipboard** — paste into Slack, a PR description, or a wiki page.
* **Markdown (`.md`)** — check into a repo alongside the workflow export, or feed into your own documentation pipeline.
* **PDF** — formatted for sharing with non-technical stakeholders; optionally includes the canvas diagram so the reader can see the workflow shape.

## Good uses for auto-documentation

* **Onboarding.** A new engineer inherits a workflow. Read the generated doc first, open the canvas second.
* **Review packets.** Attach the PDF to a change request so reviewers see intent alongside the diff.
* **Audits and compliance.** Show reviewers what a workflow does, which tools it touches, and what guardrails are in place — without them needing Studio access.
* **Cross-team handoffs.** Export the markdown with the use case so the receiving team has context, not just configuration.

## Next steps

<CardGroup cols={2}>
  <Card title="Versions & publishing" icon="code-branch" href="/workflows/versions-and-publishing">
    Regenerate documentation as part of the publish process to keep what's written and what's running in sync
  </Card>

  <Card title="Workflow overview" icon="diagram-project" href="/workflows/overview">
    Back to activities, the canvas, and workflow basics
  </Card>
</CardGroup>
