Skip to main content
Tables are workspace-scoped. Table, sheet, column, cell, and operation IDs from one workspace cannot be reused in another. When you copy or migrate a Table across workspaces, you must recreate the Table structure and remap every workspace-specific reference. Use this guide when you need to move a Table from production to staging, from a shared workspace to a local or self-hosted environment, or from one team workspace to another.

When to use each path

GoalRecommended path
Move input rows onlyExport the sheet as CSV, then upload into a new Table in the destination workspace.
Recreate a full Table with computed columnsUse the API workflow below. Migrate dependencies first, then recreate sheets, columns, and rows.
Copy a legacy Evaluation or DatasetUse Migrate from Evaluations and Datasets when the source is still a legacy object.

Prerequisites

Before you recreate a Table in the destination workspace, make sure the resources it depends on already exist there.
  1. Prompt templates referenced by Prompt Template columns.
  2. Workflows referenced by Workflow columns.
  3. Tools referenced by prompt tool-calling or MCP columns.
  4. Workspace environment variables and provider API keys required for prompt, code, and tool execution.
  5. Folder paths if you want the new Table in the same registry location. Use Resolve Folder ID by Path in the destination workspace.
Provider keys and workspace env vars are not copied with a Table. Computed columns fail at recalculation time if the destination workspace is missing the keys they need.

Step-by-step: prod to local or cross-workspace

1. Export the source Table

In the source workspace, read the Table structure and row data. In the UI
  1. Open the Table and review each sheet’s columns, source mappings, and score configuration.
  2. Click Download to export text-column values as CSV. See Download a sheet.
With the API Use the workspace API key for the source environment.
  1. Get Table and List Sheets.
  2. List Columns for each sheet. Save each column’s type, config, and dependencies.
  3. List Rows for text-column values.
  4. Get Score and score-history settings if you need to recreate scoring.

2. Migrate dependencies

Copy or publish the resources referenced inside column config values before you recreate columns.
DependencyHow to resolve in the destination workspace
Prompt templatePublish the template with the same name, or use Upsert Prompt Template by External ID so agents and scripts can resolve it by a stable {source, external_id} pair.
WorkflowCreate Workflow in the destination workspace, or match by name with List Workflows.
Tool registry entryCreate Tool Registry in the destination workspace.
Registry folderResolve Folder ID by Path with the destination workspace API key. Folder IDs from the source workspace are not valid in another workspace.
Composition sourceRecreate the source sheet in the destination Table first, or update composition config to point at the new sheet and column IDs.
Attach External IDs to prompt templates, workflows, and tools in both workspaces before migration. External IDs give you a stable lookup key that does not change when you recreate resources in a new workspace.

3. Create the destination Table

Switch to the destination workspace API key, then recreate the Table shell.
  1. Create Table. Pass folder_id when you resolved a destination folder.
  2. For each sheet, either keep the default sheet or Create Sheet.
  3. Import text-column data with Import File, Import Request Logs, or Add Rows.
Create text columns before computed columns so row data and dependency targets exist.

4. Remap IDs and recreate computed columns

Every workspace-specific ID in the exported column definitions must be replaced with the destination workspace IDs. Build two lookup maps while you recreate the sheet:
MapPurpose
column_id_mapMaps each source column_id to the new column ID in the destination sheet.
resource_id_mapMaps source prompt template, workflow, tool, sheet, and table IDs to their destination equivalents.
Recreate columns in dependency order: text columns first, then computed columns whose sources already exist. When you Create Column or Update Column:
  1. Copy the source column config, then replace workspace-scoped resource IDs using resource_id_map.
  2. Rewrite each dependencies[].column_id using column_id_map.
  3. For composition columns, update the source table, sheet, and column references to the recreated resources in the destination workspace.

Example: remap column dependencies

Source sheet in workspace A:
{
  "columns": [
    { "id": "11111111-1111-1111-1111-111111111111", "title": "Question", "type": "text" },
    {
      "id": "22222222-2222-2222-2222-222222222222",
      "title": "Answer",
      "type": "prompt_template",
      "dependencies": [
        { "column_id": "11111111-1111-1111-1111-111111111111", "config_key": "question" }
      ]
    }
  ]
}
After recreating the sheet in workspace B:
{
  "columns": [
    { "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "title": "Question", "type": "text" },
    {
      "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
      "title": "Answer",
      "type": "prompt_template",
      "dependencies": [
        { "column_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "config_key": "question" }
      ]
    }
  ]
}
The prompt template reference inside config must also point at the template that exists in workspace B, not the source prompt_template_id.

Example: resolve a prompt template with External IDs

If the source template is attached to { "source": "acme_cms", "external_id": "qa_template" }, publish or upsert the same mapping in the destination workspace before creating the column:
curl -X PUT "https://api.promptlayer.com/prompt-templates/by-external-id/acme_cms/qa_template" \
  -H "X-API-Key: $DESTINATION_API_KEY" \
  -H "Content-Type: application/json" \
  -d @qa_template.json
Then reference the template by name or resolved ID in the column config when you create the column in the destination sheet.

5. Recreate scoring and run the sheet

  1. Configure Score to match the source sheet.
  2. Create Operation to recalculate computed columns. New computed cells start as stale until recalculation completes.
  3. Poll Get Operation until work finishes. Large sheets may return requires_confirmation with a confirmation_token — pass that token in a follow-up request to proceed.
  4. Compare destination outputs and scores against the source Table before switching automation.

Known limitations and mitigations

LimitationImpactMitigation
Workspace-scoped IDsTable, sheet, column, and cell IDs cannot be copied directly.Build column_id_map and resource_id_map while recreating the Table.
Computed cell values are not importableUpdate Cell only edits text columns. You cannot paste completed computed outputs into the destination sheet through the API today.Recalculate computed columns in the destination workspace, or keep source exports for offline comparison until computed-cell import is available.
Recalculation costRebuilding a large Table reruns every prompt, workflow, code, and LLM eval column.Recalculate in stages with column_ids and row_ids. Start with a small row sample to validate remapping before running the full sheet.
Provider keys requiredPrompt, workflow, MCP, and code columns need working provider and env-var configuration in the destination workspace.Copy workspace env vars and confirm provider keys before recalculation.
Composition across workspacesComposition columns point at table, sheet, and column IDs in one workspace.Recreate source sheets in the destination Table first, then update composition config.
MCP agent coverageThe PromptLayer MCP server does not yet expose Table create, update, or delete tools. Agents cannot fully automate cross-workspace migration through MCP alone.Use the Tables REST API for migration scripts. Use resolve-folder-id and External ID tools for dependency lookup.
Partial delete supportThe REST API supports Delete Table, Delete Sheet, and Delete Column, but iterative agent workflows may still lack matching MCP delete tools.Use the REST API to clean up mistaken migration attempts.
Migrate one sheet at a time.
  1. Export and review the source Table.
  2. Migrate prompt templates, workflows, tools, folders, and env vars.
  3. Recreate text columns and import row data.
  4. Recreate computed columns with remapped config and dependencies.
  5. Recalculate a small row sample and compare outputs.
  6. Recreate scoring, run the full sheet, and validate score history.
  7. Point automation at the destination Table.
Keep the source Table read-only until the destination Table matches expected outputs and scores.

API references

Create Table

Create the destination Table.

Create Column

Recreate computed columns with remapped dependencies.

External IDs

Resolve prompt templates, workflows, and tools across workspaces.

Create Operation

Recalculate computed cells after migration.