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

# Extractors

> How a connector action becomes a model's data source — the extractSlug and config that populate an integration-backed model.

An **extractor** is the connector action that populates a model. When you point `defineModel` at a connector's dataset, `extractSlug` chooses *which* action fetches the rows and `config` parameterizes it.

## The shape

```ts models/contacts.ts theme={null}
import { defineModel } from "@cargo-ai/cdk";
import { hubspot } from "../connectors/hubspot";

export const contacts = defineModel("contacts", {
  dataset: hubspot,             // the connector whose dataset backs this model
  extractSlug: "fetchRecords",  // the connector's extract action
  config: {                     // action-specific parameters
    objectType: "contacts",
    columnSelectionMode: "all",
  },
  schedule: { type: "cron", cron: "0 * * * *" },
});
```

| Field         | Purpose                                                                       |
| ------------- | ----------------------------------------------------------------------------- |
| `dataset`     | The connector handle whose dataset this model reads from.                     |
| `extractSlug` | The connector action that returns rows (e.g. `fetchRecords`).                 |
| `config`      | Parameters for that action — the object type, filters, column selection, etc. |
| `schedule`    | How often to re-extract (`cron`, or omit for manual refresh).                 |

## Discovering slugs and config

The valid `extractSlug` values and their `config` shape are per-integration. Discover them by generating types or querying the integration:

```bash theme={null}
cargo-ai cdk types                              # types extractSlug/config in your editor
cargo-ai connection integration get <slug>      # the integration's actions and extractors
```

Each connector page in [Integrations](/integration/overview) lists the extractor actions available for that system.

## Refreshing

A model re-extracts on its `schedule`, or on demand:

```bash theme={null}
cargo-ai storage model refresh <model-uuid>
```

<Note>
  Integration-backed models are read-only mirrors — the source system stays the
  source of truth. To write back, use the integration's write actions in a
  [workflow](/workflows/overview), or use an
  [object model](/models/object-models) for data Cargo owns.
</Note>
