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:
resource "google_dialogflow_cx_agent" "agent" {
display_name = "dialogflowcx-agent"
location = "global"
default_language_code = "en"
supported_language_codes = ["it","de","es"]
time_zone = "America/New_York"
description = "Example description."
avatar_uri = "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png"
enable_stackdriver_logging = true
enable_spell_correction = true
speech_to_text_settings {
enable_speech_adaptation = true
}
}
resource "google_dialogflow_cx_webhook" "basic_webhook" {
parent = google_dialogflow_cx_agent.agent.id
display_name = "MyFlow"
generic_web_service {
uri = "https://example.com"
}
}
The following arguments are supported:
display_name
-
(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.
generic_web_service
-
(Optional)
Configuration for a generic web service.
Structure is documented below.
service_directory
-
(Optional)
Configuration for a Service Directory service.
Structure is documented below.
security_settings
-
(Optional)
Name of the SecuritySettings reference for the agent. Format: projects/
enable_stackdriver_logging
-
(Optional)
Determines whether this agent should log conversation queries.
enable_spell_correction
-
(Optional)
Indicates if automatic spell correction is enabled in detect intent requests.
parent
-
(Optional)
The agent to create a webhook for.
Format: projects/
The generic_web_service
block supports:
uri
-
(Required)
Whether to use speech adaptation for speech recognition.
request_headers
-
(Optional)
The HTTP request headers to send together with webhook requests.
allowed_ca_certs
-
(Optional)
Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification.
The service_directory
block supports:
service
-
(Required)
The name of Service Directory service.
generic_web_service
-
(Required)
The name of Service Directory service.
Structure is documented below.
The generic_web_service
block supports:
uri
-
(Required)
Whether to use speech adaptation for speech recognition.
request_headers
-
(Optional)
The HTTP request headers to send together with webhook requests.
allowed_ca_certs
-
(Optional)
Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification.
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/
start_flow
-
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/
This resource provides the following Timeouts configuration options:
create
- Default is 40 minutes.update
- Default is 40 minutes.delete
- Default is 20 minutes.Webhook can be imported using any of these accepted formats:
{{parent}}/webhooks/{{name}}
{{parent}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Webhook using one of the formats above. For example:
import {
id = "{{parent}}/webhooks/{{name}}"
to = google_dialogflow_cx_webhook.default
}
When using the terraform import
command, Webhook can be imported using one of the formats above. For example:
$ terraform import google_dialogflow_cx_webhook.default {{parent}}/webhooks/{{name}}
$ terraform import google_dialogflow_cx_webhook.default {{parent}}/{{name}}