Fulfillments

For an agent's conversational turn, the agent must respond to the end-user with an answer to a question, a query for information, or session termination. Your agent may also need to contact your service to generate dynamic responses or take actions for a turn. Fulfillment is used to accomplish all of this.

A fulfillment may contain any of the following:

  • Static response messages.
  • Webhook calls for dynamic responses and/or to take actions.
  • Parameter presets to set or override parameter values.

During an agent's turn, it is possible (and sometimes desirable) to call multiple fulfillments, each of which may generate a response message. Dialogflow maintains these responses in a response queue. Once the agent's turn is over, Dialogflow sends the ordered responses to the end-user.

ES fulfillment is limited to connecting a webhook service. The scope of fulfillment has been increased for CX, so it now covers all types of prompts and responses.

Fulfillment use cases

Fulfillment is used everywhere that a response message is needed:

For each of these use cases, the console will open a fulfillment editing panel.

Fulfillment screenshot

Static response messages (dialogue options)

Static response messages are agent responses that you define at design-time. You define them when creating fulfillment. At runtime, these responses are added to the response queue.

There are several types of response messages, which are described in subsections below. When using the console, a fulfillment panel has an initial text response message card, but you can click Add dialogue option to add more cards for other response message types.

Text

Text response messages send text dialog to the end-user. If your detect intent API calls or integration calls use speech synthesis, this text will be used to generate audio content. In this case, supplied text can optionally use the Speech Synthesis Markup Language (SSML).

You can define multiple text response cards, and multiple text responses within each card. If you define multiple cards, they are concatenated for a single response at runtime. If you define multiple responses within a card, one of the messages in the card is chosen at random at runtime.

These text messages can contain parameter references.

Custom payload

Some integrations support a custom payload response to handle rich responses. These custom payloads are supplied in a JSON format defined in the integration's documentation. For example, see the Dialogflow Messenger custom payload format.

You can also send a custom payload to integrations that you develop. It won't be processed by Dialogflow, so you need to handle it in your own business logic.

Live agent handoff

This response signals to the detect intent API caller that the conversation should be handed off to a human agent. Dialogflow only uses this signal to identify conversations that are handed off for measurement purposes, and it does not alter the session state in any way. Your system or integration can use this signal to take whatever actions are necessary to hand off the conversation. Dialogflow doesn't impose any structure on this data, so you can choose any structure that suits your system.

Conversation success metadata

This response signals to the detect intent API caller that the conversation with the Dialogflow agent succeeded. Dialogflow only uses this signal to identify conversations that succeeded for measurement purposes, and it does not alter the session state in any way. Your system or integration can use this signal to take whatever actions are necessary. Dialogflow doesn't impose any structure on this data, so you can choose any structure that suits your system.

Play pre-recorded audio

This response plays an audio file for integrations that support this feature. You must supply a publicly available URL to an audio file. For example, you can host a public file with Cloud Storage.

Conditional response

This response type is used for conditional responses. The general format is:

if [condition]
  [response]
elif [condition]
  [response]
elif [condition]
  [response]
else
  [response]
endif

where:

  • [condition] is the same format that is used for route conditions
  • [response] is a text response
  • elif and else blocks are optional

For example:

if $session.params.user-age >= 21
  Ok, you may enter.
else
  Sorry, you cannot enter.
endif

Webhook calls

When a fulfillment is called, and the fulfillment has a webhook, the agent sends a request to your webhook. Your webhook can take any actions necessary within your service, provide a dynamic response message, override parameter values, and change the current page.

Parameter presets

You can use a fulfillment to provide presets that set or override current parameter values. These presets will be applied before resolving static response messages or calling a webhook.

Response queue

During an agent's turn, it is possible (and sometimes desirable) to call multiple fulfillments, each of which may generate a response message. Dialogflow maintains these responses in a response queue. Once the agent's turn is over, Dialogflow sends the ordered responses to the end-user.