# Publishing (/docs/guides/publishing)



Publishing turns the working draft into an immutable **version** and pins every dependency it uses
(see [Versioning](/docs/concepts/versioning)).

## Publish [#publish]

From the decision page or the flow builder, choose **Publish**, write what changed and, optionally,
a label such as `stable`. Validation runs first: if the checks fail, nothing is published.

## Test cases gate the publish [#test-cases-gate-the-publish]

A decision can carry **test cases**: an input and what the answer must be (`status`, `decision`, a
subset of `outputs`, `actions` that must be requested, or an expected `errorCode`). Only what a
case states is checked, so adding an output does not break every case written before it.

Every enabled case runs **before** a publish, against exactly what is about to be published, and a
single failure refuses the publish with `422 TESTS_FAILED` and the full report. A simulation can be
saved as a case in one click. Restoring an old version skips the cases on purpose — a rollback must
not be blocked by cases written for newer logic.

## Four-eyes approval [#four-eyes-approval]

A project can require approval to publish (**Settings → Governance**, admins only). Then **Publish**
becomes **Request publication**: the current draft is frozen, validated and its test cases run, and
the request waits in **Reviews** with what it changes against the version in production. Someone
other than its author approves — which publishes exactly the frozen content — or rejects it with a
comment.

<Callout title="Published logic never changes under your feet">
  Editing a shared table cannot change a decision that is already serving traffic. To pick up the
  new table you publish the decision again; to roll back you restore an old version, which publishes
  it as a new one.
</Callout>

## Versions [#versions]

**Versions** lists what was published, by whom and with which label. Any two versions, or a
version and the working draft, can be **compared**: added nodes in green, removed in red, changed
in amber, with the settings that differ listed per node. **Restore** publishes old logic as a new
version.

When a decision is deployed to an environment, publishing also deploys it there — see
[Environments](/docs/concepts/environments).
