# Publishing and versions

> Edit safely while the live version keeps answering calls, then promote it when you're ready — and roll back if you need to.

Source: https://docs.cleartalk.ai/docs/pathways/publishing

Every pathway has two sides: the one you're editing, and the one answering real calls. They are not the same thing, and that's deliberate.

<Key>
  **Saving is always safe.** You can leave a pathway half-rebuilt over a weekend and Monday's callers hear exactly what they heard on Friday. Only **Promote** changes what live calls follow.
</Key>

## Two views, one pathway

The builder has a toggle between them:

* **Staging** — your working copy. Edit it freely, save as often as you like. Nothing here affects live calls.
* **Production** — the version currently answering calls. It's read-only, because a half-finished edit should never be able to reach a customer.

<Screenshot
  src="/img/pathway-production-view.png"
  alt="The Pathway builder switched to the Production view, showing a read-only banner over the canvas and the version number and promotion date beside the toggle."
  caption="The Production view. Same pathway, but this is what callers actually hear."
  pins={[
  { x: 61, y: 9, from: "top", at: -6, label: "The toggle. Production is greyed out until you've promoted at least once." },
  { x: 97, y: 12.7, from: "right", at: 102, label: "Which version is live, and when it went live." },
  { x: 21, y: 17.6, from: "left", at: -2, label: "Read-only, by design — you cannot accidentally edit what's answering calls." },
]}
/>

So saving is safe. Saving is *always* safe. You can leave a pathway half-rebuilt over a weekend and Monday's callers hear exactly what they heard on Friday.

<Compare
  caption="Promoting is the only thing that moves work from one side to the other."
  left={{
  title: "Staging",
  subtitle: "Your working copy",
  points: [
    "Edit and save as often as you like.",
    "Your tests run against this side, and so does Test Chat once you save.",
    "No effect whatsoever on live calls.",
  ],
}}
  right={{
  title: "Production",
  subtitle: "What answers real calls",
  points: [
    "Read-only — a half-finished edit can never reach a customer.",
    "Changes only when you promote.",
    "Any earlier version can go live again with Publish to production — a one-click way back.",
  ],
}}
/>

## Publishing

When staging is ready, click **Promote** in the toolbar. The **Promote to production** dialog sums up what changes against the live version — for example "Changed: 2 nodes, 1 connection". **Show changes** lists each node, connection and pathway setting as Added, Removed or Modified, field by field. If nothing changed it says "No changes since the last promotion."; on a first promotion, the whole pathway goes live.

Confirm with **Promote to production**. Your canvas is saved first, so unsaved edits go too, and that snapshot becomes the live version: from that moment, new calls follow it. The version it replaces stays in version history, so you can put it back later.

Before you promote, it's worth a quick pass:

* Walk the main path in **Test Chat** one more time.
* Check that every path reaches an ending.
* Run your tests — and if any test is marked **Required to publish** and isn't passing, you're warned first, with **Run tests** or **Publish anyway**. See [Testing your pathway](/docs/pathways/testing).

## Version history

Every save is kept as a version — not just every promotion. Click **Versions** in the toolbar to open the history panel, listing versions newest first with who saved it, when, and an optional name and note:

<Screenshot
  src="/img/pathway-versions.png"
  alt="The Pathway versions dialog listing three numbered versions with who saved each and when, the newest tagged Staging, and one older version from before version history."
  caption="Every save leaves a version behind. The one you're editing carries the Staging tag; whichever is live carries Production."
  pins={[
  { x: 25.1, y: 30, from: "left", at: -2, label: "The version the builder is currently editing." },
  { x: 25.1, y: 43.4, from: "left", at: -2, label: "Who saved it and when — this is your record of what changed when." },
]}
  redactions={[
  { x: 3.4, y: 93.6, w: 11.6, h: 5.2, reason: "Account name and email hidden" },
  { x: 25.9, y: 32.6, w: 7.9, h: 1.8, reason: "Account name hidden" },
  { x: 25.9, y: 42.4, w: 7.9, h: 1.8, reason: "Account name hidden" },
]}
/>

Two badges tell you where a version stands: **Staging** marks the one you're currently editing, **Production** marks whichever is answering calls right now. Neither, either, or both can land on the same row.

Each version gives you three things to do with it:

* **View** opens it read-only, without disturbing what you're currently editing.
* **Restore** brings it back as your staging version. This does **not** rewind — restoring mints a brand-new version carrying that old content, so nothing already in the history is lost, and the restore itself becomes a new entry you could undo the same way.
* **Publish to production** sends that version live immediately, whether or not it's your current staging version. This is how you roll back: find the last version you trust and publish it directly, without rebuilding it on the canvas first.

Both restore and publish ask you to confirm first — publishing warns that calls start using it immediately.

<Callout title="Restore doesn't erase anything">
  Restoring an old version doesn't throw away the work you have now. It copies the old content into a new version on top of your history, so your current staging state is still sitting right below it if you change your mind.
</Callout>

Want a version to carry a name? Before you save, click the tag icon next to **Save** to add a short name and note — "after-hours branch," "fixed the insurance question." Plain **Save** still works with one click; naming is optional and only takes effect on the save you attach it to.

### Versions from before history was tracked

A pathway that existed before this feature has a **Before version history** group at the bottom of the list. You can **View** or **Restore** those, but not publish one directly. Restoring works the same way — a new staging version, nothing deleted — except that document-capture settings and knowledge-base links weren't kept on versions that old, so set those up again before you promote.

## Working on a busy pathway

For one taking live calls all day:

* **Make one change at a time.** If quality drops, you'll know what did it.
* **Promote at quiet hours** where you can. A mid-conversation switch is safe — calls in progress finish on the version they started with — but you'd still rather learn about a mistake at 7am than during your busiest hour.
* **Watch the first calls afterwards.** Open Conversations, read a handful of transcripts, confirm it sounds like you intended.
* **Keep a note of why**, not just what. "Added the insurance question because 30% of callers asked" is worth far more in three months than a diff.

## Global settings

Alongside the canvas, a pathway has its own settings: its name, a description, and instructions applied to *every* step. That last one is the right home for rules that shouldn't be repeated fifteen times — how the agent should sound, what it must never promise, the business name. Changing them affects everything, so they follow the same staging-and-promote rule as the canvas.
