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

# Runs & results

> What happens when you run a workflow on a document — and the shape of what comes back, one section per atomic operation.

Start a run by submitting a document — through the UI, by calling [`POST /v2/workflows/{id}/run/`](/api-reference/workflows/run), or by uploading then running separately. anyformat creates a **file collection** to hold the document, walks the workflow graph, and writes structured **results**.

***

## Run lifecycle

Every run moves through a sequence of statuses:

| Status        | Description                                             |
| ------------- | ------------------------------------------------------- |
| `pending`     | File collection created, processing not yet started     |
| `queued`      | Waiting for an available processing slot                |
| `in_progress` | Processing is actively running                          |
| `processed`   | Processing complete, results available                  |
| `error`       | Processing failed                                       |
| `cancelled`   | Processing was cancelled (terminal state; stop polling) |

When you fetch results via [`GET /v2/workflows/{wid}/files/{collection_id}/results/`](/api-reference/files/results), the endpoint returns **412 Precondition Failed** while the run is still in flight, and **200 OK** once it reaches `processed`. For production integrations, prefer [webhooks](/api-reference/webhooks/overview) over polling.

***

## What the results contain

A run produces **one output section per node type that ran**. The results envelope has a fixed shape — sections corresponding to nodes you didn't include come back empty (`null` or `[]`), so client code can read every key unconditionally.

| Section           | From which node        | Shape                                                                                                                                                                                                             |
| ----------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `parse`           | the parse node         | Object with structured markdown + per-block confidence. `null` if the workflow has no parse node (rare — parse is required by topology).                                                                          |
| `classifications` | classify nodes         | Array of `{category, confidence, evidence}`. Empty when no classifier ran.                                                                                                                                        |
| `splits`          | the splitter node      | Array of `{name, files, confidence, partitions}` describing the segments. Empty when no splitter ran.                                                                                                             |
| `extractions`     | extract nodes          | Array of `{split_name, partition, fields}`. Linear workflows produce one untagged entry; branched/split workflows produce one entry per `(split, partition)`. Empty when no extract ran (parse-only workflows).   |
| `extraction`      | extract nodes (legacy) | **Deprecated.** Flat `{field_name → ExtractedField}` dict, populated only for linear workflows. Kept for backward compatibility; new code should read `extractions[]`. Will be removed in a future major version. |

Each extracted field carries a `value`, an optional human-supplied `value_override`, a `confidence` score (0–100), a `verification_status`, and an `evidence` array (source-text snippets + page numbers). See [Response formats](/api-reference/response-formats) for the full envelope, including the canonical reading pattern for `value` vs `value_override`.

<Note>
  **What the SDKs give you back** — both the [TypeScript](/api-reference/sdks/typescript) and [Python](/api-reference/sdks/python) SDKs return a `Result` from `Run.wait()`. For linear `parse → extract` workflows the scalar values are right there: `result.fields["name"].value` (Python) or `result.field("name")?.value` (TypeScript). The full envelope — parse markdown, classifications, splits, multi-extraction entries — lives at `result.raw` in both languages, with Python additionally exposing a typed `result.parse` view. Expect more typed accessors as the underlying atomic operations stabilise.
</Note>

***

## Confidence and evidence

Two signals that travel with most outputs.

### Confidence

A 0–100 score indicating how certain anyformat is about a value.

* For `parse`: two document-level scores — one for how confident anyformat is in the **text** it read, and one for how confident it is in the **page layout** it detected — plus a per-block score inside the rendered markdown. (Technically: `parse.parse_confidence` comes from the language model's token log-probabilities, and `parse.layout_confidence` from the YOLO layout-segmentation model; each `<section>` of the markdown carries a `data-confidence` attribute.)
* For `extractions`: a per-field score on each extracted value.
* For `classifications`: a per-verdict score.

### Evidence

An **array** of metadata objects showing where a value came from.

It's an array because some values are **inferred** across multiple spans rather than copied from a single place. Each evidence object has:

* The **snippet of text** the value was derived from
* The **page number** in the document

Evidence is the right signal to surface in any human-review UI — it lets reviewers jump straight to the source.

***

## What's next?

<CardGroup cols={2}>
  <Card title="Outputs" icon="file-export" href="/concepts/outputs">
    Export formats for results — CSV, Excel, JSON, Markdown
  </Card>

  <Card title="Response formats" icon="reply" href="/api-reference/response-formats">
    Full schema of every section in the results envelope
  </Card>

  <Card title="Get results" icon="download" href="/api-reference/files/results">
    The endpoint that returns the envelope
  </Card>

  <Card title="Webhooks" icon="bell" href="/api-reference/webhooks/overview">
    Get notified the moment a run completes — no polling
  </Card>
</CardGroup>
