[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003ePre-GA products and features, including those mentioned here, are subject to the "Pre-GA Offerings Terms" and are available "as is" with potentially limited support.\u003c/p\u003e\n"],["\u003cp\u003ePlaybooks can utilize explicitly defined input and output parameters to store and exchange information, such as user selections and action results, between themselves and flows.\u003c/p\u003e\n"],["\u003cp\u003eInput parameters allow playbooks to receive and use values from flows or other playbooks, while output parameters enable playbooks to emit data for use elsewhere.\u003c/p\u003e\n"],["\u003cp\u003ePassing parameters between playbooks requires creating examples that demonstrate how the parameter values are used and passed, alongside optional instructions to guide parameter usage within the playbooks.\u003c/p\u003e\n"],["\u003cp\u003eWhen a flow transitions to a playbook, page and session parameters will only be passed to the playbook if it has an input parameter of the same name.\u003c/p\u003e\n"]]],[],null,["# Playbook parameters\n\nPlaybooks can accept and emit context information\nusing explicitly defined parameters.\nParameters are used to store information about a conversation like\nuser selections, results of actions, and so on.\nYou can pass the values of these parameters between\nplaybooks and\n[flows](/dialogflow/cx/docs/concept/flow).\n\nParameter declaration\n---------------------\n\nYou can define [input (read)parameters](#input)\nand [output (write) parameters](#output).\n\nParameters have a name, description,\nand one of the following types:\n\n- **String**\n- **Number**\n- **Boolean**\n- **Tool-specific parameter type**\n\nYou can also specify whether a parameter is a list.\n\nInput (read) parameters\n-----------------------\n\nFor each playbook,\nyou can define *input parameters* , also called *read parameters* ,\nthat allow playbooks to use values passed\nfrom flows and other playbooks.\nFor example, a playbook might receive a user's preferred name\nas a parameter and use it to thank the user personally,\nor it might receive an order identifier as a parameter\nand use it to retrieve order details using a\n[tool](/dialogflow/cx/docs/concept/playbook/tool).\n\nInput parameters are defined per-playbook, and playbooks don't have\nvisibility of\n[other Dialogflow CX console parameter types](/dialogflow/cx/docs/concept/parameter)\nby default.\nWhen a flow transitions to a playbook,\npage and session parameters are propagated to the playbook\nif the target playbook has an input parameter with the same name.\nTo communicate information from a flow to a playbook during a transition,\ndefine playbook input parameters with the same name as a session\nor page parameter present before the transition.\n| **Note:** The default playbook does not accept input parameters. The default playbook serves as an entrypoint for user conversations, so it has no way to receive input parameters.\n\nCreate examples to control how the input parameter value should impact actions.\nFor example, if an input parameter should affect how the agent refers\nto the user, create examples that define a value for the parameter and then use\nthe same value in utterance actions within the example. See\n[passing parameters](#passing-parameters) for details.\n\nOutput (write, return) parameters\n---------------------------------\n\nFor each playbook,\nyou can define *output parameters* , also called *write parameters*\nand *return parameters* ,\nthat allow playbooks to emit information\nto be used by other flows or playbooks.\nFor example, a playbook might collect an order number from\na user and emit it through an output parameter,\nor a playbook might use a\n[tool](/dialogflow/cx/docs/concept/playbook/tool)\nto book a flight and emit the confirmation number through an output parameter.\n\nCreate examples to control how the playbook should decide\nthe value for each output parameter.\nFor example, if an output parameter representing a confirmation\nnumber should derive its value from the output of a tool use,\ncreate examples where the output of the tool\nuse matches the value of the playbook output parameter.\n\nPassing parameters\n------------------\n\n| **Note:** A task playbook cannot call a routine playbook, so that parameter passing scenario is not described below.\n\nPlaybooks, unlike flows, **do not** support injecting parameter values\nwith a particular syntax.\nInstead, playbooks rely on instructions and\n[few-shot prompt examples](/vertex-ai/docs/generative-ai/learn/introduction-prompt-design#include-examples)\nto determine how parameter values should be used and how values should be\ndecided when specifying parameter values.\n\n### Routine playbook to flow\n\nTo pass parameters from a routine playbook to a flow:\n\n- Define write parameters for the routine playbook. These parameters will become session parameters.\n- Flows can make use of the session parameters.\n- Include parameter usage in instructions and examples.\n\n### Flow to routine playbook\n\nTo pass parameters from a flow to a routine playbook:\n\n- Flows write the session parameters.\n- Define read parameters for the routine playbook of the same names.\n- Include parameter usage in instructions and examples.\n\n### Task playbook to flow\n\nTo pass parameters from a task playbook to a flow:\n\n- In the flow settings, define *input parameters* of the same names.\n- Include parameter usage in instructions and examples.\n\n### Flow to task playbook\n\nTo pass parameters from a flow to a parent task playbook:\n\n- In the flow settings, define *return parameters*.\n- Include parameter usage in instructions and examples.\n\nTo pass parameters from a flow to a child task playbook:\n\n- Define task input parameters that share the same name as session parameters in the flow.\n- Include parameter usage in instructions and examples.\n\n### Routine playbook to task playbook\n\nTo pass parameters from a routine playbook to a task playbook:\n\n- Define input parameters for the task playbook of the same names.\n- Include parameter usage in instructions and examples.\n\n### Sample involving tools\n\nConsider an agent designed for event ticket sales with the following\ntask playbooks:\n\n1. A playbook named `Ticket ordering` which places orders using a tool named `Ticket sales API`.\n 1. This playbook accepts an input parameter with type `number` and name `event_id`.\n 2. The `Ticket sales API` tool expects a request including an `event_id`.\n2. A playbook named `Event selection` which helps users select an event and then routes them to `Ticket ordering` with parameter `event_id` to purchase tickets.\n\nIn this example, to ensure that `event_id` is reliably passed from\n`Event selection` to `Ticket ordering` and from `Ticket ordering` to\n`Ticket sales API`, several\n[examples](/dialogflow/cx/docs/concept/playbook/example)\nare needed.\n\nThe `Ticket ordering` playbook should include multiple examples which:\n\n- Have input parameter `event_id` specified with some realistic value, different in each example.\n- Include a tool use action with a request body that includes **the same** realistic `event_id` value as specified in the input parameter.\n\nThe `Event selection` playbook should include multiple examples which:\n\n- Include a user utterance where the user selects an event with some realistic `event_id`, different in each example.\n- Include a playbook invocation of `Ticket ordering` which sets the `event_id` parameter to **the same** realistic `event_id` as decided by the user's selection.\n\nIn addition to adding examples, try adding specific instructions to the\n[instructions](/dialogflow/cx/docs/concept/playbook/instruction),\n[goal](/dialogflow/cx/docs/concept/playbook/goal), or\n[tool details](/dialogflow/cx/docs/concept/playbook/tool)\nexplaining how parameters should be used. For example,\nplaybook `Ticket ordering` includes the following instruction: \n\n - Use parameter event_id to send a buy_tickets request with ${TOOL: Ticket sales API}\n\nWith the described examples and instructions present, the `Event selection`\nplaybook correctly decides an `event_id` based on the user's selection, and\npasses it as an input parameter named `event_id` to the\n`Ticket ordering playbook`. Then, `Ticket ordering` passes the same `event_id`\nin the body of a request to the `Ticket sales API`. Playbooks depend on examples\nwith distinct parameter values to help them infer how parameters should be used."]]