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

# Sync health and freshness

> Know how fresh connected data is, what each sync state means, and what protects your served data when a source listing goes wrong.

Every active document library connection is synced on a schedule. Each pass looks for new, changed and removed files and applies what changed to the served data. This page defines the sync schedule, the sync run state model, the freshness target, and the safety checks that stop a bad source listing from damaging your served data. Nexio monitors sync health for you; the portal pages described here are operated by Nexio today.

## How it works

1. Every hour, the worker sweeps every `ACTIVE` document library connection.
2. The pass finds the files that were added, changed or removed since the last pass.
3. New and changed files are replicated, re-read and re-extracted. Removed files are de-indexed. See [Indexing and extraction](/connections/indexing-and-extraction).
4. One pass on one connection is capped at 30 minutes. A pass that runs past its cap fails with a timeout rather than blocking the next sweep.

## Sync run state model

| Status         | Meaning                                                              | What happens next                                                    |
| -------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `running`      | The pass is in progress.                                             | It ends as `completed`, `failed` or `needs_review`.                  |
| `completed`    | The pass finished cleanly.                                           | This counts as a clean pass for freshness.                           |
| `failed`       | The pass failed. `error_class` says why (below).                     | The next hourly pass tries again.                                    |
| `needs_review` | The safety check tripped (below). Nothing from the pass was applied. | Nexio inspects the pass and releases it, or fixes the source.        |
| `releasing`    | Nexio released a parked pass and its held changes are being applied. | It moves to `released`, or back to `needs_review` if applying fails. |
| `released`     | The released pass applied.                                           | Normal sweeps resume.                                                |

| `error_class`         | Cause                                                                      |
| --------------------- | -------------------------------------------------------------------------- |
| `timeout`             | The pass exceeded its 30 minute cap.                                       |
| `graph_api`           | A Microsoft Graph request failed.                                          |
| `auth`                | Authentication to the source failed.                                       |
| `interrupted`         | The pass was stopped before it finished, for example by a worker shutdown. |
| `stale_worker_crash`  | The worker stopped mid-pass.                                               |
| `stale_claim_expired` | A classification report's reservation expired before it ran.               |
| `unknown`             | Any other failure.                                                         |

## Sync health in the portal

The connection's page in the portal derives one health state from its sync run history. Only sync passes count (hourly, manual and initial runs); classification reports and rebuilds do not. The states are checked in the order below.

| Health    | Meaning                                                                                     |
| --------- | ------------------------------------------------------------------------------------------- |
| `unknown` | History could not be read.                                                                  |
| `never`   | No sync pass has run.                                                                       |
| `syncing` | Passes exist but none has finished yet.                                                     |
| `failing` | The latest finished pass failed.                                                            |
| `parked`  | The latest finished pass is `needs_review` or `releasing`.                                  |
| `stale`   | No clean pass within the last 4 hours. Served data may lag the source.                      |
| `healthy` | A clean pass finished within the last 4 hours. Of these states, only this one reads "Live". |

The freshness target is a clean pass within 4 hours.

## Protection against bad listings

A partial or failed listing from a source can look like a mass deletion. The platform does not act on it:

* A pass that would de-index more than 5 documents and more than 20 percent of the connection's known documents stops, applies nothing, and parks as `needs_review`. Both conditions must hold, so small changes on a small library flow through.
* The same limit applies to new and changed documents, because each one starts a paid extraction. A pass that would add or re-read more than 5 documents and more than 20 percent of the known documents also parks as `needs_review`.
* A Nexio operator inspects the pass and releases it when the changes are real.

De-indexing deletes no row. A removed file's served records are closed with an end date, and the file is marked removed at source.

## Warehouse connections

Snowflake connections are not swept hourly; they are queried in place. Before a warehouse is used, Nexio can run a discovery census: a read-only survey of the tables and views in the warehouse with row counts and last-changed times, the column catalog with a personal-data flag per column (`true` classified and masked, `false` not personal data, `null` not yet classified), and a masked sample of up to 10 rows per eligible table. A dry run issues metadata statements only.

<CardGroup cols={2}>
  <Card title="Indexing and extraction" href="/connections/indexing-and-extraction">What a pass does to each document.</Card>
  <Card title="Served data" href="/connections/served-data">How current a served-data read is.</Card>
</CardGroup>
