Skip to main content
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

models/contacts.ts
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 * * * *" },
});
FieldPurpose
datasetThe connector handle whose dataset this model reads from.
extractSlugThe connector action that returns rows (e.g. fetchRecords).
configParameters for that action — the object type, filters, column selection, etc.
scheduleHow 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:
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 lists the extractor actions available for that system.

Refreshing

A model re-extracts on its schedule, or on demand:
cargo-ai storage model refresh <model-uuid>
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, or use an object model for data Cargo owns.