> ## 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.

# Script Editor Guide

> A tour of the script editor: the seven editor tabs and their shareable deep links, saving and the unsaved-changes guard, the multi-flow editor with Pre-Call flows and stages, drag-and-drop, shared-flow editing choices, and PDF export.

## Overview

The script editor is where you build everything a script contains — its conversational flows, guidelines, policies, knowledge base, data collection, post-call analysis, and settings. Open it from **Call Scripts** in the sidebar by selecting any script (or by clicking **Create & Continue** when [creating a new one](/scripts/creating-a-script)).

The editor has three tiers:

* **Toolbar** — a sticky header with a **Back** button on the left, the editor tabs in the centre, and the action buttons on the right: **Test Call**, **PDF**, **Save**, and **Publish**. A yellow **Unsaved Changes** badge appears here whenever your working copy differs from the last saved version.
* **Title row** — on the **Script** tab only: the script's name (click it to rename, press Enter to confirm or Escape to cancel) and its description (*Click to add a description...*). Next to the name sits the version picker, listing saved versions with a Live/Draft status pill plus **Compare** and **Push to production** actions; opening **Compare** lets you diff against your in-progress working copy, shown there as **Current** — see [Versions & Publishing](/scripts/versions-and-publishing).
* **Content area** — whichever tab you have open.

Nothing you do in the editor is persisted until you click **Save** (a new draft version) or **Publish** (the live version — the confirmation dialog reads "This becomes the live version. All calls will be made with this script."). **Test Call** with unsaved changes saves a draft version automatically first, so your test always runs against exactly what you see — see [Testing](/scripts/testing).

If you open an older version from the version picker, the editor switches to a **Read-only** view: Save, Publish, and Test Call are disabled until you return to the latest version.

***

## Editor tabs and deep links

The centre of the toolbar holds seven tabs. On narrow screens the tab row becomes a dropdown with the same options.

| Tab                    | What it configures                                                                                                 | URL value    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------ |
| **Script**             | Call Objectives and the multi-flow conversation editor (this page)                                                 | `builder`    |
| **Guidelines**         | Condition/Response rules for soft edge cases — see [Guidelines](/scripts/guidelines)                               | `guidelines` |
| **Policies**           | Named compliance rule sets — see [Compliance Policies](/scripts/compliance-policies)                               | `policies`   |
| **Knowledge Base**     | Facts the assistant can draw on — see [Knowledge Base](/scripts/knowledge-base)                                    | `knowledge`  |
| **Data Collection**    | Structured fields captured from the call — see [Data Collection](/scripts/data-collection)                         | `data`       |
| **Post-Call Analysis** | Fields evaluated after each call — see [Post-Call Analysis](/scripts/post-call-analysis)                           | `analysis`   |
| **Settings**           | Call type, duration, voice, Key Terms, Live Handoff, Intent Pathways, and more — see [Settings](/scripts/settings) | `settings`   |

The active tab is mirrored into the page URL as a `?tab=` query parameter, and the URL updates as you switch. That makes every tab **deep-linkable**: share or bookmark a URL ending in `?tab=settings` and it opens the editor directly on the Settings tab. Without the parameter, the editor opens on the Script tab.

The version-compare view is deep-linkable too, via a `?compare=` parameter — see [Versions & Publishing](/scripts/versions-and-publishing).

All tabs edit the same working copy — switching tabs never loses changes, and one **Save** persists everything at once.

***

## Saving and the unsaved-changes guard

The editor tracks your working copy against the last saved version:

* The **Unsaved Changes** badge appears in the toolbar as soon as anything differs, and the **Save** button enables. Saving shows a toast such as *Saved v0.3*; publishing shows *Published v1.0 to production*.
* **Leaving the page** with unsaved changes — via the Back button, a sidebar link, or the browser's back/forward buttons — opens the **Unsaved Changes** dialog: "You have unsaved changes. Are you sure you want to leave? Your changes will be lost." Choose **Stay** to keep editing or **Leave** to discard.
* **Closing or refreshing the browser tab** triggers the browser's own leave-page confirmation.
* Flow edits are validated as you type. If a flow has validation errors, saving is blocked with *Please fix validation errors before saving* until they are fixed.
* If a teammate saved the same script while you were editing, saving fails safely with *This script was changed since you opened it. Reload to get the latest version before saving.* — your changes are never silently overwritten, and neither are theirs.

***

## The multi-flow editor

The **Script** tab opens with [Call Objectives](/scripts/call-objectives) at the top, followed by the **Conversational Flows** editor. A script is made of one or more flows, each shown as a tab in the flow tab row:

* **Main Flow** — tagged with a **Main** badge. Every script has exactly one; it is where the conversation starts and it cannot be removed.
* **Pre-Call Flow** — tagged with a **Precall** badge, shown when the script has one. A Pre-Call flow runs before the main conversation begins on an outbound call, typically to prepare data the conversation will use. There is no button to add a Pre-Call flow to an existing script — speak to the Voxworks team for further custom configuration.
* **Sub-flows** — any further tabs. Click **Add Flow** to create one; it starts as "Flow *N*" with a single stage and one empty voice step. Callers reach a sub-flow when a **Flow step** in another flow routes to it — see [Sub-flows](/flows/flows-sub).

**Double-click** any flow tab to rename the flow inline (Enter confirms, Escape cancels). The gear menu at the right end of the tab row acts on the currently selected flow:

| Menu item              | What it does                                                                                                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Add Stage to Flow**  | Appends a new stage (named "Stage *N*") to the current flow.                                                                                                                          |
| **Remove from script** | Detaches a sub-flow from this script without deleting it — the flow itself is kept and can be reused. Not available for the Main or Pre-Call flow. The change persists when you save. |
| **Delete Flow**        | Permanently deletes the flow after a **Delete Flow** confirmation. A flow that has never been saved is simply removed from the script instead.                                        |

A flow cannot be removed or deleted while a Flow step elsewhere in the script still routes to it — a **Cannot delete flow** dialog lists the referencing flows so you can remove those references first. Deleting flows also requires a role with flow-deletion permission — see [Roles & Permissions](/team/roles-permissions).

Deleting the whole script (from **Settings → Delete**) asks whether to also delete its unshared flows; shared flows and templates are always preserved.

### Stages

Stages group a flow's steps into named sections — *Introduction*, *Qualification*, *Wrap-up* — so long flows stay readable. Stages are **purely organisational**: they have no effect on the call itself, which is routed entirely by each step's conditions ([Steps](/flows/steps)).

* **Rename** a stage by typing directly into its heading.
* **Add** a stage from the gear menu (**Add Stage to Flow**), from the **+** button that appears when you hover a stage heading (*Add stage below*), or from the stage's grip menu (*Add stage above*).
* **Delete** a stage from its grip menu. Only empty stages can be deleted, and the last remaining stage cannot be — move or delete its steps first (the disabled menu item's tooltip explains this).

An empty stage shows a dashed placeholder — *Drop steps here* — with an *or create new one* link that adds a fresh step in place.

### Drag-and-drop

Everything in the flow canvas reorders by dragging its grip handle (the vertical dots that appear on hover):

* **Steps** — drag a step's grip to move it within its stage or into another stage of the same flow. A blue insertion line shows exactly where it will land, and a highlighted stage background shows a drop into an empty stage. The editor auto-scrolls while you drag.
* **Stages** — drag a stage's grip to reorder entire stages, steps and all. Clicking the same grip (without dragging) opens the stage menu.
* **Conditions** — inside a step card, response conditions can also be reordered by dragging.

Reordering counts as an edit like any other: it marks the script as having unsaved changes, and on a shared flow it first triggers the shared-flow check below.

***

## Editing shared flows

A flow can be used by more than one script. Shared flows carry an amber **Shared** badge on their flow tab; hovering it lists every script using the flow and warns that changes affect all of them.

The first time you try to edit a shared flow — typing in a step, renaming, reordering, anything — the editor stops and opens the **This is a shared flow** dialog: "Editing it can affect other scripts. Choose how you want to proceed." It shows the flow's name, how many scripts use it, and the list of those scripts. You then choose:

| Choice                         | Effect                                                                                                                                                                                                                                                                                                               |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Edit all scripts** (default) | "Apply your changes to the shared flow. All *N* scripts using it will be affected." The flow unlocks for this editing session — its badge switches to a green **Unlocked**, an *Editing shared flow* notice confirms the choice — and your edits flow through to every script that uses it.                          |
| **Make unique**                | "Create a separate copy of this flow for this script. Other scripts stay untouched." Voxworks duplicates the flow, re-points this script (including any Flow steps that referenced the original) at the new copy, and confirms with *Flow made unique — you can now edit this flow without affecting other scripts*. |

Choosing **Cancel** leaves the flow untouched. The **Edit all scripts** unlock lasts only for the current editor session — reopening the script asks again.

***

## PDF export

The **PDF** button in the toolbar exports the script — including any unsaved changes — as a formatted "AI Call Script Summary" document, useful for stakeholder review and compliance sign-off. It contains:

1. **Objectives** — the script's call objectives
2. **Call Flow** — the Pre-Call Flow (if any), the Main Flow, then each sub-flow, with stages, steps, step scripts, and each step's conditions and routing targets
3. **Guidelines** — as a Condition/Response table
4. **Knowledge Base** — as an Item/Information table
5. **Voicemail Message**
6. **Settings** — script type, voice, and Max Call Duration
7. **Data Collection** — the configured fields

The header shows the script's name, description, type, and voice; pages are numbered, and the file is named after the script. A *PDF downloaded* toast confirms the export.

***

## Variables in the editor

Most text fields in the editor — step scripts, guidelines, knowledge base entries, tool inputs — accept variables. Type `/` (or `{{`) to open the variable picker and insert a reference such as `{{contact.first_name}}` (string — e.g. `Jane`), which renders as a highlighted pill. See [Flow variables](/flows/variables) for how variables resolve on a call.

***

## Next Steps

* [Flows overview](/flows/overview) — how flows, steps, and conditions shape the conversation itself
* [Versions & Publishing](/scripts/versions-and-publishing) — draft versions, the version picker, comparing, and going live
* [Testing](/scripts/testing) — run browser and phone test calls straight from the editor
* [Script Settings](/scripts/settings) — call type, duration limits, voice, Key Terms, Live Handoff, and Intent Pathways
