You can create multiple versions of your agent flows and deploy them to separate serving environments.
When you edit a flow, you are editing a draft flow. At any point, you can save a draft flow as a flow version. A flow version is an immutable snapshot of your flow data and associated agent data like intents, entities, webhooks, pages, route groups, etc.
When you save a draft flow, it is deployed to the default environment. When you create specific flow versions, you can deploy them to custom environments. You can create a variety of custom environments for:
- testing
- development
- production
- etc.
Production traffic
A draft flow is updated every time a developer on your team makes a change. It is easy to break a draft flow unintentionally, especially if multiple people have write access to the agent. In addition, a recently edited draft flow may be inconsistent with the trained model, because training may have a delay or require manual execution.
You should always use flow versions for your production traffic. Draft flows should be tested before promoting them to production versions, and you can rollback to a previous version if any problems are discovered.
Load a flow version to draft
At any time, you can load a flow version to draft, so it is editable and used by the default environment.
Loading a flow version to draft can update multiple resources in an agent, including agent-level resources like intents and entities. When loading a version to draft with either the console or API, you can choose whether agent-level resources will be overwritten.
Manage flow versions
To manage your flow versions:
Console
To list the current versions for a flow:
- Open the Dialogflow CX Console.
- Choose your GCP project.
- Select your agent.
- Click Agent Settings.
- Click the Version tab.
- The agent flows are listed. Select one.
- The versions are listed for the selected flow.
The following information is displayed for each flow:
- Version: The version name.
- NLU Type: The NLU type for the flow version.
- Version Created: The date and time that the version was created.
- Status: The training status. A flow version is not ready to use until the status is marked as Ready.
To create a new flow version, click the Add Version button and provide information.
To load a specific flow version as the draft flow, click the load button near the right side of a version in the list. An option is provided to overwrite agent-level data when loading.
To delete a specific flow version, click the delete delete button near the right side of a version in the list.
API
See the methods for the Version
type.
Select a protocol and version for the Version reference:
Protocol | V3 | V3beta1 |
---|---|---|
REST | Version resource | Version resource |
RPC | Version interface | Version interface |
C# | Not available | Not available |
Go | Not available | Not available |
Java | VersionsClient | VersionsClient |
Node.js | VersionsClient | VersionsClient |
PHP | Not available | Not available |
Python | VersionsClient | VersionsClient |
Ruby | Not available | Not available |
Manage environments
To manage your agent environments:
Console
To list the current environments for an agent:
- Open the Dialogflow CX Console.
- Choose your GCP project.
- Select your agent.
- Click Agent Settings.
- Click the Environment tab.
- The agent environments are listed.
To create a new environment, click the Add Environment button and provide information.
To select flow versions and configure an environment, click an environment and provide information.
To view editing history of an environment, click the history history button near the right side of an environment in the list.
To copy an environment resource name that includes the environment ID, click the copy content_copy button near the right side of an environment in the list.
To delete an environment, click the delete delete button near the right side of an environment in the list.
API
See the methods for the Environment
type.
Select a protocol and version for the Environment reference:
Protocol | V3 | V3beta1 |
---|---|---|
REST | Environment resource | Environment resource |
RPC | Environment interface | Environment interface |
C# | Not available | Not available |
Go | Not available | Not available |
Java | EnvironmentsClient | EnvironmentsClient |
Node.js | EnvironmentsClient | EnvironmentsClient |
PHP | Not available | Not available |
Python | EnvironmentsClient | EnvironmentsClient |
Ruby | Not available | Not available |
Specify environment for runtime session calls
You can specify an environment for runtime session calls,
like detectIntent
, streamingDetectIntent
, matchIntent
,
and session entity calls.
To specify an environment,
alter the endpoint URL by inserting
environments/environment-id
between the agent
and sessions
path parameters.
For example, the following endpoint uses the 6db409d7-57ac-41d7-83bd-89b8768e2745
environment ID:
https://dialogflow.googleapis.com/v3beta1/projects/my-project-id/locations/us/agents/my-agent-id/environments/6db409d7-57ac-41d7-83bd-89b8768e2745/sessions/my-session-id:detectIntent
If an environment is not specified, the default environment is used.