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

# Versions and Drafts

> How survey versions work: version statuses, the version chip, the Version history page, creating a draft from a published version, why published and imported versions are read-only, Voxworks copies, archiving, and the guards that stop you deleting content that is in use.

## How survey versions work

A survey is a container; its content lives in **versions** — `v1`, `v2`, `v3` and so on. Each version holds its own complete copy of the sections, questions, options, rules, variables and fixed-section settings.

* A new survey starts as **v1**, a draft.
* Only a **draft** can be edited.
* **Publishing** freezes a version for good: *"Published versions are immutable — create a draft to make changes."*
* To change a published survey, you create a new draft from it, edit that, and publish it in turn.

A survey has at most **one working version** at a time — one draft, or one version being validated or published — and at most **one published version**.

***

## Version statuses

| Status                         | Meaning                                                                                  |
| ------------------------------ | ---------------------------------------------------------------------------------------- |
| **Draft**                      | Being edited. Can be compiled and test called.                                           |
| **Validating** / **Validated** | Frozen while a publish checks it. A version returns to *Validated* if its publish fails. |
| **Publishing**                 | Being compiled as the live version.                                                      |
| **Published**                  | The live version. Real calls run it. Read-only.                                          |
| **Retired**                    | Was published, replaced by a newer publish. Read-only.                                   |
| **Imported**                   | Uploaded from a file. Read-only for good.                                                |
| **Failed**                     | Could not be processed.                                                                  |

***

## The version chip

The workspace header shows the selected version as a chip — *v3* with a status pill: green for published, red for failed, grey for retired and amber otherwise. Imported versions show **Read-only**.

Click the chip to switch versions. The menu, headed **Versions**, lists the five newest, **See (n) more** for the rest, and a **Version history** link. Results can also be filtered by version (see [Results](/surveys/results)).

When the selected version cannot be edited, every form in the workspace is read-only and says so — for example *"This version is read-only — create a draft to change it."*

***

## Version history

Open it from the chip menu or the history icon in the workspace header. The page is headed **Version history** — *"Published versions are immutable — create a draft to make changes."* — with **Back to editor**.

Once the survey has compiled, the **Compiled identity** card at the top shows its compiled **Script** and its number of flow ids.

| Column        | Shows                                                                                                                                              |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Version**   | `v1`, `v2`, …                                                                                                                                      |
| **Status**    | The version's status.                                                                                                                              |
| **Origin**    | Where the version came from.                                                                                                                       |
| **Source**    | The import provider, *Copied version* or *Authored*.                                                                                               |
| **Questions** | *(n) questions · (m) rules*                                                                                                                        |
| **Compile**   | *Compiled · 0.6.0* or *Published · 1.0.0* (with *×N* for repeat compiles), a red *Failed*, or the compile status in words, such as *Not compiled*. |
| **Published** | When it was published.                                                                                                                             |

Each row has **View** (open it in the workspace), **Readiness** (open its readiness report) and, on versions that are not drafts, **Create draft**.

### Create draft

**Create draft** copies that version's sections, questions, options, rules, variables and fixed-section settings into a new draft with the next number — the confirmation is *Draft created from this version*. It needs the `surveys.edit` permission. If the survey already has a draft, work in that draft instead — a survey can have only one working version at a time.

Use it to change a published survey, or to go back to an older version: create a draft from the version you want, then publish it.

***

## Copies

**Create Voxworks copy** (on the surveys list row menu, or in the header of an imported survey) and **Duplicate as copy** (in the workspace's **Survey actions** menu) create a **new survey** from the source survey's latest version, named *(survey name) — Voxworks copy*. It brings over the sections, questions, options and fixed-section settings, but not the routing rules or survey variables — add those again in the copy. The copy is fully editable, is badged *Voxworks copy* on the list, and has its own versions, results and compiled script. The confirmations are *Voxworks copy created* and *Editable Voxworks copy created*.

A copy is the only way to edit an imported survey. See [Importing surveys](/surveys/import).

***

## Archiving

**Archive** on the surveys list row menu hides a survey from the list (*Survey archived*). Speak to the Voxworks team if you need an archived survey back. Archiving does not change the compiled script, so remove the script from any batches and numbers first if you want calls to stop.

***

## What cannot be deleted

To protect data you have already collected and the rules that depend on it, some deletions are refused with an explanation.

**Questions**

* *"This question is used by the rule “(key)” (trigger|target|condition). Delete or edit that rule first."*
* *"The variable “(key)” is derived from this question. Delete or re-point it first."*
* *"The question “(key)” reads this question's answer. Edit it first."*
* *"The section “(key)” reads this question's answer. Edit it first."*
* *"This question has (n) recorded answer(s) on this version, so it cannot be deleted. Use “Create draft” on the version history page to copy the survey into a new draft and delete it there, or hide it with a rule instead."*

**Options** (when saving a question with an option removed)

* *"(options) is/are still read by (rules). Change or delete that rule/those rules before removing the option/those options."*

**Variables**

* *"(rules) still sets/set this variable. Change or delete that rule/those rules first."*

A deletion can also be refused with one of these messages:

* *"This (question|section|rule|variable) is still used by other parts of the survey, so the database refused to delete it. Delete or re-point the rules and variables that refer to it first."*
* *"This (…) is part of a version that already holds recorded interview data, so the database refused to delete it. Create a new draft and delete it there instead."*

Editing refused on a version that is not a draft reads *"Only draft survey versions can be edited."*, and on an imported version *"Imported versions are read-only. Create a Voxworks copy to edit."*
