Some products and features are in the process of being renamed. Generative playbook and flow features are also being migrated to a single consolidated console. See the details.
Stay organized with collections
Save and categorize content based on your preferences.
By default,
playbooks use LLMs to control the conversation,
take actions, and respond to end-users.
If you need more explicit control over the agent's behavior,
you can use
flows
or conditional actions, which are described in this guide.
Conditional actions are an optional configuration for playbooks.
You can set conversation triggers and conditions that invoke specific actions
like responding with a specific message,
calling an external tool,
invoking another playbook,
or performing any other specified action.
Triggers
You can define triggers that are the first step
in determining whether a conditional action is applicable.
The following describes trigger types
and the specific triggers for each type:
Lifecycle stage
Playbook start:
Triggered the first time a playbook is started.
Before the LLM decides its next action:
Triggered every time before the LLM predicts the next action.
Before the LLM executes its next action:
Triggered every time before the LLM executes an action.
Event
Custom event
No input from user
Conditions
Once a trigger occurs,
the second step is to evaluate any optionally supplied conditions.
Conditions are supplied using the same
condition syntax
used by flow routes.
If no conditions are supplied,
the trigger alone will be used to initiate actions.
You can use the following syntax to reference parameters
and last/next actions:
$last-action.name = "query_order" AND $last-action.status != SUCCESS
$last-action.name = "query_order" AND $last-action.output.orders = null
Actions
Once a trigger and optional condition evaluation have occurred,
you can configure the following actions to take place:
Provide a response to the end-user:
text, conditional response, custom payload, and
pre-recorded audio.
When supplying text, you can insert [pause], [pauseShort],
or [pause long] to inject pauses in agent speech.
Sample: How can I help you today? [pause long] I can help with....
Override the next LLM action:
tool use, playbook invocation, playbook completion, flow invocation,
playbook transition, flow transition.
Change speech settings:
model name, no speech timeout, endpointer sensitivity, adaptation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis page explains conditional actions, an optional feature for playbooks that allows for more control over agent behavior beyond default LLM-driven interactions.\u003c/p\u003e\n"],["\u003cp\u003eConditional actions are activated by triggers, such as lifecycle stages (like playbook start or before an LLM action) or events (like custom events or no user input).\u003c/p\u003e\n"],["\u003cp\u003eAfter a trigger, optional conditions can be evaluated using a specific syntax to determine if an action should be initiated, similar to how flow routes operate, with no conditions causing the trigger to initiate actions.\u003c/p\u003e\n"],["\u003cp\u003eConditions can reference session parameters, playbook input parameters, and details about the last or next action, including their name, input, output, and status.\u003c/p\u003e\n"],["\u003cp\u003eUpon trigger and condition evaluation, a variety of actions can be configured, including responding to the user, overriding LLM actions, modifying speech settings, and enabling features like barge-in or DTMF.\u003c/p\u003e\n"]]],[],null,["# Conditional actions\n\nBy default,\nplaybooks use LLMs to control the conversation,\ntake actions, and respond to end-users.\nIf you need more explicit control over the agent's behavior,\nyou can use\n[flows](/dialogflow/cx/docs/concept/flow)\nor *conditional actions*, which are described in this guide.\n\nConditional actions are an optional configuration for playbooks.\nYou can set conversation triggers and conditions that invoke specific actions\nlike responding with a specific message,\ncalling an external tool,\ninvoking another playbook,\nor performing any other specified action.\n\nTriggers\n--------\n\nYou can define triggers that are the first step\nin determining whether a conditional action is applicable.\nThe following describes trigger types\nand the specific triggers for each type:\n\n- **Lifecycle stage**\n - **Playbook start**: Triggered the first time a playbook is started.\n - **Before the LLM decides its next action**: Triggered every time before the LLM predicts the next action.\n - **Before the LLM executes its next action**: Triggered every time before the LLM executes an action.\n- **Event**\n - **Custom event**\n - **No input from user**\n\nConditions\n----------\n\nOnce a trigger occurs,\nthe second step is to evaluate any optionally supplied conditions.\nConditions are supplied using the same\n[condition syntax](/dialogflow/cx/docs/reference/condition)\nused by flow routes.\n\nIf no conditions are supplied,\nthe trigger alone will be used to initiate actions.\n\nYou can use the following syntax to reference parameters\nand last/next actions:\n\n- Session parameters\n - `$session.params.PARAMETER_NAME`\n- Playbook input parameters\n - `$playbook.input.INPUT_FIELD_NAME`\n- Last action (previously executed action)\n - `$last-action.name`\n - `$last-action.input.INPUT_FIELD_NAME`\n - `$last-action.output.OUTPUT_FIELD_NAME`\n - `$last-action.status`\n- Next action (LLM predicted next action)\n - `$next-action.name`\n - `$next-action.input.INPUT_FIELD_NAME`\n\nYou can also use\n[system functions](/dialogflow/cx/docs/reference/system-functions).\n\nExamples:\n\n- `$session.params.current_user = null`\n- `$last-action.name = \"query_order\"`\n- `$last-action.name = \"query_order\" AND $last-action.status != SUCCESS`\n- `$last-action.name = \"query_order\" AND $last-action.output.orders = null`\n\nActions\n-------\n\nOnce a trigger and optional condition evaluation have occurred,\nyou can configure the following actions to take place:\n\n- **Provide a response to the end-user** : text, conditional response, custom payload, and [pre-recorded audio](#pre-recorded-audio). When supplying text, you can insert `[pause]`, `[pauseShort]`, or `[pause long]` to inject pauses in agent speech. Sample: `How can I help you today? [pause long] I can help with...`.\n- **Override the next LLM action**: tool use, playbook invocation, playbook completion, flow invocation, playbook transition, flow transition.\n- **Change speech settings**: model name, no speech timeout, endpointer sensitivity, adaptation.\n- **Enable barge-in**\n- **Allow cancellation of partial response playback**\n- **Send Call Companion SMS**\n- **Enable DTMF** : see [DTMF for telephony integrations](/dialogflow/cx/docs/concept/dtmf)"]]