Userflow's environment and version control system let you safely iterate on your flows without disrupting the user experience. Each environment operates with its own unique Userflow.js token, creating complete isolation between staging and production users.
This separation means you can experiment freely in staging—testing new flows, refining existing ones, and making adjustments—while your production flows continue to run smoothly for live users. When you're ready, promote your tested changes to production with confidence.
Adding a new environment
To set up a new environment:
Select Settings > Environments from the sidebar.
Click New environment and give it a name, such as “Staging.”
A new Userflow.js token will be generated. Use this token in your Userflow.js snippet in your staging environment. Read more in the Userflow.js installation guide.
Version control
Now that you have two or more environments installed, you can easily manage where you publish your content. To make this even easier, Userflow offers easy-to-use version control.
Under a flow’s Versions tab, you’ll see:
Version history, listing all your previous versions. Userflow automatically creates new versions periodically, when you publish, or if multiple users edit the same flow.
Publish history, showing a log of when flows were published and by whom.
By clicking on the 3 dots to the right of each version, you can:
View its contents as it was in the Builder in read-only mode.
Compare two versions, which lets you inspect changes between them.
Publish it, for example, to revert to a previous version.
Restore it in case you want to undo some changes you’ve made.
Publish to a single environment
Once you have installed the Userflow.js snippet in your environment, you can publish content to it.
Open a specific flow.
Click Publish.
A screen appears showing what changes you have made since the last version was published.
Deselect Production.
Click Publish to Staging.
You can always keep track of which version you have deployed to which environment through the Versions tab and restore to the production version if needed.
Unpublish from an environment
If you have published something by mistake, you can always unpublish it via the following steps:
Open a flow and click the Versions tab.
Click on the 3 dots next to the environment you want to unpublish from.
Click Unpublish.
The same menu can also be used to publish the latest version of a flow.
Highlighting of non-production environments
To make it easy to tell when you’re in a non-production environment in Userflow, we mark the UI with a yellow top border and the name of the environment. This is demonstrated in places where data or analytics are specifically related to that environment.
By default, your initially created Production environment is marked as the primary environment. For the primary environment, you will not see any yellow highlight by default.
You can change which environments should have the highlight in Settings > Environments.