By default, your agent responds to a matched intent with a static response. If you're using one of the integration options, you can provide a more dynamic response by using fulfillment. When you enable fulfillment for an intent, Dialogflow responds to that intent by calling a service that you define. For example, if an end-user wants to schedule a haircut on Friday, your service can check your database and respond to the end-user with availability information for Friday.
Each intent has a setting to enable fulfillment. If an intent requires some action by your system or a dynamic response, you should enable fulfillment for the intent. If an intent without fulfillment enabled is matched, Dialogflow uses the static response you defined for the intent.
When an intent with fulfillment enabled is matched, Dialogflow sends a request to your webhook service with information about the matched intent. Your system can perform any required actions and respond to Dialogflow with information for how to proceed. When fulfillment is enabled, the static response you defined for the intent is only used if your webhook service fails. The following diagram shows the processing flow for fulfillment.
- The end-user types or speaks an expression.
- Dialogflow matches the end-user expression to an intent and extracts parameters.
- Dialogflow sends a webhook request message to your webhook service. This message contains information about the matched intent, the action, the parameters, and the response defined for the intent.
- Your service performs actions as needed, like database queries or external API calls.
- Your service sends a webhook response message to Dialogflow. This message contains the response that should be sent to the end-user.
- Dialogflow sends the response to the end-user.
- The end-user sees or hears the response.