Customization guides
Workflows
Workflows
Workflows allow you to create application-specific flows that map to common scenarios your users may face. These often map to specific tasks in your onboarding or user journey.
A workflow supports:
- A custom initial message
- Specifying clarifying questions or information the bot should ask for
- Custom attachment types that can invoke forms, modals, or API calls within your front-end application to gather user-specific information
Example
Workflow
Property | Type | Description |
---|---|---|
id | string | Required. Id of the workflow. |
displayName | string | Required. Label of workflow in the UI. |
goals | string[] | Required. Goals for the workflow, not visible to the user. |
informationToCollect | WorkflowInformationToCollect[] | Required. Information to collect from the user. Learn more. |
botPersona | string | The persona of the bot useful for defining the character, tone, and interaction style the bot will adopt when communicating with users. |
context | string[] | Additional context about this workflow for the LLM, not visible to the user. |
guidance | string[] | Additional guidance for the LLM, not visible to the user. |
initialReplyMessage | string | Required. The reply message from the bot after the user selects a workflow. |
supportedInputs | (WorkflowModalSingleInput | WorkflowFunctionalMultiInput)[] | Configuration for the workflow inputs. Learn more. |
WorkflowInformationToCollect
Property | Type | Description |
---|---|---|
description | string | Required. Description of the information to be collected from the user in order to assist them through the workflow. |
required | boolean | Required. Whether or not this information is required. |
Attachments - Built In Modal
WorkflowModalSingleInput
This input type will open a built-in modal with a form based on the configuration below to collect the user's information.
Property | Type | Description |
---|---|---|
id | string | Required. Id of the input. |
type | "MODAL" | Required. |
displayName | string | Required. Button label in the UI that opens the modal. |
contentType | WorkflowCodeContentType | WorkflowTextContentType |
workflowModalProps | WorkflowModalProps | Additional modal configuration. Learn more. |
WorkflowModalProps
Property | Type | Description |
---|---|---|
titleInputLabel | string | Label for the title input. Defaults to "Title" . |
modalHelpText | string | Help text shown in the modal. |
modalHelpElement | ReactElement | Help element shown in the modal. |
WorkflowCodeContentType
Property | Type | Description |
---|---|---|
type | "CODE" | Required. |
contentInputLabel | string | Required. Label for the content input, also provided to the LLM when chat is submitted. |
attachmentIcon | CustomIcon | Icon next to the title in the attachment item. Learn more. |
language | string | Code language. |
WorkflowTextContentType
Property | Type | Description |
---|---|---|
type | "TEXT" | Required. |
contentInputLabel | string | Required. Label for the content input, also provided to the LLM when chat is submitted. |
attachmentIcon | CustomIcon | Icon next to the title in the attachment item. Learn more. |
MessageAttachment
Property | Type | Description |
---|---|---|
contentType | WorkflowCodeContentType | WorkflowTextContentType |
title | string | Required. Attachment title. |
content | string | Required. Attachment content. |
id | string | Required. Attachment id. |
context | string[] | Additional attachment context. |
Attachments - In-app callback
WorkflowFunctionalMultiInput
This input type allows you to provide your own custom logic to pass information back to the chatbot as an attachment. This custom logic might be your own form, modal, or even via APIs that fetch information about a user from your own downstream services.
Property | Type | Description |
---|---|---|
id | string | Required. Id of the input. |
type | "FUNCTIONAL_MULTI_ATTACHMENT" | Required. |
displayName | string | Required. Button label in the UI that triggers the onInvoke function. |
onInvoke | (OnInvokeArgs) => void See below. | Required. Function that runs when the button is clicked. |
OnInvokeArgs
onInvoke
is called with the following arguments:
Property | Type | Description |
---|---|---|
workflow | Workflow | The workflow the user has selected. |
selectedInputType | WorkflowModalSingleInput | WorkflowFunctionalMultiInput[] |
callback | (messageAttachments: MessageAttachment[]) => void | Function to update the message attachments. This will override what is currently in state so append any new attachments to currentMessageAttachments to avoid removing an attachment. Learn more. |
currentMessageAttachments | MessageAttachment[] | The message attachments that user attached. Learn more. |