Workflows
Create application-specific flows that map to common scenarios your users may face.
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
Basic Configuration
Core Configuration Options
Property | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the workflow |
displayName | string | Yes | Label shown to users in the UI |
goals | string[] | Yes | Goals for the workflow (not visible to users) |
informationToCollect | WorkflowInformationToCollect[] | Yes | Information to collect from users |
botPersona | string | No | The persona/character the bot should adopt |
context | string[] | No | Additional context for the LLM (not visible to users) |
guidance | string[] | No | Additional guidance for the LLM (not visible to users) |
initialReplyMessage | string | Yes | First message from the bot when workflow is selected |
supportedInputs | WorkflowInputTypes[] | No | Configuration for input collection methods |
Information Collection
The WorkflowInformationToCollect
interface defines what information needs to be gathered:
Input Types
There are two types of inputs supported for collecting information from users:
1. Built-in Modal Input
The WorkflowModalSingleInput
type opens a built-in modal with a form:
Modal Input Configuration
Property | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the input |
type | "MODAL" | Yes | Specifies this is a modal input |
displayName | string | Yes | Button label in the UI |
contentType | MessageAttachmentContentType | Yes | Type of content to collect |
workflowModalProps | WorkflowModalProps | No | Additional modal configuration |
Content Types
Two content types are supported:
- Code Content:
- Text Content:
2. Custom Function Input
The WorkflowFunctionalMultiInput
type allows you to implement custom logic for collecting information:
Functional Input Configuration
Property | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the input |
type | "FUNCTIONAL_MULTI_ATTACHMENT" | Yes | Specifies this is a functional input |
displayName | string | Yes | Button label in the UI |
onInvoke | Function | Yes | Callback function when input is triggered |
The onInvoke
function receives:
workflow
: Current workflow configurationselectedInputType
: The input type that was selectedcallback
: Function to pass back collected informationcurrentMessageAttachments
: Current attachments in the chat
Message Attachments
The MessageAttachment
interface defines the structure of attachments that can be added to messages:
Complete Example
Here's a complete workflow example for a technical support scenario: