Skip to content

googleDialogflowCxWebhook

Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.

To get more information about Webhook, see:

Example Usage - Dialogflowcx Webhook Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDialogflowCxAgentAgent =
  new google.dialogflowCxAgent.DialogflowCxAgent(this, "agent", {
    avatar_uri:
      "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
    default_language_code: "en",
    description: "Example description.",
    display_name: "dialogflowcx-agent",
    enable_spell_correction: true,
    enable_stackdriver_logging: true,
    location: "global",
    speech_to_text_settings: [
      {
        enable_speech_adaptation: true,
      },
    ],
    supported_language_codes: ["it", "de", "es"],
    time_zone: "America/New_York",
  });
new google.dialogflowCxWebhook.DialogflowCxWebhook(this, "basic_webhook", {
  display_name: "MyFlow",
  generic_web_service: [
    {
      uri: "https://example.com",
    },
  ],
  parent: googleDialogflowCxAgentAgent.id,
});

Argument Reference

The following arguments are supported:

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

  • timeout - (Optional) Webhook execution timeout.

  • disabled - (Optional) Indicates whether the webhook is disabled.

  • genericWebService - (Optional) Configuration for a generic web service. Structure is documented below.

  • serviceDirectory - (Optional) Configuration for a Service Directory service. Structure is documented below.

  • securitySettings - (Optional) Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/.

  • enableStackdriverLogging - (Optional) Determines whether this agent should log conversation queries.

  • enableSpellCorrection - (Optional) Indicates if automatic spell correction is enabled in detect intent requests.

  • parent - (Optional) The agent to create a webhook for. Format: projects//locations//agents/.

The genericWebService block supports:

  • uri - (Required) Whether to use speech adaptation for speech recognition.

  • requestHeaders - (Optional) The HTTP request headers to send together with webhook requests.

  • allowedCaCerts - (Optional) Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification.

The serviceDirectory block supports:

  • service - (Required) The name of Service Directory service.

  • genericWebService - (Required) The name of Service Directory service. Structure is documented below.

The genericWebService block supports:

  • uri - (Required) Whether to use speech adaptation for speech recognition.

  • requestHeaders - (Optional) The HTTP request headers to send together with webhook requests.

  • allowedCaCerts - (Optional) Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification.

Attributes Reference

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

  • id - an identifier for the resource with format {{parent}}/webhooks/{{name}}

  • name - The unique identifier of the webhook. Format: projects//locations//agents//webhooks/.

  • startFlow - Name of the start flow in this agent. A start flow will be automatically created when the agent is created, and can only be deleted by deleting the agent. Format: projects//locations//agents//flows/.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 40 minutes.
  • update - Default is 40 minutes.
  • delete - Default is 20 minutes.

Import

Webhook can be imported using any of these accepted formats:

$ terraform import google_dialogflow_cx_webhook.default {{parent}}/webhooks/{{name}}
$ terraform import google_dialogflow_cx_webhook.default {{parent}}/{{name}}