Versions and Labels

How prompt versioning and deployment labels work in the Prompt Workbench.

About

Every time you save a change to a prompt template, a new version is created. Versions give you a full history of how the prompt has changed over time, so you can compare iterations, understand what was changed, and roll back to any previous state if a change regresses quality.

Labels sit on top of versions and control which version is active in each environment. Instead of hardcoding a specific version in your application, you fetch by label. When you want to promote a new version to production, you reassign the label — no application code change needed.


Versions

Each version represents a snapshot of the prompt at a point in time. Versions are created when you commit a draft.

The version lifecycle:

  1. Draft: An in-progress edit that has not been committed yet. Drafts are not fetchable by label.
  2. Committed: A saved, immutable version. Can be assigned a label and fetched by name and version number.
  3. Default: One version can be marked as the default, used when no version or label is specified.

You can compare any two committed versions side by side in the Workbench and roll back to any previous version at any time.


Labels

Labels are named pointers to specific versions. They let you control which version your application uses without changing code.

LabelTypical use
ProductionThe version your live application uses
StagingA candidate version being tested before promotion
DevelopmentWork in progress for active development
Custom labelsAny label you create for your own deployment workflow

A label always points to exactly one version. When you reassign a label to a new version, all applications fetching by that label immediately get the new version on their next request.


Fetching by label

In your application, fetch a prompt by name and label instead of by version number. This decouples your code from specific versions:

# Always gets whichever version is labeled Production
prompt = Prompt.get_template_by_name("my-template", label="Production")
const prompt = await Prompt.getTemplateByName("my-template", { label: "Production" });

To promote a new version, reassign the label in the Workbench or via the SDK. Your application picks it up automatically.


Rollback

To roll back to a previous version, assign the label back to that version. The application immediately starts using the previous version on its next fetch. No redeployment needed.


Next steps

Was this page helpful?

Questions & Discussion