Google Dialogflow CX Page

This page shows how to write Terraform for Dialogflow CX Page and write them securely.

google_dialogflow_cx_page (Terraform)

The Page in Dialogflow CX can be configured in Terraform with the resource name google_dialogflow_cx_page. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • display_name - (Required) The human-readable name of the page, unique within the agent.

  • entry_fulfillment - (Optional) The fulfillment to call when the session is entering the page. Structure is documented below.

  • form - (Optional) The form associated with the page, used for collecting parameters relevant to the page. Structure is documented below.

  • transition_route_groups - (Optional) Ordered list of TransitionRouteGroups associated with the page. Transition route groups must be unique within a page. If multiple transition routes within a page scope refer to the same intent, then the precedence order is: page's transition route -> page's transition route group -> flow's transition routes. If multiple transition route groups within a page contain the same intent, then the first group in the ordered list takes precedence. Format:projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>.

  • transition_routes - (Optional) A list of transitions for the transition rules of this page. They route the conversation to another page in the same flow, or another flow. When we are in a certain page, the TransitionRoutes are evalauted in the following order: TransitionRoutes defined in the page with intent specified. TransitionRoutes defined in the transition route groups with intent specified. TransitionRoutes defined in flow with intent specified. TransitionRoutes defined in the transition route groups with intent specified. TransitionRoutes defined in the page with only condition specified. TransitionRoutes defined in the transition route groups with only condition specified. Structure is documented below.

  • event_handlers - (Optional) Handlers associated with the page to handle events such as webhook errors, no match or no input. Structure is documented below.

  • parent - (Optional) The flow to create a page for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

  • language_code - (Optional) The language of the following fields in page: Page.entry_fulfillment.messages Page.entry_fulfillment.conditional_cases Page.event_handlers.trigger_fulfillment.messages Page.event_handlers.trigger_fulfillment.conditional_cases Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases Page.form.parameters.fill_behavior.reprompt_event_handlers.messages Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases Page.transition_routes.trigger_fulfillment.messages Page.transition_routes.trigger_fulfillment.conditional_cases If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used.

The entry_fulfillment block supports:

  • messages - (Optional) The list of rich message responses to present to the user. Structure is documented below.

  • webhook - (Optional) The webhook to call. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.

  • return_partial_responses - (Optional) Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks.

  • tag - (Optional) The tag used by the webhook to identify which fulfillment is being called. This field is required if webhook is specified.

The messages block supports:

The text block supports:

  • text - (Optional) A collection of text responses.

  • allow_playback_interruption - Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

The form block supports:

  • parameters - (Optional) Parameters to collect from the user. Structure is documented below.

The parameters block supports:

  • display_name - (Optional) The human-readable name of the parameter, unique within the form.

  • required - (Optional) Indicates whether the parameter is required. Optional parameters will not trigger prompts; however, they are filled if the user specifies them. Required parameters must be filled before form filling concludes.

  • entity_type - (Optional) The entity type of the parameter. Format: projects/-/locations/-/agents/-/entityTypes/<System Entity Type ID> for system entity types (for example, projects/-/locations/-/agents/-/entityTypes/sys.date), or projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type ID> for developer entity types.

  • is_list - (Optional) Indicates whether the parameter represents a list of values.

  • fill_behavior - (Optional) Defines fill behavior for the parameter. Structure is documented below.

  • redact - (Optional) Indicates whether the parameter content should be redacted in log. If redaction is enabled, the parameter content will be replaced by parameter name during logging. Note: the parameter content is subject to redaction if either parameter level redaction or entity type level redaction is enabled.

The fill_behavior block supports:

  • initial_prompt_fulfillment - (Optional) The fulfillment to provide the initial prompt that the agent can present to the user in order to fill the parameter. Structure is documented below.

The initial_prompt_fulfillment block supports:

  • messages - (Optional) The list of rich message responses to present to the user. Structure is documented below.

  • webhook - (Optional) The webhook to call. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.

  • return_partial_responses - (Optional) Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks.

  • tag - (Optional) The tag used by the webhook to identify which fulfillment is being called. This field is required if webhook is specified.

The messages block supports:

The text block supports:

  • text - (Optional) A collection of text responses.

  • allow_playback_interruption - Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

The transition_routes block supports:

  • name - The unique identifier of this transition route.

  • intent - (Optional) The unique identifier of an Intent. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>. Indicates that the transition can only happen when the given intent is matched. At least one of intent or condition must be specified. When both intent and condition are specified, the transition can only happen when both are fulfilled.

  • condition - (Optional) The condition to evaluate against form parameters or session parameters. At least one of intent or condition must be specified. When both intent and condition are specified, the transition can only happen when both are fulfilled.

  • trigger_fulfillment - (Optional) The fulfillment to call when the event occurs. Handling webhook errors with a fulfillment enabled with webhook could cause infinite loop. It is invalid to specify such fulfillment for a handler handling webhooks. Structure is documented below.

  • target_page - (Optional) The target page to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

  • target_flow - (Optional) The target flow to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

The trigger_fulfillment block supports:

  • messages - (Optional) The list of rich message responses to present to the user. Structure is documented below.

  • webhook - (Optional) The webhook to call. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.

  • return_partial_responses - (Optional) Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks.

  • tag - (Optional) The tag used by the webhook to identify which fulfillment is being called. This field is required if webhook is specified.

The messages block supports:

The text block supports:

  • text - (Optional) A collection of text responses.

  • allow_playback_interruption - Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

The event_handlers block supports:

  • name - The unique identifier of this event handler.

  • event - (Optional) The name of the event to handle.

  • trigger_fulfillment - (Optional) The fulfillment to call when the event occurs. Handling webhook errors with a fulfillment enabled with webhook could cause infinite loop. It is invalid to specify such fulfillment for a handler handling webhooks. Structure is documented below.

  • target_page - (Optional) The target page to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

  • target_flow - (Optional) The target flow to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

The trigger_fulfillment block supports:

  • messages - (Optional) The list of rich message responses to present to the user. Structure is documented below.

  • webhook - (Optional) The webhook to call. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.

  • return_partial_responses - (Optional) Whether Dialogflow should return currently queued fulfillment response messages in streaming APIs. If a webhook is specified, it happens before Dialogflow invokes webhook. Warning: 1) This flag only affects streaming API. Responses are still queued and returned once in non-streaming API. 2) The flag can be enabled in any fulfillment but only the first 3 partial responses will be returned. You may only want to apply it to fulfillments that have slow webhooks.

  • tag - (Optional) The tag used by the webhook to identify which fulfillment is being called. This field is required if webhook is specified.

The messages block supports:

The text block supports:

  • text - (Optional) A collection of text responses.

  • allow_playback_interruption - Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format [[parent]]/pages/[[name]]

  • name - The unique identifier of the page. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

Explanation in Terraform Registry

A Dialogflow CX conversation (session) can be described and visualized as a state machine. The states of a CX session are represented by pages. To get more information about Page, see:

Frequently asked questions

What is Google Dialogflow CX Page?

Google Dialogflow CX Page is a resource for Dialogflow CX of Google Cloud Platform. Settings can be wrote in Terraform.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.