# How to Version and Deploy Transformations


This guide covers how to:

- Save unpublished transformation changes as drafts
- Publish tagged versions for production use
- Deploy an older version when you need to roll back

For draft and version behavior in libraries, see [Version and publish libraries]({{< ref "transformations/libraries.md#version-and-publish-libraries" >}}).

## Save a transformation draft

1. Open the transformation in the [RudderStack dashboard](https://app.rudderstack.com/) and go to the **Editor** tab.
2. Update the transformation code.
3. Click **Save draft**.

{{< image src="images/features/transformations/deploy-transformations/save-transformation-draft.png" alt="Save draft button for a transformation" >}}

To discard unpublished edits, click **Discard changes**. The editor reverts to the version you opened for editing.

{{< info >}}
**Important considerations**

- **Transformation drafts cannot go to production**: Destinations always run the published **Active** transformation version. You cannot [connect a transformation]({{< ref "transformations/manage.md#connect-transformation-to-destination" >}}) that has never been published.
- **Draft changes are not published**: If a transformation is already connected to destinations, they continue to use the **Active** published version until you publish or deploy a different transformation version.
{{< /info >}}

After you save a draft, the transformation shows **Unpublished changes** in the header and a **Draft** badge in the editor.

{{< image src="images/features/transformations/deploy-transformations/transformation-draft-unpublished-changes.png" alt="Transformation with unpublished draft changes" >}}

## Publish a new transformation version

You can publish a new version directly — you don't need to save a draft first.

1. In the **Editor** tab, click **Publish**.
2. In the **Publish new version** modal, enter a **Tag** for the version. The modal shows the latest tag used so you can choose the next one.
3. Optionally add a **Description** of your changes.
4. Click **Publish**.

{{< image src="images/features/transformations/deploy-transformations/publish-new-transformation-version.png" alt="Publish new transformation version modal" >}}

{{< warning >}}
Publishing a new version makes it **Active** immediately. Destinations connected to this transformation start using the new code for newly ingested events.
{{< /warning >}}

## View version history

1. Open the transformation and go to the **Versions** tab.
2. Select a version in **Version history** to preview its code, tag, description, author, and timestamp.

The **Active** badge marks the version currently used in production.

{{< image src="images/features/transformations/deploy-transformations/transformation-version-history.png" alt="Transformation version history with Active version" >}}

To edit from a specific version without changing the Active version:

1. Select the version in **Version history**.
2. Click **Open in editor**.

The editor loads that version's code into a draft. The active version stays unchanged until you [publish a new version](#publish-a-new-transformation-version) or [deploy an older version](#deploy-an-older-transformation-version).

## Deploy an older transformation version

You can make a previously published version **Active** again. This is helpful when you need to roll back to a previous version due to a bug in the current active version.

1. Open the transformation and go to the **Versions** tab.
2. Select the older version you want to deploy. **Deploy** is available for non-Active versions.

{{< image src="images/features/transformations/deploy-transformations/deploy-older-transformation-version-1.png" alt="Deploy button for an older transformation version" >}}

3. Click **Deploy**.
4. In the **Replace active version?** modal, review the impact, then click **Validate & Continue**. Your [test cases]({{< ref "transformations/test.md" >}}) are validated against the selected version's code.

{{< image src="images/features/transformations/deploy-transformations/deploy-older-transformation-version-2.png" alt="Replace active version confirmation modal" >}}

5. Complete deployment based on the test results:

- If all tests pass, click **Deploy Now**.

{{< image src="images/features/transformations/deploy-transformations/deploy-older-transformation-version-3.png" alt="Deploy transformation modal when all tests pass" >}}

- If any tests fail, review the failures. You can click **Deploy Anyway** to proceed, or **Cancel** to fix the issues first.

{{< image src="images/features/transformations/deploy-transformations/deploy-older-transformation-version-4.png" alt="Deploy transformation modal when some tests fail" >}}

{{< warning >}}
Deploying with failing tests can cause data discrepancies or processing errors. Fix failing tests before you deploy when possible.
{{< /warning >}}

After a successful deploy, the selected version shows the **Active** badge. Connected destinations use that version for newly ingested events.

## See more

- [Create Transformations]({{< ref "transformations/create.md" >}}): Add a new transformation
- [Test Transformations]({{< ref "transformations/test.md" >}}): Create and run transformation test cases
- [Manage Transformations]({{< ref "transformations/manage.md" >}}): Connect, switch, and delete transformations
- [Transformation Libraries]({{< ref "transformations/libraries.md" >}}): Save drafts, publish library versions, and run inferred library tests

