GitHub export/restore

Stay organized with collections Save and categorize content based on your preferences.

Dialogflow CX integrates with GitHub. This integration makes it easy to export your agent to JSON for a push to GitHub, and to pull from GitHub for an agent restore. The JSON exported format pushed to GitHub is the expanded zip file contents of the exported agent.

Using this feature allows you to take advantage of GitHub source control features like:

Limitations

GitHub has a rate limit for the number of requests per hour (5000 for non-enterprise accounts, 15,000 for enterprise accounts). If your agent push exceeds this limit, the Dialogflow console will report the rate limit error. You can retry the push after an hour. This limitation will be addressed in a later Dialogflow release.

Configuration

To configure this integration:

  1. Open the Dialogflow CX Console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Click the Manage tab.
  5. Click Git in the Testing & Deployment section.
  6. Click Add Git integration, and a configuration dialog opens.
  7. Enter the following:
    • Display name for the GitHub connection.
    • GitHub repository URL (for example: https://api.github.com/repos/<repository_owner>/<repository_name>).
    • GitHub branch URL.
    • GitHub personal token. If you use a fine-grained personal access token, you need the following permissions access:
      • Contents: Read and write
      • Metadata: Read-only (should be auto-selected after selecting Contents permission)
  8. Click Connect.

This configuration can be changed at any time by clicking on the edit icon.

Push and restore

Once configured, you can push/pull your agent to/from GitHub.

The Push button is used to export your agent and make a commit to the GitHub branch. This commit will consist of the entire agent and not specific changes.

The Restore button is used to pull your agent data from the GitHub branch and restore your Dialogflow agent from this data. This will overwrite your agent in the same way that any agent restore behaves.

Example use case

The following example illustrates how this feature can be used by multiple people to propose different agent changes to a production agent.

Consider that your agent uses the following GitHub branches:

  • Prod: branch for your production agent
  • Dev1: branch for agent development
  • Dev2: another branch for agent development

User 1 wants to propose agent changes and takes the following steps:

  1. Export the production agent to a new agent.
  2. Make the desired changes to this agent copy.
  3. Test the changes.
  4. Push the altered agent to the Dev1 branch.
  5. Create a merge request to the Prod branch.

User 2 wants to propose agent changes and takes the following steps:

  1. Export the production agent to a new agent.
  2. Make the desired changes to this agent copy.
  3. Test the changes.
  4. Push the altered agent to the Dev2 branch.
  5. Create a merge request to the Prod branch.

User 3 reviews merge requests from both users and takes the following steps:

  1. Resolve conflicts.
  2. Commits approved changes.
  3. Restores the production GitHub branch to the production Dialogflow agent.