> For the complete documentation index, see [llms.txt](https://docs.trezalabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trezalabs.com/pipelines/publishing.md). Agents can also search and read this documentation through its [MCP server](https://docs.trezalabs.com/~gitbook/mcp).

# Publishing & versioning

Publishing turns a pipeline into a versioned HTTP endpoint. This page covers how versions work, how to roll back, schedules, share links, and how to read run history.

***

## Draft vs. published

Every pipeline has two states:

* **Draft** - the graph you edit on the canvas. Running from the editor executes the draft.
* **Published** - a frozen snapshot that serves API traffic. The `/invoke` and `/chat/completions` endpoints always run the published snapshot, never your in-progress draft.

This separation means you can keep editing a live pipeline without affecting production calls until you publish again.

Click **Publish** in the editor toolbar to publish. It is disabled while the graph has errors; warnings do not block it. The **Published** dialog opens after each publish, and again from the version tag (for example **v3**) next to the pipeline name. It shows the pipeline's schedule if it has one, ready-to-copy calls in cURL and the OpenAI SDK, and its version history.

An account can have up to 25 published pipelines at a time. Publishing a new version of a pipeline that is already live never counts against that.

***

## Versions

Each time you publish, Treza snapshots the current graph and assigns it an incrementing **version number**. The version is returned on every API response (the `version` field on `/invoke`, and the `x-treza-pipeline-version` header on `/chat/completions`), so you always know which snapshot produced a result.

* Re-publish to cut a new version after editing the draft.
* API keys and the endpoint URL stay the same across versions. Only the running snapshot changes.

***

## Rollback

If a new version misbehaves, open **Version history** in the **Published** dialog and click **Restore** on an earlier version. Restoring publishes that version's graph again as a **new** version, so history only moves forward (restoring v3 while v5 is live creates v6, noted "Rolled back to v3"). It also loads that graph into the editor as your draft, so you continue from what is now live. Live traffic switches to it at once.

***

## Schedules

A **Schedule** node runs the pipeline on its own: on a simple interval, on a cron expression, or once at a set date and time, in the timezone you pick. It only fires the **published** version; editor runs and API calls work as usual. The node can also cap a schedule's spend per day and retry a failed run a set number of times.

Because the schedule runs the published snapshot, deleting the Schedule node from the draft stops nothing until you publish again. To stop it without publishing, use the pause button in the **Schedule** section of the **Published** dialog. Resuming starts from now; the runs missed while paused are not fired.

***

## Share links

**Share** in the editor toolbar makes a review link. Anyone with the link watches the pipeline's clips in a browser, with no account. The pipeline has to be published first.

* A link that plays all clips keeps adding new ones as the pipeline makes them. Pick a subset and the link stays fixed.
* You can name a link, add a password, and revoke it at any time.

***

## Run history

Every execution, whether triggered from the editor, over the API, or by a schedule, is recorded as a **run**. Each run captures:

* **Per-node timing** - how long each node took.
* **Tokens and cost** - token counts and what each step charged.
* **Status** - success or error, with the failing node surfaced on errors.
* **Trigger** - whether the run came from the editor, the API, or a schedule.
* **Version** - which published version served the run.

Click the clock icon (**Run history**) in the editor toolbar to open the runs for a pipeline, then open any run to inspect it node by node and see exactly how a prompt became an output. The list filters to **All**, **Published** (runs that posted to a channel such as YouTube), or **Needs attention**.

***

## Requirements for API calls

For a pipeline to serve API traffic it must:

* Be **published** (an unpublished pipeline returns `409`).
* Have an **input node** for each value a caller sends. The request's input keys come from the input nodes' names.
* Have at least one **output node** to return a result. The response's output keys come from the output nodes' names.

`/chat/completions` needs both: a published pipeline with no input node or no output node returns `422` there.

See the [Pipeline API](https://docs.trezalabs.com/api/pipeline-api.md) for the full request and response contract.
