# Index PDF tables

Project TABLE segments into bounded, Table.vue-ready pdf_table rows.

## When to use it

Turn extracted table segments into bounded rows suitable for a table view. This is a projection of detected table content; it is different from accepting a model-proposed editable user table.

## Add and configure

1. Add **Index PDF tables** from the workflow step picker.
2. Give the step a recognisable name and connect its required inputs.
3. Set the options below. Nested names identify fields within an object or a list item.
4. Validate the recipe, inspect the test result, then run it on the intended data.

The step identifier used in the editor’s code view is `table_index`.

## Settings

| Setting | Accepted value | Required | Default | What it controls |
| --- | --- | --- | --- | --- |
| Emit Manifest (`emit_manifest`) | boolean | No | true | Emit the table_index_meta manifest. |
| File Key Field (`file_key_field`) | string | No | "object_key" | File reference field. |
| Record Type (`record_type`) | string | No | "pdf_tables" | record_type column stamp for ALL emitted rows. The payload-level record_type discriminates kinds: pdf_table \| table_index_meta. |
| Segment Kind Field (`segment_kind_field`) | string | No | "kind" | Segment kind field. |

## Inputs and outputs

| Direction | Port | Content | Required | Multiple records |
| --- | --- | --- | --- | --- |
| Inputs | `in` | records | Yes | Yes |
| Outputs | `out` | records | Yes | Yes |

## Effects, testing, and recovery

Transforms or passes records without a declared external side effect.

The declared preview behaviour is to execute this step. Reads, processing, or model usage can therefore be real. Read [dry runs](/docs/workflows/dry-runs) before using a preview with live connections.

No duplicate-prevention key is declared for this step. The step declares safe replay for its supported recovery path.

## Example: Project a native table grid into Table.vue rows

Step settings:

```json
{
  "emit_manifest": false
}
```

Input records:

```json
[
  {
    "content_hash": "c3",
    "document_id": "doc-q3",
    "index": 4,
    "kind": "TABLE",
    "meta_data": {
      "grid": {
        "grid_version": 1,
        "headers": [
          "Region",
          "Revenue"
        ],
        "provenance": {
          "source": "xlsx",
          "table_id": "sheet1-t0"
        },
        "rows": [
          [
            "EU",
            "1200"
          ],
          [
            "US",
            "950"
          ]
        ]
      }
    },
    "object_key": "reports/q3.xlsx",
    "page_number": 1
  }
]
```

Expected output for this example:

```json
[
  {
    "cell_text_truncated": false,
    "cells": [],
    "cells_capped": false,
    "cells_have_bbox": false,
    "columns": [
      "Region",
      "Revenue"
    ],
    "columns_truncated": false,
    "content_hash": "c3",
    "document_id": "doc-q3",
    "file_name": "q3.xlsx",
    "n_cols": 2,
    "n_rows": 2,
    "nbbox": null,
    "object_key": "reports/q3.xlsx",
    "page": 1,
    "record_type": "pdf_table",
    "row_spans": [],
    "rows": [
      {
        "Region": "EU",
        "Revenue": "1200"
      },
      {
        "Region": "US",
        "Revenue": "950"
      }
    ],
    "rows_truncated": false,
    "segment_index": 4,
    "source": "xlsx",
    "table_id": "sheet1-t0",
    "table_index_version": 1
  }
]
```

## Example: Only TABLE segments with a table contract become rows

Step settings:

```json
{
  "emit_manifest": false
}
```

Input records:

```json
[
  {
    "index": 0,
    "kind": "TEXT",
    "object_key": "memo.pdf",
    "text": "Summary"
  },
  {
    "index": 1,
    "kind": "TABLE",
    "meta_data": {},
    "object_key": "memo.pdf"
  }
]
```

Expected output for this example:

```json
[]
```

## Check the result

Inspect the selected run’s status, counts, errors, and output records. An empty collection can be a valid result, and a completed step can contain per-record failures where the step defines that behaviour. Check the next step’s expected record shape before publishing or delivering the result.
