Create an Action

To develop with Dialogflow, you first need to create an Actions on Google developer project and a Dialogflow agent. Having a project allows you to access the developer console to manage and distribute your Action. The Dialogflow agent contains all the intents that define your Action.

Create the developer project and Dialogflow agent

  1. Go to the Actions console.
  2. Click on Add/import project, enter YourAppName for the project name, and click Create Project.
  3. Scroll down to the More options section and click on the Conversational card.
  4. Click Build > Actions in the left nav.
  5. Click Add your first Action
  6. On the Custom intent card, click Build.
  7. The Dialogflow console appears with information automatically populated in an agent. Click Create to save the agent.

Start with the Dialogflow starter Action

For your first Action, we recommend you start with the Dialogflow starter Action. It includes a Dialogflow agent with intents that you'll most likely use and a Google Cloud Function for fulfillment.

  1. Download the starter agent for Dialogflow into a known directory. We'll refer to this directory as <sample_dir>
  2. Restore the <sample_dir>/ into the YourAppName agent:
    1. In the left navigation, click on the gear icon to the right of the agent name.
    2. Click on the Export and Import tab.
    3. Click RESTORE FROM ZIP and select the <sample_dir>/ file.
    4. Type RESTORE in the text box, click RESTORE, then DONE. When the restoration is finished, the following screen appears. Make note of your Action project's ID; you'll need it to deploy the sample's fulfillment.

      Figure 1. Dialogflow project settings page

Enable Fulfillment

Enabling fulfillment lets you return responses to users with your web fulfillment code instead of using Dialogflow's Responses feature. To do this, you must enable fulfillment for the entire agent and then select the intents that you want to use fulfillment for. To enable fulfillment:

  1. Click on Fulfillment in the left navigation.
  2. Enable the Webhook option.
  3. Enter a dummy URL into the URL field.
  4. Click Save