Versions and environments

You can create multiple versions of your agent and publish them to separate environments.

When you edit an agent, you are editing the draft agent. At any point, you can save the draft agent as an agent version, which is an immutable snapshot of your agent.

When you save the draft agent, it is published to the default environment. When you create agent versions, you can publish them to custom environments. You can create a variety of custom environments for:

  • testing
  • development
  • production
  • etc.

Production traffic

A draft agent is updated every time a developer on your team makes a change. It is easy to break a draft agent unintentionally, especially if multiple people have write access to the agent. In addition, a recently edited draft agent may be inconsistent with the trained model, because training may have a delay or require manual execution.

You should always use agent versions for your production traffic. Draft agents should be tested before promoting them to production versions, and you can rollback to a previous version if any problems are discovered.

Publish a version in a new environment

To publish an agent draft to a version and create a custom environment:

  1. Go to the Dialogflow ES Console.
  2. Select your agent near the top of the left sidebar menu.
  3. Click the settings button next to the agent name.
  4. Click the Environments tab.
  5. Click Publish a version.
  6. Add an optional description and click Next.
  7. Select +New Environment.

  8. Enter an environment name.

  9. Choose the fulfillment method for the environment.

  10. Select Text-to-speech settings for the environment.

  11. Click Publish.

  12. The environment information is now listed in the Custom environments section.

Revert an environment to a previous version

You can revert an environment to a previous agent version:

  1. Click an environment in the Custom environments section.
  2. The environment settings dialog opens.
  3. Click the option button for a previously published version in the Publishing History section.
  4. Click Revert to this version.
  5. The publishing history will be updated.

Load a previous version to draft

To load a previous version to draft:

  1. Click an environment in the Custom environments section.
  2. Click the option button for a previously published version in the Publishing History section.
  3. Click Load to Draft.
  4. Click Yes, I'm sure.

Test your agent in an environment

You can use the API to test your agent in any of your custom environments. Call the detect intent method, but alter the endpoint URL by inserting environments/environment-name/users/-/ between agent and sessions.

For example, the following endpoint uses the "development" environment with an unspecified user:


Environment-specific settings

Fulfillment and text-to-speech are configured by the environment, so the agent will use the environment's settings for these features.

Google Assistant

If you are using Actions on Google release environments, you should not use the Dialogflow inline code editor, because it does not support versioning. You should use a custom webhook in this case.


The following limitations apply:

  • Maximum number of environments per agent: 10
  • Maximum number of versions per agent: 1000