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

# Promoting Workspaces

> Push validated workspace changes to the production schema.

Promotion copies everything in your workspace — data, SQL models, scraper code, and extractor code — into the production schema. After promotion, your changes are live.

<Warning>
  Promotion is irreversible. Once a workspace is promoted, it is locked and cannot be deleted or modified. Validate your changes in the workspace before promoting.
</Warning>

## The promotion workflow

<Steps>
  <Step title="Create a workspace and make your changes">
    Start with a workspace scoped to your work. Run scrapers, update schemas, edit SQL models, and validate extraction results — all within the workspace.

    ```python theme={null}
    workspace_manage(
        operation="create",
        scraper_name="pa_medicaid_enrollment",
        name="medicaid-q1-update"
    )
    ```
  </Step>

  <Step title="Validate your changes">
    Before promoting, confirm the data looks correct. Use `warehouse_query` to inspect results and `workspace_manage(operation="list")` to review the workspace state.

    Read-only operations don't require a `workspace_id`, but you can pass one to scope queries to your workspace data.
  </Step>

  <Step title="Promote the workspace">
    When you're satisfied, promote:

    ```python theme={null}
    workspace_manage(
        operation="promote",
        workspace_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    )
    ```

    The response confirms promotion has started:

    ```
    Promote started for workspace a1b2c3d4-e5f6-7890-abcd-ef1234567890
    Workflow ID: promote-a1b2c3d4-e5f6-7890-abcd-ef1234567890
    Materializing gold/platinum tables — this may take several minutes.
    Check the server logs for progress.
    ```
  </Step>
</Steps>

## What promotion does

Promotion runs several steps in sequence:

1. **Pushes data to production** — for scraper-based workspaces, all rows added or modified since the workspace was created are upserted into the production schema. Rows deleted in the workspace are removed from production.
2. **Promotes SQL models** — the latest version of every SQL model edited in the workspace is written to production.
3. **Promotes scraper and extractor code** — any scraper or extractor code edited in the workspace is promoted alongside the data.
4. **Materializes gold and platinum tables** — views and tables downstream of your changes are rebuilt in the warehouse. This step may take several minutes depending on how many models depend on your changes.

<Note>
  SQL models are synced to GitHub automatically each time you save them with `sql_model_save`. Promotion applies those changes to the live production warehouse — it doesn't re-sync to GitHub.
</Note>

## After promotion

Once promoted, the workspace is locked:

* It appears with a `[PROMOTED]` label in `workspace_manage(operation="list")`
* It cannot be deleted
* No further changes can be made to it

If you need to make additional changes after promoting, create a new workspace.
