Pages

A Dialogflow CX conversation (session) can be described and visualized as a state machine. The states of a CX session are represented by pages.

For each flow, you define many pages, where your combined pages can handle a complete conversation on the topics the flow is designed for. At any given moment, exactly one page is the current page, the current page is considered active, and the flow associated with that page is considered active. Every flow has a special start page. When a flow initially becomes active, the start page becomes the current page. For each conversational turn, the current page will either stay the same or transition to another page.

You configure each page to collect information from the end-user that is relevant for the conversational state represented by the page. For example, you might create the pages (in blue) in the diagram below for a Food Order flow of a pizza delivery agent. The Start node of the diagram represents the start page of the Food Order flow. When the flow is complete, it transitions to the Confirmation flow.

Example multi-flow diagram.

Lifecycle of a page

Once a page becomes active, the agent follows several steps which may involve entry fulfillment, prefilling forms, state handler evaluation, form parameter prompting, sending response messages to the end-user, and either a page change or a repeat loop:

Page lifecycle diagram.

The details of this process are as follows:

  1. If entry fulfillment exists for the page, it is called. Any responses provided by fulfillment are added to the response queue.
  2. If the page has form parameters, they may be pre-filled:

    • Any set session parameter with the same name as a form parameter is copied to the form parameter.
    • If a route triggered a transition to this page, and the route contains a matched intent, any intent parameter with the same name as a form parameter is copied to the form parameter.
  3. If any state handlers are in scope, they are evaluated according to the handler evaluation order rules. This can involve routes, event handlers, or repromt handlers invoked from the prior loop iteration. If any state handler is called, one or both of the following may happen:

    • If fulfillment exists for the handler, it is called. Any responses provided by fulfillment are added to the response queue.
    • If a target flow or page exists for the handler, the session transitions to the target and the page becomes inactive.
  4. If all of the following are true, a form parameter prompt is added to the response queue:

    • The page has a form.
    • There are required form parameters left to fill.
    • A reprompt handler was not followed in step 3.
  5. The response queue messages are sent to the end-user, and the agent waits for end-user input.

  6. If end-user input provides a prompted form parameter, fill the parameter. Continue to step 3.

Create a page

To create a page:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Select a flow for the page in the Flows section.
  5. Click the add button in the Pages section.
  6. Enter a name for your page.
  7. Click the settings button next to the page name.
  8. Select Edit.
  9. Enter the fields in the page edit panel that appears.
  10. Click Save.

API

See the create method for the Page type.

Select a protocol and version for the Page reference:

Protocol V3beta1
REST Page resource
RPC Page interface
Java PagesClient
Node.js PagesClient
Python PagesClient

Page data

To access a page's data:

Console

  1. Open the Dialogflow CX Console.
  2. Choose the GCP project for the agent.
  3. Select your agent.
  4. Click the flow in the Flows section.
  5. The flow's pages are populated in the Pages section.
  6. Click the settings button next to the page name.
  7. Select Edit.
  8. Enter the fields in the page edit panel that appears.
  9. Click Save to save any changes.

API

See the get and patch/update methods for the Page type.

Select a protocol and version for the Page reference:

Protocol V3beta1
REST Page resource
RPC Page interface
Java PagesClient
Node.js PagesClient
Python PagesClient

The following data is associated with pages:

  • Name: A display name for your flow.
  • Entry Fulfillment (also known as Entry Dialogue): This is the fulfillment to call when the page initially becomes active.
  • Parameters: These are the parameter values in a page form that capture structured input from the end-user.
  • Routes: These state handlers may be called when the page is active. For details, see Page-level handler routes
  • Route groups: The routes within these groups may be called when the page is active. For details, see Route groups
  • Event handlers: These event handlers may be called when the page is active. For details, see Page-level event handlers

Delete a page

To delete a page:

Console

  1. Open the Dialogflow CX Console.
  2. Choose your GCP project.
  3. Select your agent.
  4. Select the flow for the page in the Flows section.
  5. Click the settings button next to the page name in the Pages section.
  6. Select Delete.

API

See the delete method for the Page type.

Select a protocol and version for the Page reference:

Protocol V3beta1
REST Page resource
RPC Page interface
Java PagesClient
Node.js PagesClient
Python PagesClient