When you add a new Hook, it defines a function that executes every time your bot reaches a certain cycle of its operation.All Hooks take an event parameter, which contains information about the event that triggered the Hook.
Some Hook types take additional parameters—check out the Hook guides on this page for more information.
Depending on how demanding the task is, the LLMz may loop through multiple iterations before finishing its execution. This Hook type executes its code after each iteration.Parameters:
This Hook type executes after a full turn has completed—meaning the bot has received user input, processed it, and responded.You can use a Hook of this type to track AI spend and token cost for your bot.Parameters:
{"docsConfig":{"theme":"almond","$schema":"https://mintlify.com/docs.json","name":"Botpress","colors":{"primary":"#0090FF","light":"#3B9EFF","dark":"#0588F0"},"logo":{"light":"https://mintcdn.com/botpress/U-4GnVaxESbJOVgP/logo/light.svg?fit=max\u0026auto=format\u0026n=U-4GnVaxESbJOVgP\u0026q=85\u0026s=df22258e2155256a01174f5316ebc024","dark":"https://mintcdn.com/botpress/U-4GnVaxESbJOVgP/logo/dark.svg?fit=max\u0026auto=format\u0026n=U-4GnVaxESbJOVgP\u0026q=85\u0026s=c7418cf9e02f06a53c7539fada0c96d4","href":"https://botpress.com/docs"},"favicon":"https://mintcdn.com/botpress/lKQBqQA1hrY6ODf5/favicon.svg?fit=max\u0026auto=format\u0026n=lKQBqQA1hrY6ODf5\u0026q=85\u0026s=0867a83e88e8476b31ba5dd72cb37583","background":{"color":{"light":"#fcfcfc","dark":"#1a1a1a"}},"navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://app.botpress.cloud"}},"footer":{"socials":{"x":"https://x.com/getbotpress","github":"https://github.com/botpress","linkedin":"https://www.linkedin.com/company/botpress","youtube":"https://www.youtube.com/botpress","discord":"https://discord.com/invite/botpress"}},"seo":{"metatags":{"og:logo":"/meta-assets/meta-logo.png"}},"fonts":{"heading":{"family":"Aspekta, sans-serif","weight":600,"source":"https://aspekta-cdn.vercel.app/fonts/AspektaVF.woff2","format":"woff2"}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"light-plus","dark":"dark-plus"}},"latex":false},"integrations":{"mixpanel":{"projectToken":"1195923e954ce61d822842b5832047cd"}},"contextual":{"options":[{"title":"Ask AI","description":"Ask AI a question about this page","icon":"/icon.png","href":"#ask"},"copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"navigation":{"global":{"anchors":[{"anchor":"Community Discord","icon":"discord","href":"https://discord.com/invite/botpress"},{"anchor":"News \u0026 Resources","icon":"newspaper","href":"https://botpress.com/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"botpress","hasAudioNarration":false,"actualSubdomain":"botpress","customDomains":["botpress.com"],"gitSource":{"type":"github","owner":"botpress","repo":"docs","deployBranch":"master","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a676aaf2a513e6ab67f02b1","collectionId":"cf06ac30-b1bf-43e8-be9b-f18d8676b5e9","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a676aaf2a513e6ab67f02b1"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"}},"buildId":"6ae9260993c0d64dfeafb71b:success","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Docs","count":192},{"language":"default","tag":"API Reference","count":132},{"language":"default","tag":"Endpoints","count":117},{"language":"default","tag":"Studio","count":80},{"language":"default","tag":"Integrations","count":79},{"language":"default","tag":"Guides","count":75},{"language":"default","tag":"Concepts","count":57},{"language":"default","tag":"Admin API","count":40},{"language":"default","tag":"Runtime API","count":36},{"language":"default","tag":"ADK","count":32}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"[data-page-mode=\"frame\"] footer,[data-page-mode=\"frame\"] [data-component=\"footer\"]{display:flex!important}.transparent-accordion .bg-background-light{background-color:transparent!important}.callout[data-callout-type=\"info\"]{background-color:light-dark(rgba(253, 244, 255, 0.5), rgba(217, 70, 239, 0.1));border-color:light-dark(rgba(217, 70, 239, 0.2), rgba(168, 85, 247, 0.3))}.callout[data-callout-type=\"info\"] [data-component-part=\"callout-icon\"] svg{color:light-dark(rgba(192, 38, 211), rgba(232, 121, 249, 0.8))}.callout[data-callout-type=\"info\"] [data-component-part=\"callout-content\"]{color:light-dark(rgba(112, 26, 117), rgba(245, 208, 254))}.steps{margin-top:0}.bpFab{box-shadow:none!important}.tracking-tight{letter-spacing:normal!important}.high-contrast{color:light-dark(black, white)!important}.button{background-color:#0588f0;color:white;text-align:center;border:1px solid #0588f0;font-weight:500;padding:0.5rem 1rem;font-size:0.9rem;line-height:130%;text-decoration:none;transition:all 0.2s;position:relative}.button:hover{opacity:0.9}.discord_banner{text-align:center;background-color:light-dark(#fcfcfc, #1a1a1a);border:1px solid #626762;padding:0.5rem 1rem;font-size:0.9rem;line-height:130%;text-decoration:none;transition:all 0.2s;position:relative}#test{margin:0}@media (min-width: 768px){.home-columns{flex:1 1 0%;max-width:33.333%}.lower-columns{flex:1 1 0%;max-width:50%}}[data-nav-tag=\"Beta\"]{background-color:light-dark(#e3eafd, #07296a)!important;color:light-dark(#133a9a, #7196f4)!important}[data-nav-tag=\"Plus\"]{background-color:light-dark(#e3eafd, #07296a)!important;color:light-dark(#133a9a, #7196f4)!important}[data-nav-tag=\"Team\"]{background-color:light-dark(#d1fae4, #0f4c2c)!important;color:light-dark(#166e3f, #6ae1a1)!important}@media (min-width: 768px){.bpWebchat{min-width:450px;width:29.7vw!important;max-height:83.2vh!important}}#ai-bolt{height:0.9em!important;width:auto!important;aspect-ratio:auto!important;pointer-events:none}.max-w-xl{max-width:40em}img{background-color:inherit!important}[data-component-part=\"card-content\"]{font-size:0.875rem}.bot-toggle-container{position:fixed;top:3.55rem;right:-16px;bottom:0;width:32px;height:auto;background-color:transparent;z-index:30;pointer-events:auto;display:flex;align-items:center;justify-content:center;cursor:pointer}.bot-panel-expanded .bot-toggle-container{display:none}#bot-toggle{position:fixed;top:3.55rem;right:0;bottom:0;width:40px;height:auto;background-color:light-dark(#f7f7f8, #09090b);border-left:1px solid light-dark(rgb(226, 222, 230), rgb(255 255 255/0.07));border-right:none;color:light-dark(#1a1a1a, #fcfcfc);cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:30;padding:0}#bot-toggle:hover{background-color:light-dark(#f0f0f0, #2a2a2a)}#bot-toggle.bot-toggle-expanded{display:none}#bot-toggle svg{width:16px;height:16px}.bot-panel{position:fixed;top:3.55rem;right:0;bottom:0;width:400px;height:auto;background-color:light-dark(#f7f7f8, #09090b);z-index:29;display:flex;flex-direction:row;transform:translateX(100%);resize:none;overflow:visible;transition:transform 0.15s cubic-bezier(0.4, 0, 0.2, 1)}.bot-panel-expanded{transform:translateX(0)}.bot-panel-collapsed{transform:translateX(100%)}.bot-iframe-container{flex:1;height:100%;position:relative;overflow:hidden;pointer-events:auto;min-width:0;border-left:1px solid light-dark(rgb(226, 222, 230), rgb(255 255 255/0.07))}.bot-iframe{width:100%;height:100%;border:none;display:block}.bot-mobile-dismiss{display:none;position:absolute;top:0;left:0;right:0;height:40px;background-color:transparent;z-index:33;align-items:center;justify-content:center;cursor:grab;pointer-events:auto;touch-action:none}.bot-mobile-dismiss:active{cursor:grabbing}.bot-mobile-dismiss svg{width:36px;height:20px;color:light-dark(rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.4))}@media (max-width: 1024px){#bot-toggle{display:none!important}.bot-mobile-dismiss{display:flex}.bot-panel{width:100%;max-width:100vw;min-width:100vw;resize:none;top:0;left:0;right:0;height:100dvh;z-index:31;padding:0;margin:0;transform:translateY(100%);transition:transform 0.15s cubic-bezier(0.32, 0.72, 0, 1);border-top:1px solid light-dark(rgb(226, 222, 230), rgb(255 255 255/0.07))}.bot-panel-expanded{transform:translateY(0)}.bot-panel-collapsed{transform:translateY(100%)}.bot-panel-expanded.swiping{transition:none}.bot-panel-expanded .bot-iframe-container{padding:0;margin:0;border:none}.bot-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);z-index:30;opacity:0;pointer-events:none;transition:opacity 0.3s ease}.bot-overlay.visible{opacity:1;pointer-events:auto}}.ask-ai-input-bubble{position:fixed;bottom:30px;left:50%;transform:translateX(-50%) translateY(0);z-index:30;width:480px;max-width:480px;pointer-events:none;transition:opacity 150ms ease,\n transform 150ms ease;opacity:1}.ask-ai-input-wrapper{display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 24px;border:1px solid light-dark(rgb(var(--gray-950) / 0.2), rgb(255 255 255/0.2));border-radius:16px;background-color:light-dark(rgba(252, 252, 252, 0.8), rgba(26, 26, 26, 0.8));backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);box-shadow:0 25px 50px -12px rgba(0, 0, 0, 0.05);pointer-events:auto;transition:border-color 400ms,\n opacity 150ms ease;width:100%}.ask-ai-input-bubble:focus-within .ask-ai-input-wrapper{border-color:#0588f0}.ask-ai-input{flex:1;padding:16px 0;border:none;background:transparent;color:light-dark(rgb(var(--gray-600)), rgb(var(--gray-400)));font-size:0.875rem;font-family:inherit;outline:none;outline-width:0;min-width:0}.ask-ai-input::placeholder{color:light-dark(rgb(var(--gray-600)), var(--gray-400))}.ask-ai-shortcut{font-size:0.75rem;font-weight:600;user-select:none;pointer-events:none;margin:0 8px;color:light-dark(rgb(var(--gray-600)), rgb(var(--gray-400)));display:none}@media (min-width: 1024px){.ask-ai-shortcut{display:inline}}.ask-ai-send-button{display:flex;justify-content:center;align-items:center;padding:6px;width:32px;height:32px;border-radius:50%;border:none;background-color:light-dark(rgba(5, 136, 240, 0.3), rgba(5, 136, 240, 0.3));color:white;cursor:pointer;transition:background-color 0.2s ease,\n opacity 0.2s ease;flex-shrink:0}.ask-ai-send-button svg{width:22px;height:22px}.ask-ai-send-button:not(:disabled){background-color:#0588f0}.ask-ai-send-button:disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.ask-ai-input-bubble-hidden{opacity:0;pointer-events:none;transform:translateX(-50%) translateY(10px)}@media (max-width: 1024px){.ask-ai-input-bubble{bottom:16px;left:50%;transform:translateX(-50%) translateY(0);width:calc(100% - 64px);max-width:320px}.ask-ai-input-bubble-hidden{transform:translateX(-50%) translateY(10px)}.ask-ai-input-wrapper{padding:0 12px 0 16px}.ask-ai-input{padding:12px 0;pointer-events:none;cursor:pointer}.ask-ai-input-wrapper{cursor:pointer}.ask-ai-send-button{display:none}.ask-ai-shortcut{display:none}}"}],"page":{"pagePath":"studio/concepts/hooks","slug":"/studio/concepts/hooks","pageMetadata":{"title":"Hooks","icon":"anchor","description":null,"href":"/studio/concepts/hooks"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,Icon,Note,ResponseField,Tip,Warning}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Icon)_missingMdxReference(`Icon`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Hooks `,_jsx(_components.strong,{children:`execute custom JavaScript code`}),` at specific cycles of your bot’s operation. For example:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#before-outgoing`,children:`Before each outgoing message`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#after-llmz-iteration`,children:`After each LLMz iteration`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`#after-conversation-end`,children:`At the end of each conversation`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`You can use Hooks to intercept and modify messages, perform logging, integrate with external systems, and more.`}),`\n`,_jsxs(Tip,{children:[_jsx(Heading,{level:`3`,id:`hooks-vs-actions-/-execute-code`,children:`Hooks vs. Actions / Execute Code`}),_jsxs(_components.p,{children:[`Hooks let you use custom code with your bot, just like `,_jsx(_components.a,{href:`/studio/concepts/actions`,children:`Actions`}),` and `,_jsx(_components.a,{href:`/studio/concepts/cards/execute-code`,children:`Execute Code Cards`}),`. The key difference is when the code runs:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Actions and Execute Code Cards run at some point in your `,_jsx(_components.a,{href:`/studio/concepts/workflows`,children:`Workflow`}),`.`]}),`\n`,_jsx(_components.li,{children:`Hooks run during specific stages of the bot’s operation cycle`}),`\n`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`When you add a new Hook, it defines a `,_jsx(_components.a,{href:`https://www.w3schools.com/js/js_functions.asp`,children:`function`}),` that executes every time your bot reaches a certain cycle of its operation.`]}),`\n`,_jsxs(_components.p,{children:[`All Hooks take an `,_jsx(_components.code,{children:`event`}),` parameter, which contains information about the event that triggered the Hook.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Some Hook types take additional parameters—check out the Hook guides on this page for more information.`})}),`\n`,_jsx(Heading,{level:`3`,id:`add-a-hook`,children:`Add a Hook`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Navigate to the `,_jsx(Icon,{icon:`anchor`}),` Hooks section in the Studio’s left navigation bar.`]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`Create Hook`}),`, then choose a type for the Hook.`]}),`\n`,_jsx(_components.li,{children:`Choose a name for the Hook. Done!`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`hook-types`,children:`Hook types`}),`\n`,_jsx(_components.p,{children:`Here’s a breakdown of each type of Hook:`}),`\n`,_jsx(Heading,{level:`3`,id:`before-incoming`,children:`Before Incoming`}),`\n`,_jsxs(_components.p,{children:[`This Hook type executes its code before your bot processes an incoming `,_jsx(_components.code,{children:`event`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-1`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-1`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-1`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`after-incoming`,children:`After Incoming`}),`\n`,_jsx(_components.p,{children:`This Hook type executes its code after the incoming message has been processed, but before the bot has responded.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-1`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-1`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-2`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-1`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-1`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-1`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-2`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-1`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-1`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-1`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-1`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-1`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-1`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-1`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-1`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-1`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-1`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-1`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-1`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-3`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-1`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-1`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-3`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-1`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-2`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-1`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-3`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`before-outgoing`,children:`Before Outgoing`}),`\n`,_jsx(_components.p,{children:`This Hook type executes its code before the bot’s reply is sent to the user.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-2`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-2`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-4`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-2`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-2`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-2`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-4`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-2`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-2`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-2`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-2`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-2`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-2`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-2`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-2`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-2`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-2`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-2`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-2`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-5`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-2`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-2`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-5`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-2`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-4`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-2`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-5`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(ResponseField,{name:`outgoingEvent`,type:`IO.OutgoingEvent`,id:`param-outgoing-event`,children:_jsx(_components.p,{children:`The message sent by the bot`})}),`\n`,_jsx(Heading,{level:`3`,id:`before-llmz-execution`,children:`Before LLMz Execution`}),`\n`,_jsx(_components.p,{children:`This Hook type executes its code before the LLMz engine begins its execution.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-3`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-3`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-6`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-3`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-3`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-3`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-6`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-3`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-3`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-3`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-3`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-3`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-3`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-3`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-3`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-3`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-3`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-3`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-3`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-7`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-3`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-3`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-7`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-3`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-6`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-3`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-7`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsxs(ResponseField,{name:`context`,type:`LLMZ.CreateContext`,id:`param-context`,children:[_jsx(_components.p,{children:`The current context provided to the LLMz`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-4`,children:_jsxs(_components.p,{children:[`The unique identifier of the LLMz execution, prefixed with `,_jsx(_components.code,{children:`llmz_`})]})}),_jsx(ResponseField,{name:`version`,type:`any`,id:`param-version`,children:_jsx(_components.p,{children:`The version of the LLMz engine or context`})}),_jsx(ResponseField,{name:`instructions`,type:`string`,optional:true,id:`param-instructions`,children:_jsx(_components.p,{children:`Optional instructions provided to guide the LLMz execution`})}),_jsx(ResponseField,{name:`objects`,type:`LLMZ.Obj[]`,id:`param-objects`,children:_jsx(_components.p,{children:`A list of objects relevant to the LLMz context`})}),_jsx(ResponseField,{name:`tools`,type:`LLMZ.Tool[]`,id:`param-tools`,children:_jsx(_components.p,{children:`A list of tools available for the LLMz engine to use`})}),_jsx(ResponseField,{name:`loop`,type:`number`,id:`param-loop`,children:_jsx(_components.p,{children:`The current loop count of the LLMz iteration process`})}),_jsx(ResponseField,{name:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`The temperature setting used for the LLM model`})}),_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model`,children:_jsx(_components.p,{children:`The name or identifier of the LLM model being used.`})}),_jsx(ResponseField,{name:`transcript`,type:`OAI.Message[]`,id:`param-transcript`,children:_jsx(_components.p,{children:`The conversation transcript, including all prior messages in the current context`})}),_jsx(ResponseField,{name:`location`,type:`LLMZ.Location`,id:`param-location`,children:_jsx(_components.p,{children:`The current location within the bot’s logic`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`after-llmz-execution`,children:`After LLMz Execution`}),`\n`,_jsx(_components.p,{children:`This Hook type executes its code after the LLMz engine finishes its execution.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-4`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-4`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-8`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-4`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-4`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-5`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-8`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-4`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-4`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-4`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-4`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-4`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-4`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-4`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-4`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-4`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-4`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-4`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-4`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-9`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-4`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-4`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-9`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-4`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-8`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-4`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-9`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(ResponseField,{name:`execution`,type:`LLMZ.ExecutionResult`,id:`param-execution`,children:_jsx(_components.p,{children:`The result of the execution`})}),`\n`,_jsx(Heading,{level:`3`,id:`after-llmz-iteration`,children:`After LLMz iteration`}),`\n`,_jsx(_components.p,{children:`Depending on how demanding the task is, the LLMz may loop through multiple iterations before finishing its execution. This Hook type executes its code after each iteration.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-5`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-5`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-10`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-5`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-5`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-6`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-10`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-5`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-5`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-5`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-5`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-5`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-5`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-5`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-5`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-5`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-5`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-5`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-5`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-11`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-5`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-5`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-11`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-5`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-10`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-5`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-11`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(ResponseField,{name:`iteration`,type:`LLMZ.IterationResult`,id:`param-iteration`,children:_jsx(_components.p,{children:`The result of the iteration`})}),`\n`,_jsx(Heading,{level:`3`,id:`after-conversation-end`,children:`After Conversation End`}),`\n`,_jsxs(_components.p,{children:[`This Hook type executes after the conversation has `,_jsx(_components.strong,{children:`explicitly ended`}),` (transitioned to an `,_jsx(_components.a,{href:`/studio/concepts/nodes/introduction#end-node`,children:`End Node`}),`)`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-6`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-6`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-12`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-6`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-6`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-7`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-12`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-6`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-6`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-6`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-6`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-6`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-6`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-6`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-6`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-6`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-6`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-6`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-6`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-13`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-6`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-6`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-13`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-6`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-12`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-6`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-13`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`after-turn-end`,children:`After Turn End`}),`\n`,_jsx(_components.p,{children:`This Hook type executes after a full turn has completed—meaning the bot has received user input, processed it, and responded.`}),`\n`,_jsxs(_components.p,{children:[`You can use a Hook of this type to `,_jsx(_components.a,{href:`/studio/guides/how-to/track-ai-spend-in-table/`,children:`track AI spend and token cost`}),` for your bot.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),`:`]}),`\n`,_jsxs(ResponseField,{name:`event`,type:`IncomingEvent`,id:`param-event-7`,children:[_jsx(_components.p,{children:`Information about the last incoming event in your bot’s execution.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`botId`,type:`string`,required:true,id:`param-bot-id-7`,children:_jsx(_components.p,{children:`The ID of the bot that experienced the event.`})}),_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-14`,children:_jsx(_components.p,{children:`The ID of the conversation that the event took place in.`})}),_jsx(ResponseField,{name:`createdOn`,type:`Date`,required:true,id:`param-created-on-7`,children:_jsxs(_components.p,{children:[`The data and time when the event was created (in `,_jsx(_components.a,{href:`https://en.wikipedia.org/wiki/ISO_8601`,children:`ISO 8601`}),` format).`]})}),_jsxs(ResponseField,{name:`direction`,type:`EventDirection`,required:true,id:`param-direction-7`,children:[_jsx(_components.p,{children:`The direction of the event, indicating whether the event was received by the bot or sent from the bot.`}),_jsx(_components.p,{children:`Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'incoming'`}),`: The event originated from the user and was received by the bot.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'outgoing'`}),`: The event was generated by the bot and sent to the user.`]}),`\n`]})]}),_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id-8`,children:_jsx(_components.p,{children:`The unique identifier for the event.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-14`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/integrations/`,children:`integration`}),` that the event occurred on.`]})}),_jsxs(ResponseField,{name:`kb`,type:`object`,id:`param-kb-7`,children:[_jsxs(_components.p,{children:[`Information about `,_jsx(_components.a,{href:`/studio/concepts/knowledge-base/introduction`,children:`Knowledge Bases`}),` queried for the event.`]}),_jsxs(Expandable,{children:[_jsxs(ResponseField,{name:`included`,type:`Studio.KnowledgeBase.KB[]`,required:true,id:`param-included-7`,children:[_jsx(_components.p,{children:`Array of Knowledge Bases queried for the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`results`,type:`Studio.KnowledgeBase.ContentResult[]`,id:`param-results-7`,children:[_jsx(_components.p,{children:`Array of Knowledge Base results consulted for this event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]})]})]}),_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id-7`,children:_jsx(_components.p,{children:`The unique identifier for the current event’s message.`})}),_jsx(ResponseField,{name:`payload`,type:`object`,required:true,id:`param-payload-7`,children:_jsx(_components.p,{children:`The payload for the current event.`})}),_jsx(ResponseField,{name:`preview`,type:`string`,required:true,id:`param-preview-7`,children:_jsx(_components.p,{children:`A representation of the event in plain text. If the event is text message, this property will contain the message itself.`})}),_jsxs(ResponseField,{name:`state`,type:`EventState`,required:true,id:`param-state-7`,children:[_jsx(_components.p,{children:`Data related to the state of the event.`}),_jsx(Warning,{children:_jsx(_components.p,{children:`Since most of this object’s properties are for internal use by Botpress, we’ve omitted its deeper structure from this documentation.`})})]}),_jsxs(ResponseField,{name:`tags`,type:`EventTags`,id:`param-tags-7`,children:[_jsx(_components.p,{children:`Any tags associated with the current event. These can contain useful data related to the integration associated with the event.`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversation`,type:`object`,id:`param-conversation-7`,children:_jsx(_components.p,{children:`Tags for the conversation.`})}),_jsx(ResponseField,{name:`message`,type:`object`,id:`param-message-7`,children:_jsx(_components.p,{children:`Tags for the message.`})}),_jsx(ResponseField,{name:`user`,type:`object`,id:`param-user-7`,children:_jsx(_components.p,{children:`Tags for the user.`})})]})]}),_jsxs(ResponseField,{name:`trigger`,type:`DM.Trigger`,id:`param-trigger-7`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/studio/concepts/triggers`,children:`Trigger`}),` that sent the event.`]}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-15`,children:_jsx(_components.p,{children:`The ID of the conversation associated with this Trigger.`})}),_jsx(ResponseField,{name:`eventName`,type:`string`,id:`param-event-name-7`,children:_jsx(_components.p,{children:`The name of the event that the Trigger sent.`})}),_jsx(ResponseField,{name:`flowId`,type:`string`,required:true,id:`param-flow-id-7`,children:_jsx(_components.p,{children:`The ID of the Workflow containing the Trigger.`})}),_jsx(ResponseField,{name:`integration`,type:`string`,id:`param-integration-15`,children:_jsx(_components.p,{children:`The integration associated with the Trigger.`})}),_jsx(ResponseField,{name:`nodeId`,type:`string`,required:true,id:`param-node-id-7`,children:_jsx(_components.p,{children:`The ID of the Node that contains the Trigger.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-14`,children:_jsx(_components.p,{children:`The ID of the user associated with this Trigger.`})})]})]}),_jsx(ResponseField,{name:`type`,type:`string`,required:true,id:`param-type-7`,children:_jsx(_components.p,{children:`The type of the event.`})}),_jsx(ResponseField,{name:`userId`,type:`string`,id:`param-user-id-15`,children:_jsx(_components.p,{children:`The user ID associated with this event.`})})]})]}),`\n`,_jsxs(ResponseField,{name:`metadata`,type:`IO.TurnMetadata`,id:`param-metadata`,children:[_jsx(_components.p,{children:`The turn’s metadata`}),_jsx(Expandable,{children:_jsxs(ResponseField,{name:`tokens`,type:`IO.TokenReport`,id:`param-tokens`,children:[_jsx(_components.p,{children:`The token information and cost for the current turn`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`summary`,type:`string`,id:`param-summary`,children:_jsx(_components.p,{children:`A summary of the token usage for the last turn`})}),_jsx(ResponseField,{name:`details`,type:`string`,id:`param-details`,children:_jsx(_components.p,{children:`A detailed breakdown of token usage for the last turn`})}),_jsx(ResponseField,{name:`billedTokens`,type:`number`,id:`param-billed-tokens`,children:_jsx(_components.p,{children:`The number of billed tokens during the last turn`})}),_jsxs(ResponseField,{name:`usages`,type:`IO.TokenUsage[]`,id:`param-usages`,children:[_jsx(_components.p,{children:`An array of token usages`}),_jsxs(Expandable,{children:[_jsx(ResponseField,{name:`count`,type:`number`,id:`param-count`,children:_jsx(_components.p,{children:`The number of tokens in the usage`})}),_jsx(ResponseField,{name:`spend`,type:`number`,id:`param-spend`,children:_jsx(_components.p,{children:`The AI spend for the usage (in nanodollars). To get the number in dollars, divide this number by 1,000,000,000.`})}),_jsx(ResponseField,{name:`duration`,type:`number`,id:`param-duration`,children:_jsx(_components.p,{children:`The duration (in milliseconds) of the usage`})}),_jsx(ResponseField,{name:`location`,type:`string`,id:`param-location-1`,children:_jsx(_components.p,{children:`The location in the Workflow where the usage occurred`})}),_jsx(ResponseField,{name:`cached`,type:`boolean`,id:`param-cached`,children:_jsx(_components.p,{children:`Whether the usage was cached`})})]})]}),_jsx(ResponseField,{name:`totalTokens`,type:`number`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`The total number of tokens used in the last turn`})}),_jsx(ResponseField,{name:`billedTokens`,type:`number`,id:`param-billed-tokens-1`,children:_jsx(_components.p,{children:`The total number of billed tokens used in the last turn`})}),_jsx(ResponseField,{name:`cost`,type:`number`,id:`param-cost`,children:_jsx(_components.p,{children:`The AI spend for the last turn (in nanodollars). To get the number in dollars, divide this number by 1,000,000,000.`})}),_jsx(ResponseField,{name:`savingsPercent`,type:`number`,id:`param-savings-percent`,children:_jsx(_components.p,{children:`The percentage of savings on AI spend for this turn.`})})]})]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(_components.p,{children:[`If your Hook isn’t behaving as expected, you can `,_jsx(_components.a,{href:`/studio/concepts/debugger-logs-json`,children:`check your bot’s logs`}),` to diagnose any problems.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"light-plus","dark":"dark-plus"}},"config":{},"pageMetadata":{"title":"Hooks","icon":"anchor","description":null,"href":"/studio/concepts/hooks"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Hooks vs. Actions / Execute Code","slug":"hooks-vs-actions-/-execute-code","depth":3,"children":[]},{"title":"Overview","slug":"overview","depth":2,"children":[{"title":"Add a Hook","slug":"add-a-hook","depth":3,"children":[]}]},{"title":"Hook types","slug":"hook-types","depth":2,"children":[{"title":"Before Incoming","slug":"before-incoming","depth":3,"children":[]},{"title":"After Incoming","slug":"after-incoming","depth":3,"children":[]},{"title":"Before Outgoing","slug":"before-outgoing","depth":3,"children":[]},{"title":"Before LLMz Execution","slug":"before-llmz-execution","depth":3,"children":[]},{"title":"After LLMz Execution","slug":"after-llmz-execution","depth":3,"children":[]},{"title":"After LLMz iteration","slug":"after-llmz-iteration","depth":3,"children":[]},{"title":"After Conversation End","slug":"after-conversation-end","depth":3,"children":[]},{"title":"After Turn End","slug":"after-turn-end","depth":3,"children":[]}]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/botpress/23aca718097b723a/assistant.js"],"subdomain":"botpress","siteName":"Botpress","title":"Hooks - Botpress","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-27T14:27:32.210Z","gitLastModified":"2026-01-27T16:34:51.000Z","originalFileLocation":"studio/concepts/hooks.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Botpress\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Hooks - Botpress\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Botpress\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://botpress.com/docs/studio/concepts/hooks\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://botpress.mintlify.site/docs/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Hooks\u0026amp;theme=63a1c5595f8ccc36d23d20dd\u0026amp;signature=4e3e7aa1bf746434bccd9a0a96a7f062c1171ae49d479d92da8175990b88bc5e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Hooks - Botpress\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://botpress.mintlify.site/docs/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Hooks\u0026amp;theme=63a1c5595f8ccc36d23d20dd\u0026amp;signature=4e3e7aa1bf746434bccd9a0a96a7f062c1171ae49d479d92da8175990b88bc5e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/botpress/3EHKtqGGIcjUKtI6/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Botpress\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0090FF\">\u003cmeta data-mint-head name=\"og:logo\" content=\"/meta-assets/meta-logo.png\">\u003clink data-mint-head rel=\"canonical\" href=\"https://botpress.com/docs/studio/concepts/hooks\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/studio/concepts/hooks.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://botpress.com/#organization\",\"name\":\"Botpress\",\"url\":\"https://botpress.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/botpress/U-4GnVaxESbJOVgP/logo/light.svg?fit=max\u0026auto=format\u0026n=U-4GnVaxESbJOVgP\u0026q=85\u0026s=df22258e2155256a01174f5316ebc024\"}},{\"@type\":\"WebSite\",\"@id\":\"https://botpress.com/docs#website\",\"name\":\"Botpress\",\"url\":\"https://botpress.com/docs\",\"publisher\":{\"@id\":\"https://botpress.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://botpress.com/docs/studio/concepts/hooks#webpage\",\"url\":\"https://botpress.com/docs/studio/concepts/hooks\",\"name\":\"Hooks\",\"dateModified\":\"2026-01-27T16:34:51.000Z\",\"isPartOf\":{\"@id\":\"https://botpress.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://botpress.com/docs/studio/concepts/hooks#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://botpress.com/docs/studio/concepts/hooks#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Studio\",\"item\":\"https://botpress.com/docs/studio/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Concepts\",\"item\":\"https://botpress.com/docs/studio/concepts/home\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Hooks\",\"item\":\"https://botpress.com/docs/studio/concepts/hooks\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://botpress.com/docs/studio/concepts/hooks#article\",\"headline\":\"Hooks\",\"name\":\"Hooks\",\"url\":\"https://botpress.com/docs/studio/concepts/hooks\",\"mainEntityOfPage\":{\"@id\":\"https://botpress.com/docs/studio/concepts/hooks#webpage\"},\"dateModified\":\"2026-01-27T16:34:51.000Z\",\"publisher\":{\"@id\":\"https://botpress.com/#organization\"},\"isPartOf\":{\"@id\":\"https://botpress.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Botpress\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Botpress","nav":{"global":{"anchors":[{"anchor":"Community Discord","icon":"discord","href":"https://discord.com/invite/botpress"},{"anchor":"News \u0026 Resources","icon":"newspaper","href":"https://botpress.com/blog"}]},"tabs":[{"tab":"Docs","pages":[{"group":"Get started","pages":[{"title":"Welcome to Botpress","mode":"frame","href":""},{"title":"Quickstart","href":"/get-started/quick-start"},{"group":"Manage your agent","pages":[{"title":"Preview","href":"/get-started/manage-your-agent/preview"},{"title":"Monitor performance","href":"/get-started/manage-your-agent/monitor"},{"title":"Add knowledge sources","href":"/get-started/manage-your-agent/knowledge"},{"title":"Inspect behaviour","href":"/get-started/manage-your-agent/inspect"},{"title":"Configure Human Handoff","tag":"Plus","href":"/get-started/manage-your-agent/human-handoff"},{"title":"Edit appearance","href":"/get-started/manage-your-agent/edit-appearance"},{"title":"Control access to your agent","sidebarTitle":"Control access","tag":"Team","href":"/get-started/manage-your-agent/control-access"}]},{"title":"Configure your workspace","href":"/get-started/configure-your-workspace"}]},{"group":"ADK","pages":[{"title":"Botpress ADK","sidebarTitle":"Get started","href":"/adk"}]},{"group":"Studio","pages":[{"title":"Introduction to Studio","sidebarTitle":"Introduction","href":"/studio/introduction"},{"title":"Tutorial","href":"/tutorial"},{"group":"Concepts","pages":[{"title":"Home","icon":"house","href":"/studio/concepts/home"},{"group":"Nodes","icon":"square-mouse-pointer","pages":[{"title":"Nodes","sidebarTitle":"Introduction","href":"/studio/concepts/nodes/introduction"},{"title":"Autonomous Node","href":"/studio/concepts/nodes/autonomous-node"}]},{"group":"Cards","icon":"rows-3","pages":[{"title":"Cards","sidebarTitle":"Overview","href":"/studio/concepts/cards/introduction"},{"title":"Send Messages","href":"/studio/concepts/cards/send-messages"},{"title":"Execute Code","href":"/studio/concepts/cards/execute-code"},{"title":"Tables","href":"/studio/concepts/cards/tables"},{"title":"Set inactivity timeout","href":"/studio/concepts/cards/set-inactivity-timeout"},{"title":"Webchat","href":"/studio/concepts/cards/webchat"},{"title":"Flow Logic","href":"/studio/concepts/cards/flow-logic"},{"group":"AI","pages":[{"title":"AI","sidebarTitle":"Introduction","href":"/studio/concepts/cards/ai/introduction"},{"title":"AI Task","href":"/studio/concepts/cards/ai/ai-task"},{"title":"AI Transition","href":"/studio/concepts/cards/ai/ai-transition"},{"title":"AI Generate Text","href":"/studio/concepts/cards/ai/ai-generate-text"}]},{"title":"Capture Information","href":"/studio/concepts/cards/capture-information"},{"title":"Fixed Schedule","href":"/studio/concepts/cards/fixed-schedule"},{"title":"Agents","href":"/studio/concepts/cards/agents"},{"title":"Utilities","href":"/studio/concepts/cards/utilities"}]},{"title":"Workflows","icon":"workflow","href":"/studio/concepts/workflows"},{"group":"Knowledge Bases","icon":"book-open","pages":[{"title":"Knowledge Bases","sidebarTitle":"Overview","href":"/studio/concepts/knowledge-base/introduction"},{"title":"Add sources to Knowledge Base","sidebarTitle":"Add sources","href":"/studio/concepts/knowledge-base/add-sources"},{"title":"Knowledge Base Best Practices","sidebarTitle":"Best practices","href":"/studio/concepts/knowledge-base/knowledge-base-best-practices"}]},{"title":"Tables","icon":"table","href":"/studio/concepts/tables"},{"title":"Actions","icon":"bolt","href":"/studio/concepts/actions"},{"group":"Agents","icon":"bot","pages":[{"title":"Agents","sidebarTitle":"Introduction","href":"/studio/concepts/agents/introduction"},{"title":"Summary Agent","href":"/studio/concepts/agents/summary-agent"},{"title":"Personality Agent","href":"/studio/concepts/agents/personality-agent"},{"title":"Policy Agent","href":"/studio/concepts/agents/policy-agent"},{"title":"Translator Agent","href":"/studio/concepts/agents/translator-agent"},{"title":"Knowledge Agent","href":"/studio/concepts/agents/knowledge-agent"},{"title":"HITL Agent","href":"/studio/concepts/agents/hitl-agent"},{"title":"Vision Agent","href":"/studio/concepts/agents/vision-agent"},{"title":"Analytics Agent","description":"Collects, analyzes, and stores data on bot interactions.","href":"/studio/concepts/agents/analytics-agent"}]},{"title":"Hooks","icon":"anchor","href":"/studio/concepts/hooks"},{"title":"Hub","description":"Download and install integrations with external services or premade Workflows from across the web.","icon":"boxes","href":"/studio/concepts/card-hub"},{"title":"Integrations","icon":"plug","href":"/studio/concepts/integrations"},{"title":"Schemas","icon":"circle-dashed","href":"/studio/concepts/schemas"},{"title":"Versions","icon":"history","href":"/studio/concepts/versions"},{"title":"Bot Settings","icon":"settings","href":"/studio/concepts/bot-settings"},{"title":"Find","icon":"search","href":"/studio/concepts/find"},{"group":"Variables","icon":"variable","pages":[{"title":"Variables","sidebarTitle":"Overview","href":"/studio/concepts/variables/overview"},{"group":"Scopes","pages":[{"title":"Workflow variables","href":"/studio/concepts/variables/scopes/workflow"},{"title":"User variables","href":"/studio/concepts/variables/scopes/user"},{"title":"Conversation variables","href":"/studio/concepts/variables/scopes/conversation"},{"title":"Bot variables","href":"/studio/concepts/variables/scopes/bot"},{"title":"Configuration variables","href":"/studio/concepts/variables/scopes/configuration"}]},{"title":"Built-in variables","href":"/studio/concepts/variables/built-in"},{"title":"Pass variables between Workflows","sidebarTitle":"Pass between Workflows","href":"/studio/concepts/variables/pass-between-workflows"},{"title":"Use variables in code","href":"/studio/concepts/variables/in-code"}]},{"title":"Triggers","icon":"play","href":"/studio/concepts/triggers"},{"title":"Debugger, Logs \u0026 JSON","icon":"logs","href":"/studio/concepts/debugger-logs-json"},{"title":"Emulator","icon":"messages-square","href":"/studio/concepts/emulator"},{"title":"Import \u0026 Export","icon":"folder-sync","href":"/studio/concepts/import-export-bots"},{"title":"Copy to bot","icon":"copy","href":"/studio/concepts/copy-to-bot"},{"group":"Controls and Settings","icon":"wrench","pages":[{"title":"Keyboard Shortcuts","href":"/studio/concepts/controls-and-settings/keyboard-shortcuts"},{"title":"Commands","href":"/studio/concepts/controls-and-settings/studio-commands"},{"title":"Studio Preferences","href":"/studio/concepts/controls-and-settings/studio-preferences"}]}]},{"group":"Guides","pages":[{"title":"Introduction","href":"/studio/guides/introduction"},{"group":"How-to","pages":[{"title":"Translate Webchat UI","href":"/studio/guides/how-to/translate"},{"title":"Send reminders to conversations","href":"/studio/guides/how-to/send-reminders"},{"title":"Use different LLM for Autonomous Nodes","href":"/studio/guides/how-to/different-an-models"},{"title":"Track AI spend in a table","href":"/studio/guides/how-to/track-ai-spend-in-table"},{"title":"Send options as a dropdown menu","href":"/studio/guides/how-to/dropdown-menus"}]},{"group":"Advanced","pages":[{"title":"Using code in Studio","href":"/studio/guides/advanced/use-code"},{"title":"Event Properties","href":"/studio/guides/advanced/event-properties"},{"title":"State Management","href":"/studio/guides/advanced/best-practices-for-state-management"},{"group":"Safety","pages":[{"title":"Safety","sidebarTitle":"Introduction","href":"/studio/guides/advanced/safety/introduction"},{"title":"Preventing Abuse","href":"/studio/guides/advanced/safety/preventing-abuse"},{"title":"Brand Safety Framework","href":"/studio/guides/advanced/safety/brand-safety-framework"}]},{"group":"Exporting Data","pages":[{"title":"Exporting Data","sidebarTitle":"Introduction","href":"/studio/guides/advanced/exporting-data/introduction"},{"title":"Raw Conversations","href":"/studio/guides/advanced/exporting-data/exporting-raw-conversations-with-the-botpress-api"},{"title":"Conversation History","href":"/studio/guides/advanced/exporting-data/getting-the-conversation-history-from-within-your-bot"},{"title":"Streaming Analytics","href":"/studio/guides/advanced/exporting-data/streaming-analytics-from-within-your-bot-with-hooks"},{"title":"Compiled Bot Analytics","href":"/studio/guides/advanced/exporting-data/exporting-compiled-bot-analytics-with-the-botpress-api"},{"title":"Accessing The Autonomous Nodes Thought Process","href":"/studio/guides/advanced/exporting-data/analyze-llmz-responses"}]},{"title":"Advanced Starter Template","href":"/studio/guides/advanced/kitchen-sink-advanced-starter-template"},{"title":"Tips to optimize AI Cost","href":"/studio/guides/advanced/tips-to-optimize-ai-cost"},{"title":"Retention Period","href":"/studio/guides/advanced/retention-period"},{"title":"Botpress v12 (and self-hosted versions)","sidebarTitle":"Botpress v12","href":"/studio/guides/advanced/v12"}]}]}]},{"group":"Integrations","pages":[{"title":"Introduction to integrations","sidebarTitle":"Introduction","href":"/integrations/get-started/introduction"},{"title":"Botpress Hub","sidebarTitle":"Hub","href":"/integrations/get-started/botpress-hub"},{"group":"Guides","pages":[{"title":"Apify (Advanced Website Crawler)","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/apify.svg","href":"/integrations/integration-guides/plus-apify"},{"title":"Apollo","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/apollo.jpeg","href":"/integrations/integration-guides/apollo"},{"title":"Attio","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/attio.png","href":"/integrations/integration-guides/attio"},{"title":"Asana","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/asana.svg","href":"/integrations/integration-guides/asana"},{"title":"BambooHR","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/bamboohr.svg","href":"/integrations/integration-guides/bamboohr"},{"title":"Canny","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/canny.svg","href":"/integrations/integration-guides/canny"},{"title":"Chat","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/chat.svg","href":"/integrations/integration-guides/chat"},{"title":"Chatwoot","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/chatwoot.svg","href":"/integrations/integration-guides/chatwoot"},{"title":"Discord","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/discord.svg","href":"/integrations/integration-guides/discord"},{"title":"Email Notifier","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/email-notifier.svg","href":"/integrations/integration-guides/plus-email-notifier"},{"title":"GitHub","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/github.svg","href":"/integrations/integration-guides/github"},{"title":"Gmail","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/gmail.svg","href":"/integrations/integration-guides/gmail"},{"title":"Google Analytics","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/google-analytics.svg","href":"/integrations/integration-guides/plus-google-analytics"},{"title":"Google Calendar","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/googlecalendar.svg","href":"/integrations/integration-guides/googlecalendar"},{"title":"Google Sheets","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/gsheets.svg","href":"/integrations/integration-guides/gsheets"},{"group":"HITL","icon":"/integrations/integration-guides/assets/icons/hitl.svg","pages":[{"title":"Human-in-the-Loop (HITL)","sidebarTitle":"Setup","href":"/integrations/integration-guides/hitl/introduction"},{"title":"Measure HITL Response Time","sidebarTitle":"Measure HITL Response Time","href":"/integrations/integration-guides/hitl/time-to-first-agent-response"}]},{"title":"HubSpot","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/hubspot.svg","href":"/integrations/integration-guides/hubspot"},{"title":"Hunter","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/hunter.svg","href":"/integrations/integration-guides/hunter"},{"title":"Improvement","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/improvement.svg","href":"/integrations/integration-guides/improvement"},{"title":"Instagram","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/instagram.svg","href":"/integrations/integration-guides/instagram"},{"title":"Intercom","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/intercom.svg","href":"/integrations/integration-guides/intercom"},{"title":"Klaviyo","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/klaviyo.png","href":"/integrations/integration-guides/klaviyo"},{"title":"Knowledge Base Optimizer","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/knowledge-base-optimization.svg","href":"/integrations/integration-guides/knowledge-base-optimization"},{"title":"Kommo","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/kommo.svg","tag":"New","href":"/integrations/integration-guides/kommo"},{"title":"Line","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/line.svg","href":"/integrations/integration-guides/line"},{"title":"Linear","icon":"https://cdn.simpleicons.org/linear/5E6AD2","href":"/integrations/integration-guides/linear"},{"title":"LinkedIn","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/linkedin.svg","tag":"New","href":"/integrations/integration-guides/linkedin"},{"title":"Loops","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/loops.svg","href":"/integrations/integration-guides/loops"},{"title":"MailerLite","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/mailerlite.svg","href":"/integrations/integration-guides/mailerlite"},{"title":"Messenger and Facebook","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/messenger-and-facebook.svg","href":"/integrations/integration-guides/messenger"},{"title":"Mintlify","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/mintlify.png","href":"/integrations/integration-guides/mintlify"},{"title":"Persat","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/persat.png","href":"/integrations/integration-guides/plus-persat"},{"title":"Microsoft Teams","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/teams.svg","href":"/integrations/integration-guides/teams"},{"title":"Notion","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/notion.png","href":"/integrations/integration-guides/notion"},{"title":"Pipedrive","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/pipedrive.svg","href":"/integrations/integration-guides/pipedrive"},{"title":"Slack","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/slack.svg","href":"/integrations/integration-guides/slack"},{"group":"Sunshine Conversation","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/sunco.svg","pages":[{"title":"Sunshine Conversations","sidebarTitle":"Introduction","href":"/integrations/integration-guides/sunshine-conversations/introduction"},{"title":"Zendesk Messaging","href":"/integrations/integration-guides/sunshine-conversations/zendesk-messaging"}]},{"title":"Telegram","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/telegram.svg","href":"/integrations/integration-guides/telegram"},{"title":"Trello","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/trello.svg","href":"/integrations/integration-guides/trello"},{"title":"Twilio","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/twilio.svg","href":"/integrations/integration-guides/twilio"},{"title":"Viber","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/viber.svg","href":"/integrations/integration-guides/viber"},{"title":"Vonage","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/vonage.png","href":"/integrations/integration-guides/vonage"},{"title":"Webhook","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/webhook.svg","href":"/integrations/integration-guides/webhook"},{"title":"Workable","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/workable.svg","href":"/integrations/integration-guides/workable"},{"group":"WhatsApp","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/whatsapp.svg","pages":[{"title":"WhatsApp Setup","sidebarTitle":"Setup","href":"/integrations/integration-guides/whatsapp/introduction"},{"group":"Mapping","pages":[{"title":"Mapping from Botpress to WhatsApp","sidebarTitle":"Botpress to WhatsApp","href":"/integrations/integration-guides/whatsapp/mapping/botpress-to-whatsapp"},{"title":"Mapping from WhatsApp to Botpress","sidebarTitle":"WhatsApp to Botpress","href":"/integrations/integration-guides/whatsapp/mapping/whatsapp-to-botpress"}]},{"title":"Start a WhatsApp conversation proactively","sidebarTitle":"Start proactively","href":"/integrations/integration-guides/whatsapp/whatsapp-start-proactively"},{"title":"Start a conversation on WhatsApp through a webhook","sidebarTitle":"Start conversation through a webhook","href":"/integrations/integration-guides/whatsapp/start-conversation-through-webhook"}]},{"title":"Zapier","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/zapier.svg","href":"/integrations/integration-guides/zapier"},{"title":"Zendesk","icon":"https://mintlify.s3.us-west-1.amazonaws.com/botpress/integrations/integration-guides/assets/icons/zendesk.jpeg","href":"/integrations/integration-guides/zendesk"}]},{"group":"SDK","pages":[{"title":"Overview","href":"/integrations/sdk/overview"},{"title":"Installation","href":"/integrations/sdk/installation"},{"group":"Integrations","pages":[{"title":"Get started","href":"/integrations/sdk/integration/getting-started"},{"title":"Integration for Messaging Channels","sidebarTitle":"Messaging","href":"/integrations/sdk/integration/messaging"},{"title":"Integrations Concepts","sidebarTitle":"Concepts","href":"/integrations/sdk/integration/concepts"},{"title":"Publish your integration on Botpress Hub","sidebarTitle":"Publish on Botpress Hub","href":"/integrations/sdk/integration/publish-your-integration-on-botpress-hub"},{"title":"Enable OAuth","sidebarTitle":"Allow installing with OAuth","href":"/integrations/sdk/integration/enable-oauth"},{"title":"Use your own LLM","href":"/integrations/sdk/integration/use-your-own-llm"}]},{"group":"Interfaces","pages":[{"title":"Introduction to interfaces","sidebarTitle":"Introduction","href":"/integrations/sdk/interface/introduction"},{"title":"How to implement an interface in your integration","sidebarTitle":"How to implement interfaces","href":"/integrations/sdk/interface/how-tos/add-and-implement"},{"title":"Implementing Human in the loop (HITL) in an integration","sidebarTitle":"Implement HITL","href":"/integrations/sdk/interface/how-tos/implementing-hitl"},{"title":"Implementing unidirectional file synchronization in an integration","sidebarTitle":"Implement File Sync","href":"/integrations/sdk/interface/how-tos/implementing-file-sync"}]},{"title":"Bots-as-code","href":"/integrations/sdk/bots-as-code"},{"title":"CLI reference","href":"/integrations/sdk/cli-reference"}]}]},{"group":"Webchat","pages":[{"title":"Introduction to Webchat","sidebarTitle":"Introduction","href":"/webchat/get-started/introduction"},{"title":"Quickstart","href":"/webchat/get-started/quick-start"},{"title":"Embed Webchat in an element","sidebarTitle":"Embed in element","href":"/webchat/get-started/embed-in-element"},{"title":"Configure Webchat","href":"/webchat/get-started/configure-your-webchat"},{"group":"Interact with Webchat","pages":[{"title":"Open/close your Webchat","href":"/webchat/interact/open-close-webchat"},{"title":"Use custom toggle to open/close Webchat","sidebarTitle":"Use custom toggle","href":"/webchat/interact/use-custom-toggle"},{"title":"Display proactive bubble","href":"/webchat/interact/proactive-message-bubble"},{"title":"Automatically open Webchat on page load","href":"/webchat/interact/open-webchat-on-page-load"},{"title":"Send user data","href":"/webchat/interact/send-user-data"},{"title":"Listen to events","href":"/webchat/interact/listen-to-events"},{"title":"Trigger actions when conversation starts","sidebarTitle":"Trigger actions on start","href":"/webchat/interact/start-trigger"},{"title":"Display notification bubble","href":"/webchat/interact/webchat-notification"},{"title":"Send a message from user","href":"/webchat/interact/send-message"},{"group":"Send custom events","pages":[{"title":"Send custom events from Webchat to your website","sidebarTitle":"From Webchat to your website","href":"/webchat/interact/send-custom-events/from-webchat"},{"title":"Send custom events from your website to Webchat","sidebarTitle":"From your website to Webchat","href":"/webchat/interact/send-custom-events/to-webchat"}]},{"title":"Update Webchat configuration","href":"/webchat/interact/update-config"},{"title":"Error handling","href":"/webchat/interact/error-handling"},{"title":"Webchat methods reference","sidebarTitle":"Methods reference","href":"/webchat/interact/reference"}]},{"group":"Integrations","pages":[{"title":"WordPress","href":"/webchat/integrations/wordpress"},{"title":"Wix","href":"/webchat/integrations/wix"},{"title":"Webflow","href":"/webchat/integrations/webflow"},{"title":"React Native","href":"/webchat/integrations/react-native"}]},{"group":"React library","pages":[{"title":"Get started","sidebarTitle":"Get started","href":"/webchat/react-library/get-started"},{"group":"Components","pages":[{"title":"Webchat","href":"/webchat/react-library/components/webchat"},{"title":"Floating Action Button","sidebarTitle":"Fab","href":"/webchat/react-library/components/fab"},{"title":"Container","href":"/webchat/react-library/components/container"},{"title":"Header","href":"/webchat/react-library/components/header"},{"title":"MessageList","href":"/webchat/react-library/components/message-list"},{"title":"Composer","href":"/webchat/react-library/components/composer"},{"title":"StylesheetProvider","href":"/webchat/react-library/components/stylesheet-provider"}]},{"group":"Hooks","pages":[{"title":"useWebchat","href":"/webchat/react-library/hooks/use-webchat-client"}]}]}]},{"group":"Botpress Desk","pages":[{"title":"Introduction to Botpress Desk","sidebarTitle":"Introduction","href":"/desk/introduction"}]}]},{"tab":"ADK","pages":[{"title":"ADK","href":"/adk/introduction"}]},{"tab":"Botpress Desk","href":"https://desk.support.channel"},{"tab":"Tutorial","pages":[{"title":"Tutorial","href":"/tutorial/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Hooks - Botpress","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":[],"chunks":[]}