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. Seethe details.
An event handler specifies aneventthat can be handled during a session. When the specified event happens, the following actions are taken in order:
If there is atriggerFulfillmentassociated with the event, it will be called.
If there is atargetPageassociated with the event, the session will transition into the specified page.
If there is atargetFlowassociated with the event, the session will transition into the specified flow.
JSON representation
{"name":string,"event":string,"triggerFulfillment":{object (Fulfillment)},// Union fieldtargetcan be only one of the following:"targetPage":string,"targetFlow":string,"targetPlaybook":string// End of list of possible types for union fieldtarget.}
Fields
name
string
Output only. The unique identifier of this event handler.
The fulfillment to call when the event occurs. Handling webhook errors with a fulfillment enabled with webhook could cause infinite loop. It is invalid to specify such fulfillment for a handler handling webhooks.
Union fieldtarget. The target to transition to, either a page in the same host flow (the flow that owns thisTransitionRoute), or another flow in the same agent.targetcan be only one of the following:
targetPage
string
The target page to transition to. Format:projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>.
targetFlow
string
The target flow to transition to. Format:projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>.
targetPlaybook
string
The target playbook to transition to. Format:projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>.
[[["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-06-27 UTC."],[[["\u003cp\u003eEvent handlers define events that can be managed during a session, initiating actions when the specified event occurs.\u003c/p\u003e\n"],["\u003cp\u003eUpon an event, the system first executes the \u003ccode\u003etriggerFulfillment\u003c/code\u003e, if present, and then transitions to either the \u003ccode\u003etargetPage\u003c/code\u003e, \u003ccode\u003etargetFlow\u003c/code\u003e, or \u003ccode\u003etargetPlaybook\u003c/code\u003e as defined.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etriggerFulfillment\u003c/code\u003e field specifies the fulfillment that gets executed when an event is triggered, but using it with a webhook handler is not recommended due to potential infinite loops.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etarget\u003c/code\u003e field is a union that indicates whether to transition to another page, flow, or playbook, with only one of \u003ccode\u003etargetPage\u003c/code\u003e, \u003ccode\u003etargetFlow\u003c/code\u003e, or \u003ccode\u003etargetPlaybook\u003c/code\u003e being applicable per handler.\u003c/p\u003e\n"],["\u003cp\u003eThe JSON representation details the structure of an event handler, which includes fields for the event \u003ccode\u003ename\u003c/code\u003e, the \u003ccode\u003eevent\u003c/code\u003e to handle, and the \u003ccode\u003etarget\u003c/code\u003e to transition to, as well as an optional \u003ccode\u003etriggerFulfillment\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# EventHandler\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nAn event handler specifies an [event](/dialogflow/cx/docs/reference/rest/v3beta1/EventHandler#FIELDS.event) that can be handled during a session. When the specified event happens, the following actions are taken in order:\n\n- If there is a [`triggerFulfillment`](/dialogflow/cx/docs/reference/rest/v3beta1/EventHandler#FIELDS.trigger_fulfillment) associated with the event, it will be called.\n- If there is a [`targetPage`](/dialogflow/cx/docs/reference/rest/v3beta1/EventHandler#FIELDS.target_page) associated with the event, the session will transition into the specified page.\n- If there is a [`targetFlow`](/dialogflow/cx/docs/reference/rest/v3beta1/EventHandler#FIELDS.target_flow) associated with the event, the session will transition into the specified flow."]]