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

# Migrate one Clay table to a Play

> Turn one Clay table into a custom Deepline Play, validate its source before it runs, and compare a representative pilot before cutover.

[Human guide: work with your agent →](https://deepline.com/docs/human/migrate-from-clay.md)

> [!NOTE]
>
> Recreate one bounded Clay table workflow and compare a representative pilot
> with its original results.

Migrate one table at a time. Keep the current Clay table active while you prove
that the new Play has the same input, logic, review boundary, and acceptable
output on the same representative rows.

## Prerequisites

* A Clay table you can inspect, plus a small export of representative rows.
* The expected output fields, acceptance rules, and any review or writeback
  boundary.
* A local project folder with Deepline installed. Use the [Quickstart](https://deepline.com/docs/quickstart.md)
  if it is not installed yet.

Keep Clay credentials, browser session cookies, and exports with sensitive data
out of Play source and version control.

## Export the table with the Clay Extract bookmarklet

Use the bookmarklet when you are already signed in to Clay and want to capture
the table before you migrate it. It downloads a local
`clay_extract_<table>.json` file with the table configuration, fields, schema,
sample rows, and up to 500 records. It uses your existing Clay browser session.
it does not read, save, or send your Clay cookie to Deepline.

**1. Add the bookmarklet**

Drag **Clay Extract** to your bookmarks bar. If your browser does not allow
dragging, select the button to copy its URL, then create a bookmark and
paste the URL into its address field.

**2. Open the Clay table or workbook**

Open the table view you want to migrate. The bookmarklet also accepts a Clay
workbook URL and creates one export containing its tables.

**3. Run Clay Extract**

Select the saved bookmark. A progress message appears in the lower-right
corner, then your browser downloads the JSON file.

**4. Attach the export**

Attach the downloaded JSON when you ask `/clay-to-deepline` to document the
table. Review the generated map before you create or run a Play.

The bookmarklet calls Clay's table and workbook read endpoints from the Clay
tab, then downloads the export locally. It does not make changes in Clay.

## Capture the table before you recreate it

Use the installed `clay-to-deepline` skill to inventory the table. Give it a
Clay export or use its local extraction path. Ask for a review document before
any new Play is written:

```text theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
/clay-to-deepline Document this Clay table before migrating it.

Return a column-by-column map with inputs, formulas, provider actions, AI
prompts, conditional logic, outputs, and external writes. Mark every recovered
prompt as recovered or approximated. List dependencies in execution order and
flag anything that cannot be verified from the export.

Do not create a Play or run provider work yet.
```

Review this document against the live table. In particular, confirm provider
fallbacks, suppression rules, prompt text, and the conditions that allow a CRM
or campaign write.

## Create one custom Play

After you accept the column map, ask your agent to create a local Play:

```text theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
/deepline-gtm Create clay-migration.play.ts from the approved Clay table map.

Name the Play clay-migration and give it a top-level description. It must accept
{ "csv": "leads.csv" }. Preserve the source row, reproduce each approved
transformation in dependency order, and return the required output fields.

Keep external writes behind an explicit approval step. Return a miss_reason for
unresolved rows. Do not publish or run the Play until I review the source.
```

The target is a custom Play that your team can inspect and version. Do not
replace unverified table behavior with a generic enrichment shortcut.

## Validate it without deploying or spending credits

Check the local file before it runs:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline plays check ./clay-migration.play.ts
```

`plays check` bundles and validates the source. It does not publish the Play,
create a run, or call a provider.

## Compare a representative pilot

Create `leads-pilot.csv` with the header and a small mix of normal, sparse, and
edge-case rows from the Clay table. Run the custom Play on only that file:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline plays run --file ./clay-migration.play.ts \
  --input '{"csv":"leads-pilot.csv"}' \
  --watch
```

The pilot can use Deepline credits. Export its result and compare it with the
same rows in Clay:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
# Copy the run ID printed by the completed pilot.
RUN_ID="paste-the-pilot-run-id"
deepline runs export "$RUN_ID" --out clay-migration-pilot.csv
```

Check the input preservation, output values, unresolved rows, provider fallback
behavior, review boundary, and Deepline-credit usage. Record every intentional
difference before you continue.

## Publish only after the pilot passes

Keep Clay as the fallback until the pilot meets the agreed acceptance rules. Then
publish the reviewed source:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline plays publish ./clay-migration.play.ts
deepline describe clay-migration
```

For a scheduled, webhook-triggered, or writeback workflow, add the trigger and
external action only after the batch Play is correct. See [Webhooks and
schedules](https://deepline.com/docs/sdk-v2/webhooks-and-schedules.md) and [Cost control](https://deepline.com/docs/cost-control.md) for
the next boundary.

## Verify this task

Preserve input rows, selected action settings, accepted output, and exceptions. Compare the same records before declaring the migration equivalent.

Ask your agent to explain a failed check before repeating work or expanding the scope.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.