Container for all bot activities (conversation flows). One BotContent per Tenant. Activities are compiled into BotContentCompiled for runtime execution.
Collection: bot-contents | DB: MongoDB
Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/content/BotContent.kt
TypeScript: hbf-core-api/src/datamodel/botContent.ts
Fields
| Field | Type | Required | Indexed | Notes |
|---|
id | String | yes | PK | MongoDB document ID |
activities | List<Activity> | yes | | Default empty list |
mainActivity | String | no | | Activity ID of main entry point |
staticVariables | List<StaticVariable> | yes | | Bot-level variables |
createdAt | Date | yes | | @CreatedDate |
updatedAt | Date | yes | | @LastModifiedDate |
Nested Objects
Activity
A logically related set of conversation content (a flow).
| Field | Type | Notes |
|---|
id | String | @Id, @NotNull |
name | Localized<String> | Multilingual name, max 254 chars |
schema | ActivitySchema | @NotNull. "FLOWGRAPH" or "FAQLITE" |
group | Localized<String> | Activity group name |
type | ActivityType | @NotNull |
nlpTrainingData | NLPTrainingData | Optional |
content | ActivityContent | @NotNull, @Valid. FlowGraphContent implementation |
tags | List<String> | Default empty |
settings | ActivitySettings | Optional |
createdAt | Date | |
forceOverwrite | Boolean | @Transient, default false |
ActivitySettings
| Field | Type | Notes |
|---|
storeAnswersByDefault | Boolean | Default: false |
automaticBackButtonForLeafMessages | Boolean | |
defaultInlineUserFeedbackData | InlineFeedbackData | |
useGeneratedResponse | Boolean | |
defaultLanguage | LanguageCode | |
NLPTrainingData
| Field | Type | Notes |
|---|
articleId | String | KB article ID for training |
supportedLanguages | List<String> | |
examples | Localized<List<String>> | Per-language example phrases |
InlineFeedbackData
| Field | Type | Notes |
|---|
enabled | Boolean | |
positive | InlineFeedbackElement | |
negative | InlineFeedbackElement | |
InlineFeedbackElement
| Field | Type | Notes |
|---|
tags | List<String> | Tags for analytics |
feedbackNodeId | String | ConvNode ID to jump to |
StaticVariable
| Field | Type | Notes |
|---|
name | String | Variable name |
value | String | Variable value |
description | String | Optional |
isConstant | Boolean | Default: false. If true, immutable at runtime |
createdAt | Date | |
updatedAt | Date | |
FlowGraphContent (implements ActivityContent)
| Field | Type | Notes |
|---|
nodes | List<FlowGraphNode> | @NotNull, @UniqueNodeIds. See flow-graph-nodes.md |
edges | List<FlowGraphEdge> | |
layout | FlowGraphLayout | VERTICAL or HORIZONTAL, default VERTICAL |
FlowGraphEdge
| Field | Type | Notes |
|---|
id | String | @NotNull |
source | String | @NotNull, source node ID |
target | String | @NotNull, target node ID |
label | String | Default "" |
sourcePositionId | String | For multi-output nodes |
BotContentCompiled
Compiled version of BotContent, generated at compile time for runtime execution.
Collection: bot-contents-compiled
| Field | Type | Notes |
|---|
id | String | PK |
activities | List<ActivityCompiled> | |
customActivities | List<ActivityCompiled> | |
metadata | BotContentCompilationMetadata | |
createdAt | Date | @CreatedDate |
updatedAt | Date | @LastModifiedDate |
ActivityCompiled
| Field | Type | Notes |
|---|
id | String | |
type | String or ActivityType | |
name | Localized<String> | |
conversationNodes | List<ConversationNode> | |
responses | Responses | Record<string, Localized<Response[]>> |
metadata | ActivityCompilationMetadata | |
BotContentCompilationMetadata
| Field | Type | Notes |
|---|
entryPoints | List<EntryPoint> | Node ID + source activity |
variables | List<VariableSpec> | |
jumpsTo | Record<String, String[]> | Activity ID to target activity IDs |
Enums
ActivityType
| Value | Description |
|---|
DECISION_TREE | Standard decision tree flow |
LIVECHAT_FLOW | Live chat handler flow |
AUTOMATED_ANSWERS | FAQ/automated answers flow |
INTERVIEW | Interview/survey flow |
USER_FEEDBACK | User feedback collection |
KNOWLEDGE_BASE | Knowledge base article flow |
LIVECHAT_SYSTEM_MESSAGE | System message for live chat |
ActivitySchema
| Value | Description |
|---|
FLOWGRAPH | Visual flow graph editor |
FAQLITE | Simplified FAQ editor |
FlowGraphLayout
| Value | Description |
|---|
VERTICAL | Top-to-bottom layout |
HORIZONTAL | Left-to-right layout |
Relationships
- Belongs to: Tenant (one BotContent per Tenant, via @DBRef)
- Contains: Activity objects (composition)
- Compiled into: BotContentCompiled
- Activities contain: FlowGraphContent with FlowGraphNode and FlowGraphEdge
TypeScript Mapping
| hbf-core (Kotlin) | hbf-core-api (TypeScript) | Notes |
|---|
| BotContent | BotContent | TS omits staticVariables, createdAt, updatedAt |
| BotContentCompiled | BotContentCompiled | Aligned |
| Activity | Activity | Aligned |
| ActivityCompiled | ActivityCompiled | Aligned |
| ActivityType | ActivityType (const enum) | Aligned |
| StaticVariable | VariableSpec | Different naming, TS adds type, fromActivity |
| FlowGraphContent | (not exported) | Gap: FlowGraphContent is internal to hbf-core |
| FlowGraphEdge | (not exported) | Gap: not in hbf-core-api |
| NLPTrainingData | NLPTrainingData | Aligned |
| ActivitySettings | ActivitySettings | Aligned |